/[escript]/trunk/paso/src/Pattern_unrollBlocks.c
ViewVC logotype

Diff of /trunk/paso/src/Pattern_unrollBlocks.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1735 by phornby, Fri Jul 11 13:12:46 2008 UTC revision 1736 by gross, Fri Aug 29 02:23:16 2008 UTC
# Line 34  Paso_Pattern* Paso_Pattern_unrollBlocks( Line 34  Paso_Pattern* Paso_Pattern_unrollBlocks(
34                                          int type, dim_t output_block_size,dim_t input_block_size) {                                          int type, dim_t output_block_size,dim_t input_block_size) {
35    Paso_Pattern*out=NULL;    Paso_Pattern*out=NULL;
36    index_t *ptr=NULL,*index=NULL,iPtr;    index_t *ptr=NULL,*index=NULL,iPtr;
37    dim_t i,j,k, block_size, new_len, new_numOutput;    dim_t i,j,k, block_size, new_len, new_numOutput, new_numInput;
38    index_t index_offset_in=(pattern->type & PATTERN_FORMAT_OFFSET1 ? 1:0);    index_t index_offset_in=(pattern->type & PATTERN_FORMAT_OFFSET1 ? 1:0);
39    index_t index_offset_out=(type & PATTERN_FORMAT_OFFSET1 ? 1:0);    index_t index_offset_out=(type & PATTERN_FORMAT_OFFSET1 ? 1:0);
40        
# Line 59  Paso_Pattern* Paso_Pattern_unrollBlocks( Line 59  Paso_Pattern* Paso_Pattern_unrollBlocks(
59       block_size=output_block_size*input_block_size;       block_size=output_block_size*input_block_size;
60       new_len=(pattern->len)*block_size;       new_len=(pattern->len)*block_size;
61       new_numOutput=(pattern->numOutput)*output_block_size;       new_numOutput=(pattern->numOutput)*output_block_size;
62         new_numInput=(pattern->numInput)*input_block_size;
63        
64       ptr=MEMALLOC(new_numOutput+1,index_t);       ptr=MEMALLOC(new_numOutput+1,index_t);
65       index=MEMALLOC(new_len,index_t);       index=MEMALLOC(new_len,index_t);
# Line 93  Paso_Pattern* Paso_Pattern_unrollBlocks( Line 94  Paso_Pattern* Paso_Pattern_unrollBlocks(
94                }                }
95             }             }
96          }          }
97          out=Paso_Pattern_alloc(type,pattern->input_block_size * input_block_size,pattern->output_block_size * output_block_size,new_numOutput,ptr,index);          out=Paso_Pattern_alloc(type,pattern->input_block_size * input_block_size,pattern->output_block_size * output_block_size,new_numOutput,new_numInput,ptr,index);
98       }         }  
99       if (! Paso_noError()) {       if (! Paso_noError()) {
100          MEMFREE(index);          MEMFREE(index);

Legend:
Removed from v.1735  
changed lines
  Added in v.1736

  ViewVC Help
Powered by ViewVC 1.1.26