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

Add NVPTX driver.

Location:
icGREP/icgrep-devel/icgrep/IR_Gen
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IR_Gen/CudaDriver.h

    r5425 r5458  
    5656
    5757  // Get kernel function
    58   checkCudaErrors(cuModuleGetFunction(&function, cudaModule, "GPU_Main"));
     58  checkCudaErrors(cuModuleGetFunction(&function, cudaModule, "Main"));
    5959
    6060  // Device data
     
    101101   
    102102  checkCudaErrors(cuMemAlloc(&devBufferInput, startPoints[numOfGroups]));
    103   // checkCudaErrors(cuMemsetD8(devBufferInput,0,startPoints[numOfGroups]));
     103  checkCudaErrors(cuMemsetD8(devBufferInput,0,startPoints[numOfGroups]));
    104104  checkCudaErrors(cuMemAlloc(&devStartPoints, sizeof(ulong) * (numOfGroups + 1)));
    105105  checkCudaErrors(cuMemAlloc(&devBufferSizes, sizeof(ulong) * numOfGroups));
     
    131131  void *KernelParams[] = { &devBufferInput, &devStartPoints, &devBufferSizes, &devBufferOutput};
    132132
    133   // std::cout << "Launching kernel\n";
     133  // std::cerr << "Launching kernel\n";
    134134
    135135  CUevent start;
     
    144144                                 blockSizeX, blockSizeY, blockSizeZ,
    145145                                 0, NULL, KernelParams, NULL));
    146   // std::cout << "kernel success.\n";
     146  // std::cerr << "kernel success.\n";
    147147
    148148  cuEventCreate(&stop, CU_EVENT_BLOCKING_SYNC);
     
    151151
    152152  cuEventElapsedTime(&elapsedTime, start, stop);
    153   printf("GPU Kernel time : %f ms\n" ,elapsedTime);
     153  // printf("GPU Kernel time : %f ms\n" ,elapsedTime);
    154154
    155155  // Retrieve device data
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_builder.h

    r5446 r5458  
    107107    virtual llvm::Value * bitblock_mask_from(llvm::Value * pos);
    108108    virtual llvm::Value * bitblock_set_bit(llvm::Value * pos);
     109
     110    virtual void CreateBaseFunctions(){};
    109111   
    110112    llvm::Value * simd_and(llvm::Value * a, llvm::Value * b);
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_nvptx_builder.h

    r5436 r5458  
    1616public:
    1717   
    18     IDISA_NVPTX20_Builder(llvm::LLVMContext & C, unsigned registerWidth, unsigned vectorWidth, unsigned groupSize)
    19     : IDISA_Builder(C, registerWidth, registerWidth, (vectorWidth * groupSize))
    20     , IDISA_I64_Builder(C, registerWidth, registerWidth, (vectorWidth * groupSize))
    21     , groupThreads(groupSize) {
     18    IDISA_NVPTX20_Builder(llvm::LLVMContext & C, unsigned registerWidth, unsigned vectorWidth, unsigned stride)
     19    : IDISA_Builder(C, registerWidth, registerWidth, stride)
     20    , IDISA_I64_Builder(C, registerWidth, registerWidth, stride)
     21    , groupThreads(stride/vectorWidth) {
     22
     23    }
     24
     25    ~IDISA_NVPTX20_Builder() {}
     26    virtual std::string getBuilderUniqueName() override;
     27    int getGroupThreads();
     28
     29    void CreateBaseFunctions() override {
    2230        CreateGlobals();
    2331        CreateBuiltinFunctions();
     
    2533        CreateLongAddFunc();
    2634        CreateBallotFunc();
    27     }
    28    
    29     ~IDISA_NVPTX20_Builder() {}
    30     virtual std::string getBuilderUniqueName() override;
    31     int getGroupThreads();
     35    };
    3236   
    3337    Value * bitblock_any(Value * a) override;
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_target.cpp

    r5446 r5458  
    4444
    4545KernelBuilder * GetIDISA_GPU_Builder(llvm::LLVMContext & C) {
    46     return new KernelBuilderImpl<IDISA_NVPTX20_Builder>(C, 64, 64, 64);
     46    return new KernelBuilderImpl<IDISA_NVPTX20_Builder>(C, 64, 64, 64*64);
    4747}
    4848
  • icGREP/icgrep-devel/icgrep/IR_Gen/llvm2ptx.h

    r5176 r5458  
    1 #include <string>
    2 #include <iostream>
    3 #include <fstream>
    4 #include <sys/stat.h>
    5 #include <fcntl.h>
    6 #include <unistd.h>
    7 #include <cassert>
     1#ifndef LLVM2PTX_H
     2#define LLVM2PTX_H
    83
    9 #include "llvm/ADT/Triple.h"
    104#include "llvm/Analysis/TargetLibraryInfo.h"
    115#include "llvm/CodeGen/CommandFlags.h"
    12 #include "llvm/CodeGen/LinkAllCodegenComponents.h"
    136#include "llvm/CodeGen/MIRParser/MIRParser.h"
    14 #include "llvm/IR/DataLayout.h"
    15 #include "llvm/IR/LLVMContext.h"
    167#include "llvm/IR/LegacyPassManager.h"
    178#include "llvm/IR/Module.h"
    189#include "llvm/IR/Verifier.h"
    1910#include "llvm/IRReader/IRReader.h"
    20 #include "llvm/Pass.h"
    2111#include "llvm/Support/CommandLine.h"
    2212#include "llvm/Support/FileSystem.h"
    23 #include "llvm/Support/FormattedStream.h"
    2413#include "llvm/Support/SourceMgr.h"
    2514#include "llvm/Support/TargetRegistry.h"
     
    2716#include "llvm/Support/ToolOutputFile.h"
    2817#include "llvm/Target/TargetMachine.h"
    29 #include "llvm/Target/TargetSubtargetInfo.h"
    3018#include <memory>
    3119using namespace llvm;
     
    155143  return 0;
    156144}
     145
     146#endif
Note: See TracChangeset for help on using the changeset viewer.