cudaMallocPitch() question

f I want to use

T* pElement = (T*)((char*)BaseAddress + Column* pitch) + Row;

Do I write?

cudaMallocPitch( (void**) &d_src , &pitch , height* sizeof(float) , width);

Thanks!

NO!

if you want to access data with “T* pElement = (T*)((char*)BaseAddress + Column* pitch) + Row;”

you may not get proper result. That must be a transformation matrix.