hfinkel / llvm-project-cxxjit

Clang with JIT extensions
https://github.com/hfinkel/llvm-project-cxxjit/wiki
229 stars 23 forks source link

'/tmp/testCudaJit-cdc6cf.fatbin': No such file or directory #10

Closed lxwithgod closed 4 years ago

lxwithgod commented 5 years ago

hi,I use this relase https://github.com/hfinkel/llvm-project-cxxjit/releases/tag/cxxjit-20190311; cmake: cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DLLVM_USE_SPLIT_DWARF=ON -DCMAKE_INSTALL_PREFIX=/home/xiao.luo/bin/clangJit -DLLVM_ENABLE_PROJECTS="llvm;clang;openmp;libcxx;libcxxabi;lld;complier-rt;clang-tools-extra" ../llvm

clang++ -O0 -std=c++11 -I/usr/local/cuda-10.0/include -L/usr/local/cuda-10.0/lib64 -fjit -lcudart --cuda-gpu-arch=sm_75 ./testCudaJit.cu -o a.out

./a.out 1024*1024

I gett this error: '/tmp/testCudaJit-cdc6cf.fatbin': No such file or directory

testCudaJit.cu:

include

include

include

include

// Includes CUDA

include

include

include

template [[clang::jit]]global void addOne(float* in,int num){

if(supportFor){ for(int tid=threadIdx.x+blockIdx.xblockDim.x;tid<num;tid+=blockDim.xgridDim.x){ in[tid]+=1.0f; } }else{ in[threadIdx.x+blockIdx.x*blockDim.x]+=1.0f; } } //////////////////////////////////////////////////////////////////////////////// // Program main //////////////////////////////////////////////////////////////////////////////// int main(int argc, char **argv) { int num = std::atoi(argv[1]);

float * in;
cudaMalloc((void**)&in,sizeof(float)*num);
int blockx=num>1024?1024:num;
int gridx=(num+blockx-1)/blockx>32?32:(num+blockx-1)/blockx;
bool supportFor=gridx*blockx<num;
addOne<supportFor><<<dim3(gridx,1,1),dim3(blockx,1,1)>>>(in,num);

}

hfinkel commented 4 years ago

I can't compile this example, but if this problem still exists with cxxjit-20191229, please reopen and put all of the code in a codeblock so that it will appear correctly.

error: no member named 'xblockDim' in '__cuda_builtin_blockIdx_t' error: no member named 'xgridDim' in '__cuda_builtin_blockDim_t'