Function rcudnn::cudaMalloc3D[][src]

pub unsafe extern "C" fn cudaMalloc3D(
    pitchedDevPtr: *mut cudaPitchedPtr,
    extent: cudaExtent
) -> cudaError
Expand description

\brief Allocates logical 1D, 2D, or 3D memory objects on the device

Allocates at least \p width * \p height * \p depth bytes of linear memory on the device and returns a ::cudaPitchedPtr in which \p ptr is a pointer to the allocated memory. The function may pad the allocation to ensure hardware alignment requirements are met. The pitch returned in the \p pitch field of \p pitchedDevPtr is the width in bytes of the allocation.

The returned ::cudaPitchedPtr contains additional fields \p xsize and \p ysize, the logical width and height of the allocation, which are equivalent to the \p width and \p height \p extent parameters provided by the programmer during allocation.

For allocations of 2D and 3D objects, it is highly recommended that programmers perform allocations using ::cudaMalloc3D() or ::cudaMallocPitch(). Due to alignment restrictions in the hardware, this is especially true if the application will be performing memory copies involving 2D or 3D objects (whether linear memory or CUDA arrays).

\param pitchedDevPtr - Pointer to allocated pitched device memory \param extent - Requested allocation size (\p width field in bytes)

\return ::cudaSuccess, ::cudaErrorInvalidValue, ::cudaErrorMemoryAllocation \notefnerr \note_init_rt \note_callback

\sa ::cudaMallocPitch, ::cudaFree, ::cudaMemcpy3D, ::cudaMemset3D, ::cudaMalloc3DArray, ::cudaMallocArray, ::cudaFreeArray, \ref ::cudaMallocHost(void**, size_t) “cudaMallocHost (C API)”, ::cudaFreeHost, ::cudaHostAlloc, ::make_cudaPitchedPtr, ::make_cudaExtent, ::cuMemAllocPitch