Pregunta

I am looking for help getting started with a project involving CUDA. My goal is to have a project that I can compile in the native g++ compiler but uses CUDA code. I understand that I have to compile my CUDA code in nvcc compiler, but from my understanding I can somehow compile the CUDA code into a cubin file or a ptx file.

Here are my questions:

  1. How do I use nvcc to compile into a cubin file or a ptx file? Don't I need a -c or something?
  2. Which file type do I want to use?
  3. What are the g++ commands to correctly compile and link the project together?

Assume the following:

  1. I have a file called "main.cpp" that has a main function in it and includes cuda.h.
  2. I have another file called "cudaFunc.cu" that has CUDA code in it. Let's say, for instance, that I want to add two integer arrays that exist in main.cpp.

No hay solución correcta

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top