Pardon me if this is non-trivial.
I have a small class, wrapping around cusp::csr_matrix<int,float,cusp::device_memory>
like so:
class CuspMatrix
: public cusp::csr_matrix<int,float,cusp::device_memory>
{
...
}
So far I'm not doing anything I would imagine would need to be compiled for the device.
However I do plan on writing code in this particular class, as a member/function, that should be executed on the device, yet if I am understanding correctly, cusp
already provides this functionality for me?
E.g:
ValueType v_nrm2 = cusp::blas::nrm2(V);
cusp::transpose(M,M_t);
calculating a norm, or transposing, should ideally be compiled for device execution. What do I do in this case, if that is part of a class method?
Do I make the entire *.hpp
header file of the class, a *.cu
and add it for nvcc
compilation? Do I mark only the actual code (and not the header declaration) in a *.cu
and add it for nvcc
compilation?
Or is none of this necessary?