I am trying to build an application that makes use of a Cuda kernel. For that, I am using the meson build system but without success. Basically what I am trying to do is the following:
//main.cpp
extern void kernel_function();
int main(int argc, char *argv[]){
// some logic here...
kernel_function();
return 0;
}
//kernel.cu
__global__ void kernel(){
// some code here...
}
void kernel_function(){
dim3 threads( 2, 1 );
dim3 blocks( 1, 1 );
kernel<<< blocks, threads >>>();
}
I can compile the above code with the following commands:
g++ -c main.cpp
nvcc -c kernel.cu
nvcc -o main main.o kernel.o
How can I replicate this compilation process that I do on the terminal with Meson?