2

Is there any corresponding method for 3D array allocation and copy like cudaMallocPitch() and cudaMemcpy2D()?

Thanks!

2 Answers 2

3
cudaMalloc3D()
cudaMalloc3DArray()
cudaMemcpy3D()
Sign up to request clarification or add additional context in comments.

Comments

0

You can also use cudaMallocPitch() to allocate a linear device memory for 3D data by defining height as height * depth and get coalesced access in your kernel as long as you are taking into account the returned pitch from cudaMallocPitch() and some index arithmetic.

Similarly you can use cudaMalloc3D() to allocate logical 1D, 2D, or 3D memory objects on the device and get a pitchedDevPtr to work with in your kernel.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.