Using CMake with Matlab GPU Coder generated CUDA code

Hey, I created simple function to return cos of an array in matlab. I generated this function in GPU Coder an got cuda code. I have also succesfully generated and executed executable with that function generated in GPU coder on Jetson nano. But when I try to generate same functions with same main file with cmake, executable is succesfully generated, but it returns array of zeros. However both GPU coder and CMake executables work, when the matlab functions input is 1x1, instead of and array (1x100 in my case).

Hi kubaixixel,
Thank you for your report! Is this problem related to CUDA GDB (since it’s reported in the CUDA GDB forum branch)? The post never mentioned CUDA GDB.

If it’s not CUDA GDB related, please consider different forum branch, e.g.: Jetson & Embedded Systems - NVIDIA Developer Forums

If it’s related to CUDA GDB, please provide more details.

Yeah sorry, I must have somehow misplaced it to CUDA GDB.

Got it! Someone from community managers can move it to the more appropriate branch.

Sounds like this should go in the Jetson Nano forum. I will move it there.

Duplicated with Using CMake with Matlab GPU Coder generated CUDA code