Closed kk94wang closed 2 years ago
@kk94wang Apologies for the late response.
No, it's by no means a stupid question. Supposing your system has the Nvidia CUDA Compiler (NVCC), compiling a .cu
program is done through running nvcc filename.cu dependencies.cu dependencies.cpp
. Here, the dependencies refer to external files utilized by filename.cu
. For instance, assume you would like to compile test/linear.cu
; that program uses CPU/linear.cpp
, GPU/linear.cu
, and utils/utils.cpp
, thus you would command nvcc test/linear.cu CPU/linear.cpp GPU/linear.cu utils/utils.cpp
. This creates a.out
, which may be executed via ./a.out
.
Does that answer your question?
@kk94wang Apologies for the late response.
No, it's by no means a stupid question. Supposing your system has the Nvidia CUDA Compiler (NVCC), compiling a
.cu
program is done through runningnvcc filename.cu dependencies.cu dependencies.cpp
. Here, the dependencies refer to external files utilized byfilename.cu
. For instance, assume you would like to compiletest/linear.cu
; that program usesCPU/linear.cpp
,GPU/linear.cu
, andutils/utils.cpp
, thus you would commandnvcc test/linear.cu CPU/linear.cpp GPU/linear.cu utils/utils.cpp
. This createsa.out
, which may be executed via./a.out
.Does that answer your question?
Yes, that helps! Thank you very much!
This might be a stupid question, but how to compile and run the code? Thank you!