Ignore:
Timestamp:
Jan 27, 2017, 2:22:06 PM (2 years ago)
Author:
nmedfort
Message:

Optimized Symbol Generation (and fixed potential bug that could allow duplicate names being constructed); made PabloKernel? extend PabloAST (temporarily removed PabloAST::getName() to avoid diamond problem); added an internal scalar to PabloKernel? struct for each Count to avoid InOut? output scalar variable problem; allowed CodeMotionPass? to move code within the same scope but across a branch statement. Began work on separating Kernels into either Block-Oriented or Segment-Oriented kernels.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.cpp

    r5276 r5283  
    6666}
    6767
    68 P2SKernel::P2SKernel(IDISA::IDISA_Builder * iBuilder) :
    69     KernelBuilder(iBuilder, "p2s",
    70                   {Binding{iBuilder->getStreamSetTy(8, 1), "basisBits"}},
    71                   {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
    72                   {}, {}, {}) {
    73 
    74     }
     68P2SKernel::P2SKernel(IDISA::IDISA_Builder * iBuilder)
     69: BlockOrientedKernel(iBuilder, "p2s",
     70              {Binding{iBuilder->getStreamSetTy(8, 1), "basisBits"}},
     71              {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
     72              {}, {}, {}) {
     73
     74}
    7575   
    7676
     
    117117   
    118118P2SKernelWithCompressedOutput::P2SKernelWithCompressedOutput(IDISA::IDISA_Builder * iBuilder)
    119 : KernelBuilder(iBuilder, "p2s_compress",
     119: BlockOrientedKernel(iBuilder, "p2s_compress",
    120120              {Binding{iBuilder->getStreamSetTy(8, 1), "basisBits"}, Binding{iBuilder->getStreamSetTy(1, 1), "deletionCounts"}},
    121121              {Binding{iBuilder->getStreamSetTy(1, 8), "byteStream"}},
     
    134134    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
    135135    Value * self = getParameter(doBlockFunction, "self");
    136     Value * blockNo = getScalarField(self, blockNoScalar);   
    137    
     136    Value * blockNo = getScalarField(self, blockNoScalar);
     137
    138138    Value * hi_input[8];
    139139    for (unsigned j = 0; j < 8; ++j) {
     
    165165   
    166166
    167 P2S16Kernel::P2S16Kernel(IDISA::IDISA_Builder * iBuilder) :
    168     KernelBuilder(iBuilder, "p2s_16",
    169                   {Binding{iBuilder->getStreamSetTy(16, 1), "basisBits"}},
    170                   {Binding{iBuilder->getStreamSetTy(1, 16), "i16Stream"}},
    171                   {}, {}, {}) {
    172        
    173     }
     167P2S16Kernel::P2S16Kernel(IDISA::IDISA_Builder * iBuilder)
     168: BlockOrientedKernel(iBuilder, "p2s_16",
     169              {Binding{iBuilder->getStreamSetTy(16, 1), "basisBits"}},
     170              {Binding{iBuilder->getStreamSetTy(1, 16), "i16Stream"}},
     171              {}, {}, {}) {
     172
     173}
    174174
    175175   
     
    240240}
    241241   
    242 P2S16KernelWithCompressedOutput::P2S16KernelWithCompressedOutput(IDISA::IDISA_Builder * iBuilder) :
    243     KernelBuilder(iBuilder, "p2s_16_compress",
    244                   {Binding{iBuilder->getStreamSetTy(16, 1), "basisBits"}, Binding{iBuilder->getStreamSetTy(1, 1), "deletionCounts"}},
    245                   {Binding{iBuilder->getStreamSetTy(1, 16), "i16Stream"}},
    246                   {},
    247                   {},
    248                   {Binding{iBuilder->getSizeTy(), "unitsGenerated"}, Binding{iBuilder->getSizeTy(), "unitsWritten"}}) {
    249         setDoBlockUpdatesProducedItemCountsAttribute(true);
    250 }
    251    
    252    
    253 }
     242P2S16KernelWithCompressedOutput::P2S16KernelWithCompressedOutput(IDISA::IDISA_Builder * iBuilder)
     243: BlockOrientedKernel(iBuilder, "p2s_16_compress",
     244              {Binding{iBuilder->getStreamSetTy(16, 1), "basisBits"}, Binding{iBuilder->getStreamSetTy(1, 1), "deletionCounts"}},
     245              {Binding{iBuilder->getStreamSetTy(1, 16), "i16Stream"}},
     246              {},
     247              {},
     248              {Binding{iBuilder->getSizeTy(), "unitsGenerated"}, Binding{iBuilder->getSizeTy(), "unitsWritten"}}) {
     249    setDoBlockUpdatesProducedItemCountsAttribute(true);
     250}
     251   
     252   
     253}
Note: See TracChangeset for help on using the changeset viewer.