mercredi 11 mars 2015

no instance of function template matches the argument list (trying to print array)


When trying to compile this



template<typename type,const char* format>__device__ void d_prettyPrintVector(type* v, const unsigned int size)
{
printf("\n ");
for(int i=0; i<size; i++)
printf(format, v[i]);
}
template<> void d_prettyPrintVector<float, "%4.1f ">(float*, const unsigned int);
template<> void d_prettyPrintVector<int, "%2d " >(int*, const unsigned int);
template<> void d_prettyPrintVector<char, "%2d " >(char*, const unsigned int);
template<> void d_prettyPrintVector<bool, "%d" >(bool*, const unsigned int);


and use it like this



d_prettyPrintVector(dc, blockDim.x);


I am getting



kernels.cu(104): error: no instance of function template "d_prettyPrintVector" matches the argument list
argument types are: (int *, const unsigned int)


what is wrong?




Aucun commentaire:

Enregistrer un commentaire