cudaMallocPitch: Allocates pitched memory on the device

Description Usage Arguments Value References See Also

Description

Allocates at least width (in bytes) * height bytes of linear memory on the device and returns a pointer to the allocated memory. The function may pad the allocation to ensure that corresponding pointers in any given row will continue to meet the alignment requirements for coalescing as the address is updated from row to row. The pitch returned in *pitch by cudaMallocPitch() is the width in bytes of the allocation. The intended usage of pitch is as a separate parameter of the allocation, used to compute addresses within the 2D array. Given the row and column of an array element of type T, the address is computed as: T* pElement = (T*)((char*)BaseAddress + Row * pitch) + Column;

Usage

1

Arguments

width

Requested pitched allocation width (in bytes)

height

Requested pitched allocation height

Value

devPtr pitch

References

http://docs.nvidia.com/cuda/cuda-driver-api/index.html

See Also

cudaMalloc cudaFree cudaMallocArray cudaFreeArray cudaMallocHost cudaFreeHost cudaMalloc3D cudaMalloc3DArray cudaHostAlloc


duncantl/RCUDA documentation built on May 15, 2019, 5:26 p.m.