Changeset 5688 for icGREP


Ignore:
Timestamp:
Oct 13, 2017, 6:44:22 AM (19 months ago)
Author:
cameron
Message:

Multiblock kernels must receive the StreamSetBlockPtrs? in all cases, not handles!

File:
1 edited

Legend:

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

    r5650 r5688  
    817817    }
    818818    for (auto buffer : mStreamSetInputBuffers) {
    819         multiBlockParmTypes.push_back(buffer->getPointerType());
     819        multiBlockParmTypes.push_back(buffer->getStreamSetBlockType()->getPointerTo());
    820820    }
    821821    for (auto buffer : mStreamSetOutputBuffers) {
    822         multiBlockParmTypes.push_back(buffer->getPointerType());
     822        multiBlockParmTypes.push_back(buffer->getStreamSetBlockType()->getPointerTo());
    823823    }
    824824
     
    952952    }
    953953    for (unsigned i = 0; i < mStreamSetInputs.size(); i++) {
    954         Value * bufPtr = kb->CreatePointerCast(inputBlockPtr[i], mStreamSetInputBuffers[i]->getPointerType());
     954        Value * bufPtr = kb->CreatePointerCast(inputBlockPtr[i], mStreamSetInputBuffers[i]->getStreamSetBlockType()->getPointerTo());
    955955        doMultiBlockArgs.push_back(bufPtr);
    956956    }
    957957    for (unsigned i = 0; i < mStreamSetOutputs.size(); i++) {
    958         Value * bufPtr = kb->CreatePointerCast(outputBlockPtr[i], mStreamSetOutputBuffers[i]->getPointerType());
     958        Value * bufPtr = kb->CreatePointerCast(outputBlockPtr[i], mStreamSetOutputBuffers[i]->getStreamSetBlockType()->getPointerTo());
    959959        doMultiBlockArgs.push_back(bufPtr);
    960960    }
     
    10391039
    10401040    for (unsigned i = 0; i < inputSetCount; i++) {
    1041         Type * bufPtrType = mStreamSetInputBuffers[i]->getPointerType();
     1041        Type * bufPtrType = mStreamSetInputBuffers[i]->getStreamSetBlockType()->getPointerTo();
    10421042        if (mItemsPerStride[i] != 0) {
    10431043            Value * tempBufPtr = kb->CreateGEP(tempParameterArea, {kb->getInt32(0), kb->getInt32(i)});
     
    10901090        } else {
    10911091            Value * bufPtr = kb->getInputStreamBlockPtr(mStreamSetInputs[i].name, kb->getInt32(0));
    1092             bufPtr = kb->CreatePointerCast(bufPtr, mStreamSetInputBuffers[i]->getPointerType());
     1092            bufPtr = kb->CreatePointerCast(bufPtr, mStreamSetInputBuffers[i]->getStreamSetBlockType()->getPointerTo());
    10931093            tempArgs.push_back(bufPtr);           
    10941094        }
     
    10971097    for (unsigned i = 0; i < outputSetCount; i++) {
    10981098        Value * tempBufPtr = kb->CreateGEP(tempParameterArea,  {kb->getInt32(0), kb->getInt32(inputSetCount + i)});
    1099         Type * bufPtrType = mStreamSetOutputBuffers[i]->getPointerType();
     1099        Type * bufPtrType = mStreamSetOutputBuffers[i]->getStreamSetBlockType()->getPointerTo();
    11001100        tempBufPtr = kb->CreatePointerCast(tempBufPtr, bufPtrType);
    11011101        producedItemCount[i] = kb->getProducedItemCount(mStreamSetOutputs[i].name);
     
    11191119    for (unsigned i = 0; i < mStreamSetOutputBuffers.size(); i++) {
    11201120        Value * tempBufPtr = kb->CreateGEP(tempParameterArea,  {kb->getInt32(0), kb->getInt32(mStreamSetInputs.size() + i)});
    1121         tempBufPtr = kb->CreatePointerCast(tempBufPtr, mStreamSetOutputBuffers[i]->getPointerType());
     1121        tempBufPtr = kb->CreatePointerCast(tempBufPtr, mStreamSetOutputBuffers[i]->getStreamSetBlockType()->getPointerTo());
    11221122        Value * finalOutputItems = kb->getProducedItemCount(mStreamSetOutputs[i].name);
    11231123        Value * copyItems = kb->CreateSub(finalOutputItems, outputBasePos[i]);
     
    11361136        Value * copyItems2 = kb->CreateSub(copyItems, copyItems1);
    11371137        Value * nextBasePos = kb->CreateAdd(outputBasePos[i], copyItems1);
    1138         Type * bufPtrType = mStreamSetOutputBuffers[i]->getPointerType();
     1138        Type * bufPtrType = mStreamSetOutputBuffers[i]->getStreamSetBlockType()->getPointerTo();
    11391139        Value * nextOutputPtr = kb->CreatePointerCast(kb->getRawOutputPointer(mStreamSetOutputs[i].name, kb->getInt32(0), nextBasePos), bufPtrType);
    11401140        tempBufPtr = kb->CreateGEP(tempBufPtr, kb->CreateUDiv(copyItems1, blockSize));
Note: See TracChangeset for help on using the changeset viewer.