Changeset 5599


Ignore:
Timestamp:
Aug 5, 2017, 8:45:16 AM (4 months ago)
Author:
cameron
Message:

Bug fixes for multiblock kernel/radix64

Location:
icGREP/icgrep-devel/icgrep
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5598 r5599  
    207207ENDIF()
    208208
    209 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold -DPARABIX_VERSION='\"${Parabix_REVISION}\"'")
     209SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DPARABIX_VERSION='\"${Parabix_REVISION}\"'")
     210IF (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     211  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
     212ENDIF()
    210213
    211214SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5595 r5599  
    230230        else {
    231231            mIsDerived[i] = false;
    232             mItemsPerStride[i] = mStride;
     232            mItemsPerStride[i] = 0;  // For unknown input rate, no items will be copied to temp buffers.
    233233        }
    234234    }
     
    261261        else {
    262262            mIsDerived[i] = false;
    263             mItemsPerStride[i] = mStride;
     263            mItemsPerStride[i] = 0;  // For unknown output rate, no items will be copied to temp buffers.
    264264        }
    265265    }
     
    10291029    for (unsigned i = 0; i < mStreamSetInputBuffers.size(); i++) {
    10301030        Type * bufPtrType = mStreamSetInputBuffers[i]->getPointerType();
    1031         if ((i == 0) || mIsDerived[i]) {
     1031        if (mItemsPerStride[i] != 0) {
    10321032            Value * tempBufPtr = kb->CreateGEP(tempParameterArea, {kb->getInt32(0), kb->getInt32(i)});
    10331033            tempBufPtr = kb->CreatePointerCast(tempBufPtr, bufPtrType);
     
    10721072        }
    10731073        else {
    1074             Value * bufPtr = kb->getRawInputPointer(mStreamSetInputs[i].name, kb->getInt32(0), processedItemCount[i]);
     1074            Value * bufPtr = kb->getInputStreamBlockPtr(mStreamSetInputs[i].name, kb->getInt32(0));
    10751075            bufPtr = kb->CreatePointerCast(bufPtr, mStreamSetInputBuffers[i]->getPointerType());
    10761076            tempArgs.push_back(bufPtr);           
  • icGREP/icgrep-devel/icgrep/kernels/kernel.h

    r5595 r5599  
    338338    * pointers to linear contiguous buffer areas for each of the input stream sets, and
    339339    * pointers to linear contiguous output buffer areas for each of the output stream sets.
    340     * in each pointers are to the beginning of the block corresponding to the
    341       processedItemCount or producedItemCount of the given stream set.
    342  
    343     Notes:
     340
     341    Notes:
    344342    * if the kernel has a Lookahead dependency declared on any input stream set, then
    345343      there will be two buffer pointers for that stream set, one for accessing stream set
     
    356354      with derived processing rates will be safe to access and have data available in
    357355      accord with their processing rates based on the given number of itemsToDo
    358       of the principal input stream set; no further bounds checking is needed.
     356      of the principal input stream set; no further bounds checking is needed. 
     357    * input buffers of stream sets with MaxRatio attributes will be safe to access,
     358      but will only have valid data as specified by the available items parameter for
     359      that stream set.
    359360    * the kernel programmer is responsible for safe access and bounds checking for any
    360       input stream set classified as variable rate.
     361      input stream set classified as Unknown rate.   No temporary buffers are used
     362      for such stream sets.
    361363    * all output buffers will be safe to access and have space available
    362364      for the given maximum output generation rates based on the given number
     
    381383#.  Upon completion of multi-block processing, the Multi-Block Kernel Builder will arrange that
    382384    processed and produced item counts are updated for all stream sets that have exact
    383     processing rate attributes.   Programmers are responsible for updating the producedItemCount
    384     of any stream set declared with a variable attribute (MaxRatio).
     385    processing rate attributes.   Programmers are responsible for updating the counts
     386    of any stream set declared with a variable attribute (MaxRatio or Unknown).
    385387
    386388#.  An important caveat is that buffer areas may change arbitrarily between
  • icGREP/icgrep-devel/icgrep/kernels/radix64.cpp

    r5594 r5599  
    8080    // The main loop processes 3 packs of data at a time.
    8181    // The initial pack offsets may be nonzero.
    82    
    83     Value * sourcePackPtr = iBuilder->CreateBitCast(sourceStream, iBuilder->getBitBlockType()->getPointerTo());
     82    sourceStream = iBuilder->CreatePointerCast(sourceStream, iBuilder->getInt8PtrTy());
     83    expandedStream = iBuilder->CreatePointerCast(expandedStream, iBuilder->getInt8PtrTy());
    8484    Value * offset = iBuilder->CreateURem(iBuilder->getProcessedItemCount("sourceStream"), iBuilder->getSize(iBuilder->getBitBlockWidth()));
    85     sourcePackPtr = iBuilder->CreateGEP(sourcePackPtr, iBuilder->CreateUDiv(offset, iBuilder->getSize(PACK_SIZE)));
    86     Value * outputPackPtr = iBuilder->CreateBitCast(expandedStream, iBuilder->getBitBlockType()->getPointerTo());
     85    Value * sourcePackPtr = iBuilder->CreatePointerCast(iBuilder->CreateGEP(sourceStream, offset), iBuilder->getBitBlockType()->getPointerTo());
    8786    offset = iBuilder->CreateURem(iBuilder->getProducedItemCount("expand34Stream"), iBuilder->getSize(iBuilder->getBitBlockWidth()));
    88     outputPackPtr = iBuilder->CreateGEP(outputPackPtr, iBuilder->CreateUDiv(offset, iBuilder->getSize(PACK_SIZE)));
    89 
     87    Value * outputPackPtr = iBuilder->CreatePointerCast(iBuilder->CreateGEP(expandedStream, offset), iBuilder->getBitBlockType()->getPointerTo());
    9088    iBuilder->CreateCondBr(iBuilder->CreateICmpSGT(itemsToDo, iBuilder->getSize(0)), expand_3_4_loop, expand3_4_exit);
    9189   
Note: See TracChangeset for help on using the changeset viewer.