Ignore:
Timestamp:
Apr 24, 2018, 2:57:34 PM (12 months ago)
Author:
nmedfort
Message:

Restructured MultiBlock? kernel. Removal of Swizzled buffers. Inclusion of PopCount? rates / non-linear access. Modifications to several kernels to better align them with the kernel and pipeline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/base64.cpp

    r5856 r5985  
    2121#include <boost/interprocess/mapped_region.hpp>
    2222#include <boost/interprocess/anonymous_shared_memory.hpp>
     23#include <boost/math/common_factor_rt.hpp>
    2324#include <sys/stat.h>
    2425#include <fcntl.h>
     
    6263
    6364    //Round up to a multiple of 3.
    64     const auto bufferSize = ((codegen::SegmentSize * codegen::BufferSegments * codegen::ThreadNum + 2) / 3) * 3;
     65    const auto bufferSize = (codegen::SegmentSize * codegen::BufferSegments);
     66    const auto expandedSize = boost::lcm(boost::lcm(bufferSize, 3U), 4U);
    6567
    6668    StreamSetBuffer * ByteStream = pxDriver.addBuffer<SourceBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8));
     
    6971    pxDriver.makeKernelCall(mmapK, {}, {ByteStream});
    7072   
    71     const auto outputBufferSize = ((bufferSize + 2) / 3) * 4;
    72 
    73     StreamSetBuffer * Expanded3_4Out = pxDriver.addBuffer<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), outputBufferSize);
     73    StreamSetBuffer * Expanded3_4Out = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), expandedSize);
    7474    Kernel * expandK = pxDriver.addKernelInstance<expand3_4Kernel>(iBuilder);
    7575    pxDriver.makeKernelCall(expandK, {ByteStream}, {Expanded3_4Out});
    7676   
    77     StreamSetBuffer * Radix64out = pxDriver.addBuffer<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), outputBufferSize);
     77    StreamSetBuffer * Radix64out = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), bufferSize);
    7878    Kernel * radix64K = pxDriver.addKernelInstance<radix64Kernel>(iBuilder);
    7979    pxDriver.makeKernelCall(radix64K, {Expanded3_4Out}, {Radix64out});
     
    8484        pxDriver.makeKernelCall(base64K, {Radix64out}, {Base64out});
    8585    } else {
    86         StreamSetBuffer * Base64out = pxDriver.addBuffer<DynamicBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), outputBufferSize);
     86        StreamSetBuffer * Base64out = pxDriver.addBuffer<CircularBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), bufferSize);
    8787        Kernel * base64K = pxDriver.addKernelInstance<base64Kernel>(iBuilder);
    8888        pxDriver.makeKernelCall(base64K, {Radix64out}, {Base64out});       
Note: See TracChangeset for help on using the changeset viewer.