Templated Functions on the Device

I am trying to use templated functions on the device declaring them like:

template device inline void add_array( T* array, unsigned int tid );

I am getting complier/linker errors as follows:
“pmf_math.h”, line 10: warning: extern inline function
"add_array(T , unsigned int) [with T=int]" was referenced but not
defined
template attribute((device)) inline void add_array( T
array, unsigned int tid );
^

“pmf_math.h”, line 10: warning: extern inline function “_Z9add_arrayIiEvPT_j”
was referenced but not defined
extern attribute((device))inline void _Z9add_arrayIiEvPT_j(int *, unsigned);
^

“pmf_kernel.cu”, line 36: Error: Calls are not supported (found non-inlined call to _Z9add_arrayIiEvPT_j)

Am I doing something else wrong or is there no way to use templated functions on the device with CUDA?

oops, I got this working by putting the templated functions into my header file. Guess it’s a C++ problem not a CUDA one (Templated functions need the entire function definition everywhere, not just the function declaration).