Is it possible to use the Cuda-defined data structures, such as float3, float4, dim3 etc. in a .cpp file?
How would you go about achieving this if it is possible?
Thanks
Yes you can. Just #include "vector_types.h" (make sure the CUDA include directory is in your -I path). I think this code sample demonstrates it (not that you really need an example for something this simple).
Also, some of the CUDA SDK code samples include a header called "vector_math.h", which defines a number of operators (+, *, dot, etc.) for the vector types. That would be in the SDK common/include directory, I believe (note that this is not a standard, supported part of CUDA -- it's an example of code you could write yourself).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With