I have one openmp function and one GPU kernel.
I plan to put openmp function in the .c file, compiled with icc.
and GPU kernel in the .cu file, compiled with “NVCC -ccbin icc”.
And the main function can be put in the .c file or .cu file? Right?
If a CPU function calls cudaMalloc or cudaMemcpy, is it required for this function to be in .cu file or compiled with NVCC?
Thanks.
I put my main function in .c file and allocate some memory on the GPU and then pass their address to the wrapper function of the kernel in .cu file.
I don’t know whether this works or is a valid strategy to organize all the functions.