using other c++ compiler to compile the CUDA code -


i have cuda (*.cu) code compiled nvcc, working pretty in gpu. nvcc doesn't support c++11 features , 3rd party c++ library cannot used nvcc. wonder if possible compile .cu code gcc or other commercial c++ compiler? thanks.

nvcc supports explicitly specifying host compiler uses, togather host-compiler-specific options. find doc on nvcc options -ccbin , -xcompiler details.

http://docs.nvidia.com/cuda/cuda-compiler-driver-nvcc/index.html#nvcc-command-options

for example, bind nvcc intel compiler , intel mkl follows.

$ nvcc -ftz true -ccbin icpc -xcompiler "-wall -wno-long-long -ansi -pedantic -ansi-alias -parallel -fopenmp -openmp-link=static -static-intel -wd10237" -o2 -xcompiler "-o2"   -gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -ilib -c -o test/triangle.o test/triangle.cu $ nvcc -ftz true -ccbin icpc -xcompiler "-wall -wno-long-long -ansi -pedantic -ansi-alias -parallel -fopenmp -openmp-link=static -static-intel -wd10237" -o2 -xcompiler "-o2"  -ilib -llib test/triangle.o lib/ktiming.o -lpthread -lm /opt/intel/composer_xe_2013.1.117/mkl/lib/intel64/libmkl_intel_lp64.a /opt/intel/composer_xe_2013.1.117/mkl/lib/intel64/libmkl_intel_thread.a /opt/intel/composer_xe_2013.1.117/mkl/lib/intel64/libmkl_core.a /opt/intel/composer_xe_2013.1.117/mkl/lib/intel64/libmkl_core.a -lcublas -lcurand -lcusparse -o test/triangle 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -