Ignore:
Timestamp:
Jun 16, 2017, 3:44:08 PM (2 years ago)
Author:
lindanl
Message:

editd GPU: bug fixed.

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/editd/EditdCudaDriver.h

    r5511 r5514  
    133133
    134134  // Retrieve device data
    135   ulong * matchRslt = (ulong *) malloc(outputSize/GROUPBLOCKS);
     135  ulong * matchRslt;
     136  if (posix_memalign((void**)&matchRslt, 32, outputSize/GROUPBLOCKS)) {
     137    std::cerr << "Cannot allocate memory for output.\n";
     138    exit(-1);
     139  }
     140 
    136141  checkCudaErrors(cuMemcpyDtoH(matchRslt, devBufferOutput, outputSize/GROUPBLOCKS));
    137142
  • icGREP/icgrep-devel/icgrep/editd/editd.cpp

    r5511 r5514  
    2727#include <fcntl.h>
    2828#include <mutex>
     29
     30#include <toolchain/NVPTXDriver.h>
     31#include <editd/editd_gpu_kernel.h>
    2932#ifdef CUDA_ENABLED
    30 #include <toolchain/NVPTXDriver.h>
    3133#include <editd/EditdCudaDriver.h>
    32 #include <editd/editd_gpu_kernel.h>
    3334#endif
    3435
     
    376377}
    377378
    378 #ifdef CUDA_ENABLED
    379 
    380379#define GROUPTHREADS 64
    381380#define GROUPBLOCKS 64
     
    511510}
    512511
    513 editdFunctionType editdScanCPUCodeGen() {
    514 
    515     ParabixDriver pxDriver("scan");
     512editdFunctionType editdScanCPUCodeGen(ParabixDriver & pxDriver) {
     513   
    516514    auto & iBuilder = pxDriver.getBuilder();
    517515    Module * M = iBuilder->getModule();
     
    552550}
    553551
    554 #endif
    555 
    556552int main(int argc, char *argv[]) {
    557553    codegen::ParseCommandLineOptions(argc, argv);
     
    581577
    582578        editdGPUCodeGen(patterns.length()/GROUPTHREADS - 1);
    583 
    584579        mergeGPUCodeGen();
    585 
    586580        ulong * rslt = RunPTX(PTXFilename, chStream, size, patterns.c_str(), patterns.length(), editDistance);
    587581
    588         editdFunctionType editd_ptr = editdScanCPUCodeGen();
    589 
     582        ParabixDriver scanDriver("scan");
     583        editdFunctionType editd_ptr = editdScanCPUCodeGen(scanDriver);
    590584        editd(editd_ptr, (char*)rslt, size);
    591585
Note: See TracChangeset for help on using the changeset viewer.