Ignore:
Timestamp:
May 19, 2017, 12:58:48 PM (2 years ago)
Author:
lindanl
Message:

Add NVPTX driver.

Location:
icGREP/icgrep-devel/icgrep/toolchain
Files:
2 added
2 edited

Legend:

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

    r5454 r5458  
    2929#include <sys/stat.h>
    3030#include <llvm/IR/Verifier.h>
     31#include <toolchain/NVPTXDriver.cpp>
    3132//#include <toolchain/workqueue.h>
    3233
     
    9899static cl::opt<bool> segmentPipelineParallel("enable-segment-pipeline-parallel", cl::desc("Enable multithreading with segment pipeline parallelism."), cl::cat(CodeGenOptions));
    99100
     101bool NVPTX;
     102int GroupNum;
     103static cl::opt<bool> USENVPTX("NVPTX", cl::desc("Run on GPU only."), cl::init(false));
     104static cl::opt<int, true> GroupNumOption("group-num", cl::location(GroupNum), cl::desc("NUmber of groups declared on GPU"), cl::value_desc("positive integer"), cl::init(256));
     105
     106}
     107
     108void setNVPTXOption(){
     109    codegen::NVPTX = codegen::USENVPTX;
     110    if(codegen::NVPTX){
     111#ifndef CUDA_ENABLED
     112    std::cerr << "CUDA compiler is not supported.\n";
     113    exit(-1);
     114#endif
     115    }
    100116}
    101117
  • icGREP/icgrep-devel/icgrep/toolchain/toolchain.h

    r5454 r5458  
    1212#include <kernels/streamset.h>
    1313
     14#include <toolchain/NVPTXDriver.h>
    1415namespace llvm { class ExecutionEngine; }
    1516namespace llvm { class Function; }
     
    4849extern bool EnableAsserts;
    4950extern bool EnableCycleCounter;
    50 #ifdef CUDA_ENABLED
    5151extern bool NVPTX;
    5252extern int GroupNum;
    53 #endif
    5453}
    5554
    56 #ifdef CUDA_ENABLED
     55
    5756void setNVPTXOption();
    58 void Compile2PTX (llvm::Module * m, std::string IRFilename, std::string PTXFilename);
    59 #endif
    6057
    6158void AddParabixVersionPrinter();
Note: See TracChangeset for help on using the changeset viewer.