Ignore:
Timestamp:
Feb 3, 2017, 1:25:53 PM (2 years ago)
Author:
nmedfort
Message:

Partial removal of BlockNo?

Location:
icGREP/icgrep-devel/icgrep/editd
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/editd/editd_cpu_kernel.cpp

    r5292 r5297  
    2323}
    2424
    25 void editdCPUKernel::generateDoBlockMethod(Value * blockNo) {
     25void editdCPUKernel::generateDoBlockMethod() {
    2626    auto savePoint = iBuilder->saveIP();
    2727
     
    4141    Value * pattCh = iBuilder->CreateLoad(pattPtr);
    4242    Value * pattIdx = iBuilder->CreateAnd(iBuilder->CreateLShr(pattCh, 1), ConstantInt::get(int8ty, 3));
    43     Value * pattStreamPtr = getStream("CCStream", blockNo, iBuilder->CreateZExt(pattIdx, int32ty));
     43    Value * pattStreamPtr = getInputStream("CCStream", iBuilder->CreateZExt(pattIdx, int32ty));
    4444    Value * pattStream = iBuilder->CreateLoad(pattStreamPtr);
    4545    pattPos = iBuilder->CreateAdd(pattPos, ConstantInt::get(int32ty, 1));
     
    5454        pattCh = iBuilder->CreateLoad(pattPtr);
    5555        pattIdx = iBuilder->CreateAnd(iBuilder->CreateLShr(pattCh, 1), ConstantInt::get(int8ty, 3));
    56         pattStreamPtr = getStream("CCStream", blockNo, iBuilder->CreateZExt(pattIdx, int32ty));
     56        pattStreamPtr = getInputStream("CCStream", iBuilder->CreateZExt(pattIdx, int32ty));
    5757        pattStream = iBuilder->CreateLoad(pattStreamPtr);
    5858
     
    7272    }
    7373   
    74     Value * ptr = getStream("ResultStream", blockNo, iBuilder->getInt32(0));
     74    Value * ptr = getOutputStream("ResultStream", iBuilder->getInt32(0));
    7575    iBuilder->CreateStore(e[mPatternLen - 1][0], ptr);
    7676    for(unsigned j = 1; j<= mEditDistance; j++){
    77         ptr = getStream("ResultStream", blockNo, iBuilder->getInt32(j));
     77        ptr = getOutputStream("ResultStream", iBuilder->getInt32(j));
    7878        iBuilder->CreateStore(iBuilder->CreateAnd(e[mPatternLen-1][j], iBuilder->CreateNot(e[mPatternLen-1][j-1])), ptr);
    7979    }
     
    8383}
    8484
    85 void editdCPUKernel::generateFinalBlockMethod(Value * remainingBytes, Value * blockNo) {
     85void editdCPUKernel::generateFinalBlockMethod(Value * remainingBytes) {
    8686    setScalarField("EOFmask", iBuilder->bitblock_mask_from(remainingBytes));
    8787    CreateDoBlockMethodCall();
  • icGREP/icgrep-devel/icgrep/editd/editd_cpu_kernel.h

    r5292 r5297  
    2121   
    2222private:
    23     void generateDoBlockMethod(llvm::Value * blockNo) override;
    24     void generateFinalBlockMethod(llvm::Value * remainingBytes, llvm::Value * blockNo) override;
     23    void generateDoBlockMethod() override;
     24    void generateFinalBlockMethod(llvm::Value * remainingBytes) override;
    2525    void bitblock_advance_ci_co(llvm::Value * val, unsigned shift, llvm::Value * stideCarryArr, unsigned carryIdx, std::vector<std::vector<llvm::Value *>> & adv, std::vector<std::vector<int>> & calculated, int i, int j) const;
    2626    unsigned mEditDistance;
  • icGREP/icgrep-devel/icgrep/editd/editd_gpu_kernel.cpp

    r5292 r5297  
    2222}
    2323
    24 void editdGPUKernel::generateDoBlockMethod(Value * blockNo) {
     24void editdGPUKernel::generateDoBlockMethod() {
    2525
    2626    IntegerType * const int32ty = iBuilder->getInt32Ty();
     
    4444    Value * pattCh = iBuilder->CreateLoad(pattPtr);
    4545    Value * pattIdx = iBuilder->CreateAnd(iBuilder->CreateLShr(pattCh, 1), ConstantInt::get(int8ty, 3));
    46     Value * pattStreamPtr = getStream("CCStream", blockNo, iBuilder->CreateZExt(pattIdx, int32ty));
     46    Value * pattStreamPtr = getInputStream("CCStream", iBuilder->CreateZExt(pattIdx, int32ty));
    4747    Value * pattStream = iBuilder->CreateLoad(pattStreamPtr);
    4848    pattPos = iBuilder->CreateAdd(pattPos, ConstantInt::get(int32ty, 1));
     
    5656        pattCh = iBuilder->CreateLoad(pattPtr);
    5757        pattIdx = iBuilder->CreateAnd(iBuilder->CreateLShr(pattCh, 1), ConstantInt::get(int8ty, 3));
    58         pattStreamPtr = getStream("CCStream", blockNo, iBuilder->CreateZExt(pattIdx, int32ty));
     58        pattStreamPtr = getInputStream("CCStream", iBuilder->CreateZExt(pattIdx, int32ty));
    5959        pattStream = iBuilder->CreateLoad(pattStreamPtr);
    6060        bitblock_advance_ci_co(iBuilder, e[i-1][0], 1, stideCarryArr, carryIdx++, adv, calculated, i-1, 0);
     
    7171        pattPos = iBuilder->CreateAdd(pattPos, ConstantInt::get(int32ty, 1));
    7272    }
    73     Value * ptr = getStream("ResultStream", blockNo, iBuilder->getInt32(0));
     73    Value * ptr = getOutputStream("ResultStream", iBuilder->getInt32(0));
    7474    iBuilder->CreateStore(e[mPatternLen-1][0], ptr);
    7575    for(unsigned j = 1; j<= mEditDistance; j++){
    76         ptr = getStream("ResultStream", blockNo, iBuilder->getInt32(j));
     76        ptr = getOutputStream("ResultStream", iBuilder->getInt32(j));
    7777        iBuilder->CreateStore(iBuilder->CreateAnd(e[mPatternLen - 1][j], iBuilder->CreateNot(e[mPatternLen - 1][j - 1])), ptr);
    7878    }
    7979}
    8080
    81 void editdGPUKernel::generateFinalBlockMethod(Value * remainingBytes, Value * blockNo) {
     81void editdGPUKernel::generateFinalBlockMethod(Value * remainingBytes) {
    8282    setScalarField("EOFmask", iBuilder->bitblock_mask_from(remainingBytes));
    8383    CreateDoBlockMethodCall();
  • icGREP/icgrep-devel/icgrep/editd/editd_gpu_kernel.h

    r5292 r5297  
    2121   
    2222private:
    23     void generateDoBlockMethod(llvm::Value * blockNo) override;
    24     void generateFinalBlockMethod(llvm::Value * remainingBytes, llvm::Value * blockNo) override;
     23    void generateDoBlockMethod() override;
     24    void generateFinalBlockMethod(llvm::Value * remainingBytes) override;
    2525    unsigned mEditDistance;
    2626    unsigned mPatternLen;
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.cpp

    r5292 r5297  
    1818}
    1919
    20 void editdScanKernel::generateDoBlockMethod(Value * blockNo) {
     20void editdScanKernel::generateDoBlockMethod() {
    2121    auto savePoint = iBuilder->saveIP();
    2222    Function * scanWordFunction = generateScanWordRoutine(iBuilder->getModule());
     
    2626    Type * T = iBuilder->getIntNTy(mScanwordBitWidth);
    2727    VectorType * scanwordVectorType =  VectorType::get(T, fieldCount);
     28    Value * blockNo = getBlockNo();
    2829    Value * scanwordPos = iBuilder->CreateMul(blockNo, ConstantInt::get(blockNo->getType(), iBuilder->getBitBlockWidth()));
    2930   
    3031    std::vector<Value * > matchWordVectors;
    3132    for(unsigned d = 0; d <= mEditDistance; d++) {
    32         Value * ptr = getStream("matchResults", blockNo, iBuilder->getInt32(d));
     33        Value * ptr = getInputStream("matchResults", iBuilder->getInt32(d));
    3334        Value * matches = iBuilder->CreateBlockAlignedLoad(ptr);
    3435        matchWordVectors.push_back(iBuilder->CreateBitCast(matches, scanwordVectorType));
     
    4142        }
    4243        scanwordPos = iBuilder->CreateAdd(scanwordPos, ConstantInt::get(T, mScanwordBitWidth));
    43 
    4444    }
    4545}
  • icGREP/icgrep-devel/icgrep/editd/editdscan_kernel.h

    r5292 r5297  
    1818       
    1919private:
    20     void generateDoBlockMethod(llvm::Value * blockNo) override;
     20    void generateDoBlockMethod() override;
    2121    llvm::Function * generateScanWordRoutine(llvm::Module * m) const;
    2222       
Note: See TracChangeset for help on using the changeset viewer.