Closed lxwithgod closed 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'
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]);
}