Error with Generic Kernel

Jul 30, 2014 at 3:56 PM
Hi,

I want to implement a generic kernel with the following signature to perform transpose with any simple data type such as int, short, float, double.

[Cudafy]
static void Transpose<T>(GThread thread, T[] odata, T[] idata) where T : struct
{
}

The kernel is invoked from another function as
_gpu.Launch(blocks, threads).Transpose<float>(odata,idata)

where odata and idata are float[]

I run cudafycl as post build event to include the cudafy module into the dll that is compiled and get the following error

EXEC : error : Cudafy.CudafyLanguageException: Type parameter declarations are not supported.

Is there a way around this or can a generic kernel be supported in future versions?

Thanks,

Marzban
Coordinator
Jul 30, 2014 at 7:49 PM
This is not supported and there are no plans to add such functionality.