Hi,
I have been trying out to pass cuda kernel as arguement to another function, but I seem to getting errors. Here is my code
// Kernel Def
__global__ void tmp(int a,int b)
{
// Doing Something
}
// Call Func Def
void Func(void(*kernel),int Nob, int BlkSz,int a, int b,cudaStream_t stream)
{
(*kernel)<<Nob,BlkSz,stream>>(a,b);
}
// main
cudaStream_t stream;
Func(tmp,Nob,Blksz,a,b,stream);
But in this I’m getting some errors,
error: expression must be a pointer to a complete object type
error: argument of type “cudaStream_t” is incompatible with parameter of type “size_t”
So, if anybody has worked on something like this, please help.
Thanks
Ronak