CUDA: static global member functions (kernels)
When compiling the code below using nvcc (CUDA 5.0), the error "illegal
combination of memory qualifiers" appears, as it apparently is impossible
to have global kernels in a class.
class A
{
public:
__global__ static void kernel();
};
__global__ void A::kernel()
{}
I can understand this restriction when dealing with non-static members,
but why does the error still occur when the kernel is declared static? The
calling of such members would be no different from calling the function
when it is declared in a namespace (A in this case).
A::kernel <<< 1, 1 >>> ();
Is there a reason I'm missing as to why this hasn't been implemented (yet)?
No comments:
Post a Comment