12.07.2015 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

130 Module Documentationtypedef enum CUarray_format_enum {CU_AD_FORMAT_UNSIGNED_INT8 = 0x01,CU_AD_FORMAT_UNSIGNED_INT16 = 0x02,CU_AD_FORMAT_UNSIGNED_INT32 = 0x03,CU_AD_FORMAT_SIGNED_INT8 = 0x08,CU_AD_FORMAT_SIGNED_INT16 = 0x09,CU_AD_FORMAT_SIGNED_INT32 = 0x0a,CU_AD_FORMAT_HALF = 0x10,CU_AD_FORMAT_FLOAT = 0x20} CUarray_format;• NumChannels specifies the number of packed components per <strong>CUDA</strong> array element; it may be 1, 2, or 4;• Flags provides for future features. For now, it must be set to 0.Here are examples of <strong>CUDA</strong> array descriptions:Description for a <strong>CUDA</strong> array of 2048 floats:<strong>CUDA</strong>_ARRAY3D_DESCRIPTOR desc;desc.Format = CU_AD_FORMAT_FLOAT;desc.NumChannels = 1;desc.Width = 2048;desc.Height = 0;desc.Depth = 0;Description for a 64 x 64 <strong>CUDA</strong> array of floats:<strong>CUDA</strong>_ARRAY3D_DESCRIPTOR desc;desc.Format = CU_AD_FORMAT_FLOAT;desc.NumChannels = 1;desc.Width = 64;desc.Height = 64;desc.Depth = 0;Description for a width x height x depth <strong>CUDA</strong> array of 64-bit, 4x16-bit float16’s:<strong>CUDA</strong>_ARRAY3D_DESCRIPTOR desc;desc.FormatFlags = CU_AD_FORMAT_HALF;desc.NumChannels = 4;desc.Width = width;desc.Height = height;desc.Depth = depth;Parameters:pHandle - Returned arraypDesc - 3D array descriptorReturns:Note:<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUE, <strong>CUDA</strong>_ERROR_OUT_OF_MEMORY,<strong>CUDA</strong>_ERROR_UNKNOWNNote that this function may also return error codes from previous, asynchronous launches.Generated 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!