GCC will not compile the following code snippet (which is actually the correct behavior of GCC, since it conforms to standard C ++, as I already learned. VC ++, however, will compile.)
template<class T> void CUDAMemory1D2DTextureAllocator<T>::allocateMemoryOnDevice() { m_pChannelDesc = cudaCreateChannelDesc<T>(); ... }
As I already found out in the search, I need to tell the compiler that cudaCreateChannelDesc is a template method. Otherwise, it will try to parse < as smaller than the operator ...
The following snippet shows that in a simple example:
template< typename G > struct Test { template< typename T > T f() const; }; template< typename G, typename T > void g() { Test< G > t; tf< T >();
So far so good. Now my question is: how to do this in the case above, where is the method I call cudaCreateChannelDesc that does not belong to any class or namespace? Any advice or suggestions on how to solve this situation are very welcome.
thanks
source share