Hi,
I read some of the posts here but none seem to clearly answer my (simple) questions.
-
To represent an image with 3 channels I can use either a 1d array of float3 allocated with cudaMalloc, or an 2d array of float3 allocated with cudaMalloc3D with a size of Width x Height x 1 or a 3d float array allocated with cudaMalloc3D of size Width x Height x 3. With the fact in mind that I want to access rows and columns: Is there one way which I should prefer?
-
The whole topic about cudaMalloc3D, cudaMalloc3DArray, … and copying memory is quite confusing to me, to put it mildly. Is there anywhere some good post, tutorial or howto which I have maybe missed about how to allocate and fill cuda arrays. The programming guide e.g. says nothing about cudaMalloc3D. My input is an 1d float array like {r1,g1,b1,r2,g2,b2,…} where r are the red values and so on. My hope is, that I don’t have to iterate over the whole array an put the values in float3 variable. Maybe there is a shorter way.
I hope this wasn’t too confusing.
Thanks,
Patrick