11.01.2014 Views

NVIDIA CUDA

NVIDIA CUDA

NVIDIA CUDA

SHOW MORE
SHOW LESS

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

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

220 Module Documentation<br />

If pResource is not registered, then <strong>CUDA</strong>_ERROR_INVALID_HANDLE is returned. If pResource was not<br />

registered with usage flags CU_D3D10_REGISTER_FLAGS_ARRAY, then <strong>CUDA</strong>_ERROR_INVALID_HANDLE<br />

is returned. If pResource is not mapped, then <strong>CUDA</strong>_ERROR_NOT_MAPPED is returned.<br />

For usage requirements of the SubResource parameter, see cuD3D10ResourceGetMappedPointer().<br />

Parameters:<br />

pArray - Returned array corresponding to subresource<br />

pResource - Mapped resource to access<br />

SubResource - Subresource of pResource to access<br />

Returns:<br />

Note:<br />

<strong>CUDA</strong>_SUCCESS, <strong>CUDA</strong>_ERROR_DEINITIALIZED, <strong>CUDA</strong>_ERROR_NOT_INITIALIZED, <strong>CUDA</strong>_-<br />

ERROR_INVALID_CONTEXT, <strong>CUDA</strong>_ERROR_INVALID_VALUE, <strong>CUDA</strong>_ERROR_INVALID_HANDLE,<br />

<strong>CUDA</strong>_ERROR_NOT_MAPPED<br />

See also:<br />

Note that this function may also return error codes from previous, asynchronous launches.<br />

cuGraphicsSubResourceGetMappedArray<br />

4.37.2.4 cuD3D10ResourceGetMappedPitch (unsigned int ∗ pPitch, unsigned int ∗ pPitchSlice,<br />

ID3D10Resource ∗ pResource, unsigned int SubResource)<br />

Deprecated<br />

This function is deprecated as of Cuda 3.0.<br />

Returns in ∗pPitch and ∗pPitchSlice the pitch and Z-slice pitch of the subresource of the mapped Direct3D<br />

resource pResource, which corresponds to SubResource. The values set in pPitch and pPitchSlice may<br />

change every time that pResource is mapped.<br />

The pitch and Z-slice pitch values may be used to compute the location of a sample on a surface as follows.<br />

For a 2D surface, the byte offset of the sample at position x, y from the base pointer of the surface is:<br />

y ∗ pitch + (bytes per pixel) ∗ x<br />

For a 3D surface, the byte offset of the sample at position x, y, z from the base pointer of the surface is:<br />

z∗ slicePitch + y ∗ pitch + (bytes per pixel) ∗ x<br />

Both parameters pPitch and pPitchSlice are optional and may be set to NULL.<br />

If pResource is not of type IDirect3DBaseTexture10 or one of its sub-types or if pResource has not been registered<br />

for use with <strong>CUDA</strong>, then <strong>CUDA</strong>_ERROR_INVALID_HANDLE is returned. If pResource was not registered<br />

with usage flags CU_D3D10_REGISTER_FLAGS_NONE, then <strong>CUDA</strong>_ERROR_INVALID_HANDLE is returned.<br />

If pResource is not mapped for access by <strong>CUDA</strong>, then <strong>CUDA</strong>_ERROR_NOT_MAPPED is returned.<br />

For usage requirements of the SubResource parameter, see cuD3D10ResourceGetMappedPointer().<br />

Parameters:<br />

pPitch - Returned pitch of subresource<br />

Generated 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!