Writing CUDA surface backed by an array of vectors -



Writing CUDA surface backed by an array of vectors -

i trying write 2-dimensional cudaarray through surface<void, 2>. array has channel format {32, 32, 0, 0, cudachannelformatkindfloat} or set more simply, holds vector2s.

i trying write vector2 surface @ position indicated integer coordinates (x, y). next works well:

// write float2 vector d outsurf surf2dwrite(d.x, outsurf, x * sizeof(float2), y); surf2dwrite(d.y, outsurf, x * sizeof(float2) + sizeof(float), y);

however, if do

surf2dwrite(d, outsurf, x * sizeof(float2), y);

only x component of vector beingness written. what reason unintuitive behaviour?

i find hard believe of surf2dwrite calls think do. write float2 utilize this:

surf2dwrite<float2>(d, outsurf, x, y);

the x , y arguments coordinates on surface writing , template parameter tells phone call size of type beingness accessed.

vector cuda surface

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -