I have a very basic problem: I want to copy a simple element from the host to the device.
On the web, I can find examples showing how to do so for an array, but no for a simple value…
I defined a constant variable:
constant float3 c_lightPos;
and during a function executed on the host I try to give it a value:
float3 t = make_float3(2,2,2);
cudaError_t r = cudaMemcpy( &c_lightPos, &t, sizeof(float3), cudaMemcpyHostToDevice );
but r == cudaErrorInvalidValue
Where does come from this “invalid value”?
What am I doing wrong?
ahhhh :D Thanks
I saw it, but the char* parameter disturbed me.
How course, you can’t access to a pointer in the device memory, so a mecanism uses the variable name (smart cuda!)