Changeset 5460 for icGREP/icgrep-devel


Ignore:
Timestamp:
May 19, 2017, 3:49:15 PM (2 years ago)
Author:
cameron
Message:

Type error fix

File:
1 edited

Legend:

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

    r5456 r5460  
    955955    for (unsigned i = 0; i < mStreamSetInputBuffers.size(); i++) {
    956956        Value * tempBufPtr = kb->CreateGEP(tempParameterArea, kb->getInt32(i));
    957         tempBufPtr = kb->CreatePointerCast(tempBufPtr, mStreamSetInputBuffers[i]->getPointerType());
     957        Type * bufPtrType = mStreamSetInputBuffers[i]->getPointerType();
     958        tempBufPtr = kb->CreatePointerCast(tempBufPtr, bufPtrType);
    958959        Value * blockBasePos = kb->CreateAnd(processedItemCount[i], blockBaseMask);
    959960        // The number of items to copy is determined by the processing rate requirements.
     
    975976        Value * copyItems1 = kb->CreateSelect(kb->CreateICmpULT(neededItems, availFromBase), neededItems, availFromBase);
    976977        Value * copyItems2 = kb->CreateSub(neededItems, copyItems1);
    977         Value * inputPtr = kb->getRawInputPointer(mStreamSetInputs[i].name, kb->getInt32(0), blockBasePos);
     978        Value * inputPtr = kb->CreatePointerCast(kb->getRawInputPointer(mStreamSetInputs[i].name, kb->getInt32(0), blockBasePos), bufPtrType);
    978979        mStreamSetInputBuffers[i]->createBlockAlignedCopy(kb.get(), tempBufPtr, inputPtr, copyItems1);
    979980        Value * nextBufPtr = kb->CreateGEP(tempBufPtr, kb->CreateUDiv(copyItems1, blockSize));
     
    984985        baseAddress = kb->CreatePtrToInt(baseAddress, intAddrTy);
    985986        Value * tempAddress = kb->CreateAdd(kb->CreatePtrToInt(tempBufPtr, intAddrTy), kb->CreateSub(itemAddress, baseAddress));
    986         tempArgs.push_back(kb->CreateIntToPtr(tempAddress, mStreamSetInputBuffers[i]->getPointerType()));
     987        tempArgs.push_back(kb->CreateIntToPtr(tempAddress, bufPtrType));
    987988    }
    988989
     
    990991    for (unsigned i = 0; i < mStreamSetOutputBuffers.size(); i++) {
    991992        Value * tempBufPtr = kb->CreateGEP(tempParameterArea, kb->getInt32(mStreamSetInputs.size() + i));
    992         tempBufPtr = kb->CreatePointerCast(tempBufPtr, mStreamSetOutputBuffers[i]->getPointerType());
     993        Type * bufPtrType = mStreamSetOutputBuffers[i]->getPointerType();
     994        tempBufPtr = kb->CreatePointerCast(tempBufPtr, bufPtrType);
    993995        producedItemCount[i] = kb->getProducedItemCount(mStreamSetOutputs[i].name);
    994996        blockBasePos.push_back(kb->CreateAnd(producedItemCount[i], blockBaseMask));
     
    9981000        Value * baseAddress = kb->CreatePtrToInt(outputPtr, intAddrTy);
    9991001        Value * tempAddress = kb->CreateAdd(kb->CreatePtrToInt(tempBufPtr, intAddrTy), kb->CreateSub(itemAddress, baseAddress));
    1000         tempArgs.push_back(kb->CreateIntToPtr(tempAddress, mStreamSetOutputBuffers[i]->getPointerType()));
     1002        tempArgs.push_back(kb->CreateIntToPtr(tempAddress, bufPtrType));
    10011003    }
    10021004
Note: See TracChangeset for help on using the changeset viewer.