Changeset 5457 for icGREP


Ignore:
Timestamp:
May 19, 2017, 12:03:57 PM (2 years ago)
Author:
cameron
Message:

Deprecating SingleBlockBuffer?

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

Legend:

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

    r5450 r5457  
    9797add_executable(u8u16 u8u16.cpp)
    9898add_executable(base64 base64.cpp kernels/radix64.cpp)
    99 add_executable(wc wc.cpp)
     99add_executable(wc wc.cpp kernels/idx_stream_kernel.cpp kernels/alignedprint.cpp kernels/stdout_kernel.cpp)
    100100add_executable(editd editd/editd.cpp editd/pattern_compiler.cpp editd/editdscan_kernel.cpp editd/editd_gpu_kernel.cpp editd/editd_cpu_kernel.cpp)
    101101add_executable(array-test array-test.cpp kernels/alignedprint.cpp)
  • icGREP/icgrep-devel/icgrep/array-test.cpp

    r5436 r5457  
    1010#include <kernels/alignedprint.h>
    1111#include <kernels/kernel_builder.h>
    12 #include <kernels/streamset.h>                     // for SingleBlockBuffer
     12#include <kernels/streamset.h>                     // for CircularBuffer
    1313#include <llvm/ExecutionEngine/ExecutionEngine.h>  // for ExecutionEngine
    1414#include <llvm/IR/Function.h>                      // for Function, Function...
     
    172172    auto matches = pxDriver.addBuffer(make_unique<ExpandableBuffer>(iBuilder, iBuilder->getStreamSetTy(count), segmentSize * bufferSegments));
    173173
    174     auto errors = pxDriver.addBuffer(make_unique<SingleBlockBuffer>(iBuilder, iBuilder->getStreamTy()));
     174    auto errors = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamTy(), segmentSize * bufferSegments));
    175175
    176176    pxDriver.makeKernelCall(bm, {BasisBits}, {matches, errors});
  • icGREP/icgrep-devel/icgrep/editd/editd.cpp

    r5446 r5457  
    223223    pxDriver.makeKernelCall(mmapK, {}, {ChStream});
    224224
    225     auto MatchResults = pxDriver.addBuffer(make_unique<SingleBlockBuffer>(idb, idb->getStreamSetTy(editDistance + 1)));
     225    auto MatchResults = pxDriver.addBuffer(make_unique<CircularBuffer>(idb, idb->getStreamSetTy(editDistance + 1), 1));
    226226
    227227    auto editdk = pxDriver.addKernelInstance(make_unique<PatternKernel>(idb, patterns));
     
    293293    pxDriver.makeKernelCall(mmapK, {}, {ByteStream});
    294294
    295     auto BasisBits = pxDriver.addBuffer(make_unique<SingleBlockBuffer>(iBuilder, iBuilder->getStreamSetTy(8)));
     295    auto BasisBits = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(8), 1));
    296296    auto s2pk = pxDriver.addKernelInstance(make_unique<S2PKernel>(iBuilder));
    297297
  • icGREP/icgrep-devel/icgrep/kernels/streamset.cpp

    r5454 r5457  
    167167
    168168
    169 // Single Block Buffer
    170 
    171 // For a single block buffer, the block pointer is always the buffer base pointer.
    172 Value * SingleBlockBuffer::getStreamSetBlockPtr(IDISA::IDISA_Builder * const, Value * self, Value *) const {
    173     return self;
    174 }
    175 
    176169// Source File Buffer
    177170Value * SourceBuffer::getBufferedSize(IDISA::IDISA_Builder * const iBuilder, Value * self) const {
     
    472465}
    473466
    474 // Constructors
    475 SingleBlockBuffer::SingleBlockBuffer(const std::unique_ptr<kernel::KernelBuilder> &  b, Type * type)
    476 : StreamSetBuffer(BufferKind::BlockBuffer, type, resolveStreamSetType(b, type), 1, 0) {
    477     mUniqueID = "S";
    478 }
    479 
    480467SourceBuffer::SourceBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, Type * type, unsigned MemoryAddressSpace, unsigned StructAddressSpace)
    481468: StreamSetBuffer(BufferKind::SourceBuffer, type, StructType::get(resolveStreamSetType(b, type)->getPointerTo(MemoryAddressSpace), b->getSizeTy(), nullptr), 0, StructAddressSpace) {
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5452 r5457  
    2121
    2222    enum class BufferKind : unsigned {
    23         BlockBuffer
    24         , SourceBuffer
     23        SourceBuffer
    2524        , ExternalBuffer
    2625        , CircularBuffer
     
    132131};   
    133132
    134 class SingleBlockBuffer final : public StreamSetBuffer {
    135 public:
    136     static inline bool classof(const StreamSetBuffer * b) {
    137         return b->getBufferKind() == BufferKind::BlockBuffer;
    138     }   
    139 
    140     SingleBlockBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Type * type);
    141 
    142 protected:
    143 
    144     llvm::Value * getStreamSetBlockPtr(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * blockNo) const override;
    145 };
    146 
    147133class SourceBuffer final : public StreamSetBuffer {
    148134public:
  • icGREP/icgrep-devel/icgrep/wc.cpp

    r5440 r5457  
    142142    auto & iBuilder = pxDriver.getBuilder();
    143143    Module * m = iBuilder->getModule();
    144    
     144    const unsigned segmentSize = codegen::SegmentSize;
     145    const unsigned bufferSegments = codegen::ThreadNum+1;
     146
     147   
    145148    Type * const int32Ty = iBuilder->getInt32Ty();
    146149    Type * const sizeTy = iBuilder->getSizeTy();
     
    163166    StreamSetBuffer * const ByteStream = pxDriver.addBuffer(make_unique<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8)));
    164167
    165     StreamSetBuffer * const BasisBits = pxDriver.addBuffer(make_unique<SingleBlockBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1)));
     168    StreamSetBuffer * const BasisBits = pxDriver.addBuffer(make_unique<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), segmentSize * bufferSegments));
    166169
    167170    Kernel * mmapK = pxDriver.addKernelInstance(make_unique<MMapSourceKernel>(iBuilder));
Note: See TracChangeset for help on using the changeset viewer.