12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

30 Module Documentationextent - Requested allocation sizeReturns:Note:See also:cudaSuccess, cudaErrorMemoryAllocationNote that this function may also return error codes from previous, asynchronous launches.cudaMallocPitch, cudaFree, cudaMemcpy3D, cudaMemset3D, cudaMalloc3DArray, cudaMallocArray, cudaFreeArray,cudaMallocHost, cudaFreeHost, cudaHostAlloc, make_cudaPitchedPtr, make_cudaExtent3.8.2.10 cudaError_t cudaMalloc3DArray (struct cudaArray ∗∗ arrayPtr, const structcudaChannelFormatDesc ∗ desc, struct cudaExtent extent)Allocates a <strong>CUDA</strong> array according to the cudaChannelFormatDesc structure desc and returns a handle to the new<strong>CUDA</strong> array in ∗arrayPtr.The cudaChannelFormatDesc is defined as:struct cudaChannelFormatDesc {int x, y, z, w;enum cudaChannelFormatKind f;};where cudaChannelFormatKind is one of cudaChannelFormatKindSigned, cudaChannelFormatKindUnsigned, or cudaChannelFormatKindFloat.cudaMalloc3DArray() is able to allocate 1D, 2D, or 3D arrays.Note:• A 1D array is allocated if the height and depth extent are both zero. For 1D arrays valid extent ranges are {(1,8192), 0, 0}.• A 2D array is allocated if only the depth extent is zero. For 2D arrays valid extent ranges are {(1, 65536), (1,32768), 0}.• A 3D array is allocated if all three extents are non-zero. For 3D arrays valid extent ranges are {(1, 2048), (1,2048), (1, 2048)}.Due to the differing extent limits, it may be advantageous to use a degenerate array (with unused dimensions setto one) of higher dimensionality. For instance, a degenerate 2D array allows for significantly more linear storagethan a 1D array.Parameters:arrayPtr - Pointer to allocated array in device memorydesc - Requested channel formatextent - Requested allocation sizeReturns:cudaSuccess, cudaErrorMemoryAllocationGenerated on Wed Apr 1 16:11:42 2009 for <strong>NVIDIA</strong> <strong>CUDA</strong> Library by Doxygen

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!