The following compiles:
struct Foo()
{
__inline__ void Bar() {}
};
__global__ void Test( Foo * p )
{
p->Bar();
}
When I try and get fancy:
template< typename Type >
struct Foo2()
{
__inline__ void Bar() {}
};
__global__ void Test2( Foo2<int> * p )
{
p->Bar(); // generates an error
}
I get the following error:
Error: Calls are not supported (found non-inlined call to XXXX)
Is this a compiler bug or is this unsupported functionailty?
Thanks,
George
BTW - I’m still vague on what is supported by nvcc.
Okay, I refactored a bit to get it to compile.
template< typename Type >
struct Foo
{
Type data;
};
template< typename Type >
__global__ void Bar( Foo<Type> * f )
{
}
I guess thats more “C-ish”-anyway. I would still like to know if class templates are/will be supported.
Thanks,
George
try
__inline__ __device__ void Bar() {}
Awesome! That works. You just saved me a bunch of rework.
Thanks,
George
What’s the syntax for calling that templated global function?