Skip to content

Instantly share code, notes, and snippets.

@rkujawa
Created May 1, 2017 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rkujawa/400a1331fdf102b4b0538147e52bbaec to your computer and use it in GitHub Desktop.
Save rkujawa/400a1331fdf102b4b0538147e52bbaec to your computer and use it in GitHub Desktop.
Compiling GPU accelerated things on Fedora 26
# using plain CUDA (requires cuda-devel)
nvcc --compiler-options "-std=c++98" -I /usr/include/cuda/ -o executable source.cu
# using OpenACC with NVPTX (requires gcc-offload-nvptx and cuda-devel)
gcc source.c -fopenacc -foffload=nvptx-none -foffload="-O3" -O3 -o executable
# using OpenCL with CUDA backend (requires cuda-devel, opencl-headers, ocl-icd, ocl-icd-devel)
gcc -Wall -W -O3 -I /usr/include/cuda -o executable source.cpp -L/usr/lib64 -Wl,-R,/usr/lib64 -lOpenCL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment