OSDN Git Service

new file: Integration/Tomography/Makefile.recent
[eos/hostdependX86LINUX64.git] / hostdepend / X86MAC64 / util / X86MAC64 / cuda / man / man3 / CUDART_D3D9.3
1 devPtr, GLuint bufObj)bufObj)device)bufObj)bufObj)device, HGPUNV hGpu).TH "Direct3D 9 Interoperability" 3 "30 Mar 2009" "Version 2.2" "NVIDIA CUDA Library" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 Direct3D 9 Interoperability \- 
6 .SS "Direct3D 9 Interoperability with CUDA Runtime"
7 Direct3D 9 Interoperability with CUDA Runtime
8 .PP
9 \fBAuthor:\fP
10 .RS 4
11 NVIDIA Corporation 
12 .RE
13 .PP
14
15 .in +1c
16 .ti -1c
17 .RI "enum \fBcudaD3D9MapFlags\fP { \fBcudaD3D9MapFlagsNone\fP, \fBcudaD3D9MapFlagsReadOnly\fP, \fBcudaD3D9MapFlagsWriteDiscard\fP }"
18 .br
19 .ti -1c
20 .RI "enum \fBcudaD3D9RegisterFlags\fP { \fBcudaD3D9RegisterFlagsNone\fP, \fBcudaD3D9RegisterFlagsArray\fP }"
21 .br
22 .ti -1c
23 .RI "\fBcudaError_t\fP \fBcudaD3D9GetDevice\fP (int *device, const char *pszAdapterName)"
24 .br
25 .RI "\fIGets the device number for an adapter. \fP"
26 .ti -1c
27 .RI "\fBcudaError_t\fP \fBcudaD3D9GetDirect3DDevice\fP (IDirect3DDevice9 **ppDxDevice)"
28 .br
29 .RI "\fIGets the Direct3D device against which the current CUDA context was created. \fP"
30 .ti -1c
31 .RI "\fBcudaError_t\fP \fBcudaD3D9MapResources\fP (int count, IDirect3DResource9 **ppResources)"
32 .br
33 .RI "\fIMap Direct3D resources for access by CUDA. \fP"
34 .ti -1c
35 .RI "\fBcudaError_t\fP \fBcudaD3D9RegisterResource\fP (IDirect3DResource9 *pResource, unsigned int flags)"
36 .br
37 .RI "\fIRegisters a Direct3D resource for access by CUDA. \fP"
38 .ti -1c
39 .RI "\fBcudaError_t\fP \fBcudaD3D9ResourceGetMappedArray\fP (cudaArray **ppArray, IDirect3DResource9 *pResource, unsigned int face, unsigned int level)"
40 .br
41 .RI "\fIGet an array through which to access a subresource of a Direct3D resource which has been mapped for access by CUDA. \fP"
42 .ti -1c
43 .RI "\fBcudaError_t\fP \fBcudaD3D9ResourceGetMappedPitch\fP (size_t *pPitch, size_t *pPitchSlice, IDirect3DResource9 *pResource, unsigned int face, unsigned int level)"
44 .br
45 .RI "\fIGet the pitch of a subresource of a Direct3D resource which has been mapped for access by CUDA. \fP"
46 .ti -1c
47 .RI "\fBcudaError_t\fP \fBcudaD3D9ResourceGetMappedPointer\fP (void **pPointer, IDirect3DResource9 *pResource, unsigned int face, unsigned int level)"
48 .br
49 .RI "\fIGet a pointer through which to access a subresource of a Direct3D resource which has been mapped for access by CUDA. \fP"
50 .ti -1c
51 .RI "\fBcudaError_t\fP \fBcudaD3D9ResourceGetMappedSize\fP (size_t *pSize, IDirect3DResource9 *pResource, unsigned int face, unsigned int level)"
52 .br
53 .RI "\fIGet the size of a subresource of a Direct3D resource which has been mapped for access by CUDA. \fP"
54 .ti -1c
55 .RI "\fBcudaError_t\fP \fBcudaD3D9ResourceGetSurfaceDimensions\fP (size_t *pWidth, size_t *pHeight, size_t *pDepth, IDirect3DResource9 *pResource, unsigned int face, unsigned int level)"
56 .br
57 .RI "\fIGet the dimensions of a registered Direct3D surface. \fP"
58 .ti -1c
59 .RI "\fBcudaError_t\fP \fBcudaD3D9ResourceSetMapFlags\fP (IDirect3DResource9 *pResource, unsigned int flags)"
60 .br
61 .RI "\fISet usage flags for mapping a Direct3D resource. \fP"
62 .ti -1c
63 .RI "\fBcudaError_t\fP \fBcudaD3D9SetDirect3DDevice\fP (IDirect3DDevice9 *pDxDevice)"
64 .br
65 .RI "\fISets the Direct3D device to use for interoperability in this thread. \fP"
66 .ti -1c
67 .RI "\fBcudaError_t\fP \fBcudaD3D9UnmapResources\fP (int count, IDirect3DResource9 **ppResources)"
68 .br
69 .RI "\fIUnmap Direct3D resources for access by CUDA. \fP"
70 .ti -1c
71 .RI "\fBcudaError_t\fP \fBcudaD3D9UnregisterResource\fP (IDirect3DResource9 *pResource)"
72 .br
73 .RI "\fIUnregisters a Direct3D resource for access by CUDA. \fP"
74 .in -1c
75 .SH "Detailed Description"
76 .PP 
77 This section describes the Direct3D 9 interoperability functions of the CUDA runtime application programming interface. 
78 .SH "Enumeration Type Documentation"
79 .PP 
80 .SS "enum \fBcudaD3D9MapFlags\fP"
81 .PP
82 CUDA D3D9 Map Flags 
83 .PP
84 \fBEnumerator: \fP
85 .in +1c
86 .TP
87 \fB\fIcudaD3D9MapFlagsNone \fP\fP
88 Default; Assume resource can be read/written. 
89 .TP
90 \fB\fIcudaD3D9MapFlagsReadOnly \fP\fP
91 CUDA kernels will not write to this resource. 
92 .TP
93 \fB\fIcudaD3D9MapFlagsWriteDiscard \fP\fP
94 CUDA kernels will only write to and will not read from this resource. 
95 .SS "enum \fBcudaD3D9RegisterFlags\fP"
96 .PP
97 CUDA D3D9 Register Flags 
98 .PP
99 \fBEnumerator: \fP
100 .in +1c
101 .TP
102 \fB\fIcudaD3D9RegisterFlagsNone \fP\fP
103 Default; Resource can be accessed througa void*. 
104 .TP
105 \fB\fIcudaD3D9RegisterFlagsArray \fP\fP
106 Resource can be accessed through a CUarray*. 
107 .SH "Function Documentation"
108 .PP 
109 .SS "\fBcudaError_t\fP cudaD3D9GetDevice (int * device, const char * pszAdapterName)"
110 .PP
111 Returns in \fC*device\fP the CUDA-compatible device corresponding to the adapter name \fCpszAdapterName\fP obtained from EnumDisplayDevices or IDirect3D9::GetAdapterIdentifier(). If no device on the adapter with name \fCpszAdapterName\fP is CUDA-compatible then the call will fail.
112 .PP
113 \fBParameters:\fP
114 .RS 4
115 \fIdevice\fP - Returns the device corresponding to pszAdapterName 
116 .br
117 \fIpszAdapterName\fP - D3D9 adapter to get device for
118 .RE
119 .PP
120 \fBReturns:\fP
121 .RS 4
122 \fBcudaSuccess\fP, \fBcudaErrorInvalidValue\fP, \fBcudaErrorUnknown\fP 
123 .RE
124 .PP
125 \fBNote:\fP
126 .RS 4
127 Note that this function may also return error codes from previous, asynchronous launches.
128 .RE
129 .PP
130 \fBSee also:\fP
131 .RS 4
132 \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
133 .RE
134 .PP
135
136 .SS "\fBcudaError_t\fP cudaD3D9GetDirect3DDevice (IDirect3DDevice9 ** ppDxDevice)"
137 .PP
138 Returns in \fC*ppDxDevice\fP the Direct3D device against which this CUDA context was created in \fBcudaD3D9SetDirect3DDevice()\fP.
139 .PP
140 \fBParameters:\fP
141 .RS 4
142 \fIppDxDevice\fP - Returns the Direct3D device for this thread
143 .RE
144 .PP
145 \fBReturns:\fP
146 .RS 4
147 \fBcudaSuccess\fP, \fBcudaErrorUnknown\fP 
148 .RE
149 .PP
150 \fBNote:\fP
151 .RS 4
152 Note that this function may also return error codes from previous, asynchronous launches.
153 .RE
154 .PP
155 \fBSee also:\fP
156 .RS 4
157 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
158 .RE
159 .PP
160
161 .SS "\fBcudaError_t\fP cudaD3D9MapResources (int count, IDirect3DResource9 ** ppResources)"
162 .PP
163 Maps the \fCcount\fP Direct3D resources in \fCppResources\fP for access by CUDA.
164 .PP
165 The resources in \fCppResources\fP may be accessed in CUDA kernels until they are unmapped. Direct3D should not access any resources while they are mapped by CUDA. If an application does so, the results are undefined.
166 .PP
167 This function provides the synchronization guarantee that any Direct3D calls issued before \fBcudaD3D9MapResources()\fP will complete before any CUDA kernels issued after \fBcudaD3D9MapResources()\fP begin.
168 .PP
169 If any of \fCppResources\fP have not been registered for use with CUDA or if \fCppResources\fP contains any duplicate entries then \fBcudaErrorInvalidResourceHandle\fP is returned. If any of \fCppResources\fP are presently mapped for access by CUDA then \fBcudaErrorUnknown\fP is returned.
170 .PP
171 \fBParameters:\fP
172 .RS 4
173 \fIcount\fP - Number of resources to map for CUDA 
174 .br
175 \fIppResources\fP - Resources to map for CUDA
176 .RE
177 .PP
178 \fBReturns:\fP
179 .RS 4
180 \fBcudaSuccess\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
181 .RE
182 .PP
183 \fBNote:\fP
184 .RS 4
185 Note that this function may also return error codes from previous, asynchronous launches.
186 .RE
187 .PP
188 \fBSee also:\fP
189 .RS 4
190 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
191 .RE
192 .PP
193
194 .SS "\fBcudaError_t\fP cudaD3D9RegisterResource (IDirect3DResource9 * pResource, unsigned int flags)"
195 .PP
196 Registers the Direct3D resource \fCpResource\fP for access by CUDA.
197 .PP
198 If this call is successful, then the application will be able to map and unmap this resource until it is unregistered through \fBcudaD3D9UnregisterResource()\fP. Also on success, this call will increase the internal reference count on \fCpResource\fP. This reference count will be decremented when this resource is unregistered through \fBcudaD3D9UnregisterResource()\fP.
199 .PP
200 This call is potentially high-overhead and should not be called every frame in interactive applications.
201 .PP
202 The type of \fCpResource\fP must be one of the following.
203 .PP
204 .IP "\(bu" 2
205 IDirect3DVertexBuffer9: No notes.
206 .IP "\(bu" 2
207 IDirect3DIndexBuffer9: No notes.
208 .IP "\(bu" 2
209 IDirect3DSurface9: Only stand-alone objects of type IDirect3DSurface9 may be explicitly shared. In particular, individual mipmap levels and faces of cube maps may not be registered directly. To access individual surfaces associated with a texture, one must register the base texture object.
210 .IP "\(bu" 2
211 IDirect3DBaseTexture9: When a texture is registered, all surfaces associated with all mipmap levels of all faces of the texture will be accessible to CUDA.
212 .PP
213 .PP
214 The \fCflags\fP argument specifies the mechanism through which CUDA will access the Direct3D resource. The following value is allowed:
215 .PP
216 .IP "\(bu" 2
217 \fBcudaD3D9RegisterFlagsNone\fP: Specifies that CUDA will access this resource through a \fCvoid*\fP. The pointer, size, and pitch for each subresource of this resource may be queried through \fBcudaD3D9ResourceGetMappedPointer()\fP, \fBcudaD3D9ResourceGetMappedSize()\fP, and \fBcudaD3D9ResourceGetMappedPitch()\fP respectively. This option is valid for all resource types.
218 .PP
219 .PP
220 Not all Direct3D resources of the above types may be used for interoperability with CUDA. The following are some limitations:
221 .PP
222 .IP "\(bu" 2
223 The primary rendertarget may not be registered with CUDA.
224 .IP "\(bu" 2
225 Resources allocated as shared may not be registered with CUDA.
226 .IP "\(bu" 2
227 Any resources allocated in D3DPOOL_SYSTEMMEM or D3DPOOL_MANAGED may not be registered with CUDA.
228 .IP "\(bu" 2
229 Textures which are not of a format which is 1, 2, or 4 channels of 8, 16, or 32-bit integer or floating-point data cannot be shared.
230 .IP "\(bu" 2
231 Surfaces of depth or stencil formats cannot be shared.
232 .PP
233 .PP
234 If Direct3D interoperability is not initialized on this context, then \fBcudaErrorInvalidDevice\fP is returned. If \fCpResource\fP is of incorrect type (e.g, is a non-stand-alone IDirect3DSurface9) or is already registered, then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP cannot be registered then \fBcudaErrorUnknown\fP is returned.
235 .PP
236 \fBParameters:\fP
237 .RS 4
238 \fIpResource\fP - Resource to register 
239 .br
240 \fIflags\fP - Parameters for resource registration
241 .RE
242 .PP
243 \fBReturns:\fP
244 .RS 4
245 \fBcudaSuccess\fP, \fBcudaErrorInvalidValue\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
246 .RE
247 .PP
248 \fBNote:\fP
249 .RS 4
250 Note that this function may also return error codes from previous, asynchronous launches.
251 .RE
252 .PP
253 \fBSee also:\fP
254 .RS 4
255 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
256 .RE
257 .PP
258
259 .SS "\fBcudaError_t\fP cudaD3D9ResourceGetMappedArray (cudaArray ** ppArray, IDirect3DResource9 * pResource, unsigned int face, unsigned int level)"
260 .PP
261 Returns in \fC*pArray\fP an array through which the subresource of the mapped Direct3D resource \fCpResource\fP, which corresponds to \fCface\fP and \fClevel\fP may be accessed. The value set in \fCpArray\fP may change every time that \fCpResource\fP is mapped.
262 .PP
263 If \fCpResource\fP is not registered then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP was not registered with usage flags \fBcudaD3D9RegisterFlagsArray\fP, then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP is not mapped, then \fBcudaErrorUnknown\fP is returned.
264 .PP
265 For usage requirements of \fCface\fP and \fClevel\fP parameters, see \fBcudaD3D9ResourceGetMappedPointer()\fP.
266 .PP
267 \fBParameters:\fP
268 .RS 4
269 \fIppArray\fP - Returned array corresponding to subresource 
270 .br
271 \fIpResource\fP - Mapped resource to access 
272 .br
273 \fIface\fP - Face of resource to access 
274 .br
275 \fIlevel\fP - Level of resource to access
276 .RE
277 .PP
278 \fBReturns:\fP
279 .RS 4
280 \fBcudaSuccess\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
281 .RE
282 .PP
283 \fBNote:\fP
284 .RS 4
285 Note that this function may also return error codes from previous, asynchronous launches.
286 .RE
287 .PP
288 \fBSee also:\fP
289 .RS 4
290 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
291 .RE
292 .PP
293
294 .SS "\fBcudaError_t\fP cudaD3D9ResourceGetMappedPitch (size_t * pPitch, size_t * pPitchSlice, IDirect3DResource9 * pResource, unsigned int face, unsigned int level)"
295 .PP
296 Returns in \fC*pPitch\fP and \fC*pPitchSlice\fP the pitch and Z-slice pitch of the subresource of the mapped Direct3D resource \fCpResource\fP, which corresponds to \fCface\fP and \fClevel\fP. The values set in \fCpPitch\fP and \fCpPitchSlice\fP may change every time that \fCpResource\fP is mapped.
297 .PP
298 The pitch and Z-slice pitch values may be used to compute the location of a sample on a surface as follows.
299 .PP
300 For a 2D surface, the byte offset of the sample at position \fBx\fP, \fBy\fP from the base pointer of the surface is:
301 .PP
302 \fBy\fP * \fBpitch\fP + (\fBbytes per pixel\fP) * \fBx\fP 
303 .PP
304 For a 3D surface, the byte offset of the sample at position \fBx\fP, \fBy\fP, \fBz\fP from the base pointer of the surface is:
305 .PP
306 \fBz*\fP \fBslicePitch\fP + \fBy\fP * \fBpitch\fP + (\fBbytes per pixel\fP) * \fBx\fP 
307 .PP
308 Both parameters \fCpPitch\fP and \fCpPitchSlice\fP are optional and may be set to NULL.
309 .PP
310 If \fCpResource\fP is not of type IDirect3DBaseTexture9 or one of its sub-types or if \fCpResource\fP has not been registered for use with CUDA, then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP was not registered with usage flags \fBcudaD3D9RegisterFlagsNone\fP, then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP is not mapped for access by CUDA then \fBcudaErrorUnknown\fP is returned.
311 .PP
312 For usage requirements of \fCface\fP and \fClevel\fP parameters, see \fBcudaD3D9ResourceGetMappedPointer()\fP.
313 .PP
314 \fBParameters:\fP
315 .RS 4
316 \fIpPitch\fP - Returned pitch of subresource 
317 .br
318 \fIpPitchSlice\fP - Returned Z-slice pitch of subresource 
319 .br
320 \fIpResource\fP - Mapped resource to access 
321 .br
322 \fIface\fP - Face of resource to access 
323 .br
324 \fIlevel\fP - Level of resource to access
325 .RE
326 .PP
327 \fBReturns:\fP
328 .RS 4
329 \fBcudaSuccess\fP, \fBcudaErrorInvalidValue\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
330 .RE
331 .PP
332 \fBNote:\fP
333 .RS 4
334 Note that this function may also return error codes from previous, asynchronous launches.
335 .RE
336 .PP
337 \fBSee also:\fP
338 .RS 4
339 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP 
340 .RE
341 .PP
342
343 .SS "\fBcudaError_t\fP cudaD3D9ResourceGetMappedPointer (void ** pPointer, IDirect3DResource9 * pResource, unsigned int face, unsigned int level)"
344 .PP
345 Returns in \fC*pPointer\fP the base pointer of the subresource of the mapped Direct3D resource \fCpResource\fP, which corresponds to \fCface\fP and \fClevel\fP. The value set in \fCpPointer\fP may change every time that \fCpResource\fP is mapped.
346 .PP
347 If \fCpResource\fP is not registered, then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP was not registered with usage flags \fBcudaD3D9RegisterFlagsNone\fP, then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP is not mapped, then \fBcudaErrorUnknown\fP is returned.
348 .PP
349 If \fCpResource\fP is of type IDirect3DCubeTexture9, then \fCface\fP must one of the values enumerated by type D3DCUBEMAP_FACES. For all other types, \fCface\fP must be 0. If \fCface\fP is invalid, then \fBcudaErrorInvalidValue\fP is returned.
350 .PP
351 If \fCpResource\fP is of type IDirect3DBaseTexture9, then \fClevel\fP must correspond to a valid mipmap level. Only mipmap level 0 is supported for now. For all other types \fClevel\fP must be 0. If \fClevel\fP is invalid, then \fBcudaErrorInvalidValue\fP is returned.
352 .PP
353 \fBParameters:\fP
354 .RS 4
355 \fIpPointer\fP - Returned pointer corresponding to subresource 
356 .br
357 \fIpResource\fP - Mapped resource to access 
358 .br
359 \fIface\fP - Face of resource to access 
360 .br
361 \fIlevel\fP - Level of resource to access
362 .RE
363 .PP
364 \fBReturns:\fP
365 .RS 4
366 \fBcudaSuccess\fP, \fBcudaErrorInvalidValue\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
367 .RE
368 .PP
369 \fBNote:\fP
370 .RS 4
371 Note that this function may also return error codes from previous, asynchronous launches.
372 .RE
373 .PP
374 \fBSee also:\fP
375 .RS 4
376 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
377 .RE
378 .PP
379
380 .SS "\fBcudaError_t\fP cudaD3D9ResourceGetMappedSize (size_t * pSize, IDirect3DResource9 * pResource, unsigned int face, unsigned int level)"
381 .PP
382 Returns in \fC*pSize\fP the size of the subresource of the mapped Direct3D resource \fCpResource\fP, which corresponds to \fCface\fP and \fClevel\fP. The value set in \fCpSize\fP may change every time that \fCpResource\fP is mapped.
383 .PP
384 If \fCpResource\fP has not been registered for use with CUDA then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP was not registered with usage flags \fBcudaD3D9RegisterFlagsNone\fP, then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP is not mapped for access by CUDA then \fBcudaErrorUnknown\fP is returned.
385 .PP
386 For usage requirements of \fCface\fP and \fClevel\fP parameters, see \fBcudaD3D9ResourceGetMappedPointer()\fP.
387 .PP
388 \fBParameters:\fP
389 .RS 4
390 \fIpSize\fP - Returned size of subresource 
391 .br
392 \fIpResource\fP - Mapped resource to access 
393 .br
394 \fIface\fP - Face of resource to access 
395 .br
396 \fIlevel\fP - Level of resource to access
397 .RE
398 .PP
399 \fBReturns:\fP
400 .RS 4
401 \fBcudaSuccess\fP, \fBcudaErrorInvalidValue\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
402 .RE
403 .PP
404 \fBNote:\fP
405 .RS 4
406 Note that this function may also return error codes from previous, asynchronous launches.
407 .RE
408 .PP
409 \fBSee also:\fP
410 .RS 4
411 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
412 .RE
413 .PP
414
415 .SS "\fBcudaError_t\fP cudaD3D9ResourceGetSurfaceDimensions (size_t * pWidth, size_t * pHeight, size_t * pDepth, IDirect3DResource9 * pResource, unsigned int face, unsigned int level)"
416 .PP
417 Returns in \fC*pWidth\fP, \fC*pHeight\fP, and \fC*pDepth\fP the dimensions of the subresource of the mapped Direct3D resource \fCpResource\fP which corresponds to \fCface\fP and \fClevel\fP.
418 .PP
419 Because anti-aliased surfaces may have multiple samples per pixel, it is possible that the dimensions of a resource will be an integer factor larger than the dimensions reported by the Direct3D runtime.
420 .PP
421 The parameters \fCpWidth\fP, \fCpHeight\fP, and \fCpDepth\fP are optional. For 2D surfaces, the value returned in \fC*pDepth\fP will be 0.
422 .PP
423 If \fCpResource\fP is not of type IDirect3DBaseTexture9 or IDirect3DSurface9 or if \fCpResource\fP has not been registered for use with CUDA, then \fBcudaErrorInvalidResourceHandle\fP is returned.
424 .PP
425 For usage requirements of \fCface\fP and \fClevel\fP parameters, see \fBcudaD3D9ResourceGetMappedPointer\fP.
426 .PP
427 \fBParameters:\fP
428 .RS 4
429 \fIpWidth\fP - Returned width of surface 
430 .br
431 \fIpHeight\fP - Returned height of surface 
432 .br
433 \fIpDepth\fP - Returned depth of surface 
434 .br
435 \fIpResource\fP - Registered resource to access 
436 .br
437 \fIface\fP - Face of resource to access 
438 .br
439 \fIlevel\fP - Level of resource to access
440 .RE
441 .PP
442 \fBReturns:\fP
443 .RS 4
444 \fBcudaSuccess\fP, \fBcudaErrorInvalidValue\fP, \fBcudaErrorInvalidResourceHandle\fP, 
445 .RE
446 .PP
447 \fBNote:\fP
448 .RS 4
449 Note that this function may also return error codes from previous, asynchronous launches.
450 .RE
451 .PP
452 \fBSee also:\fP
453 .RS 4
454 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
455 .RE
456 .PP
457
458 .SS "\fBcudaError_t\fP cudaD3D9ResourceSetMapFlags (IDirect3DResource9 * pResource, unsigned int flags)"
459 .PP
460 Set flags for mapping the Direct3D resource \fCpResource\fP.
461 .PP
462 Changes to flags will take effect the next time \fCpResource\fP is mapped. The \fCflags\fP argument may be any of the following:
463 .PP
464 .IP "\(bu" 2
465 \fBcudaD3D9MapFlagsNone\fP: Specifies no hints about how this resource will be used. It is therefore assumed that this resource will be read from and written to by CUDA kernels. This is the default value.
466 .IP "\(bu" 2
467 \fBcudaD3D9MapFlagsReadOnly\fP: Specifies that CUDA kernels which access this resource will not write to this resource.
468 .IP "\(bu" 2
469 \fBcudaD3D9MapFlagsWriteDiscard\fP: Specifies that CUDA kernels which access this resource will not read from this resource and will write over the entire contents of the resource, so none of the data previously stored in the resource will be preserved.
470 .PP
471 .PP
472 If \fCpResource\fP has not been registered for use with CUDA, then \fBcudaErrorInvalidResourceHandle\fP is returned. If \fCpResource\fP is presently mapped for access by CUDA, then \fBcudaErrorUnknown\fP is returned.
473 .PP
474 \fBParameters:\fP
475 .RS 4
476 \fIpResource\fP - Registered resource to set flags for 
477 .br
478 \fIflags\fP - Parameters for resource mapping
479 .RE
480 .PP
481 \fBReturns:\fP
482 .RS 4
483 \fBcudaSuccess\fP, \fBcudaErrorInvalidValue\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
484 .RE
485 .PP
486 \fBNote:\fP
487 .RS 4
488 Note that this function may also return error codes from previous, asynchronous launches.
489 .RE
490 .PP
491 \fBSee also:\fP
492 .RS 4
493 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
494 .RE
495 .PP
496
497 .SS "\fBcudaError_t\fP cudaD3D9SetDirect3DDevice (IDirect3DDevice9 * pDxDevice)"
498 .PP
499 Records \fCpDxDevice\fP as the Direct3D device to use for Direct3D interoperability on this host thread. In order to use Direct3D interoperability, this call must be made before any non-device management CUDA runtime calls on this thread. In that case, this call will return \fBcudaErrorSetOnActiveProcess\fP.
500 .PP
501 Successful context creation on \fCpDxDevice\fP will increase the internal reference count on \fCpDxDevice\fP. This reference count will be decremented upon destruction of this context through \fBcudaThreadExit()\fP.
502 .PP
503 \fBParameters:\fP
504 .RS 4
505 \fIpDxDevice\fP - Direct3D device to use for this thread
506 .RE
507 .PP
508 \fBReturns:\fP
509 .RS 4
510 \fBcudaSuccess\fP, \fBcudaErrorInitializationError\fP, \fBcudaErrorInvalidValue\fP, \fBcudaErrorSetOnActiveProcess\fP 
511 .RE
512 .PP
513 \fBNote:\fP
514 .RS 4
515 Note that this function may also return error codes from previous, asynchronous launches.
516 .RE
517 .PP
518 \fBSee also:\fP
519 .RS 4
520 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
521 .RE
522 .PP
523
524 .SS "\fBcudaError_t\fP cudaD3D9UnmapResources (int count, IDirect3DResource9 ** ppResources)"
525 .PP
526 Unmaps the \fCcount\fP Direct3D resources in \fCppResources\fP.
527 .PP
528 This function provides the synchronization guarantee that any CUDA kernels issued before \fBcudaD3D9UnmapResources()\fP will complete before any Direct3D calls issued after \fBcudaD3D9UnmapResources()\fP begin.
529 .PP
530 If any of \fCppResources\fP have not been registered for use with CUDA or if \fCppResources\fP contains any duplicate entries, then \fBcudaErrorInvalidResourceHandle\fP is returned. If any of \fCppResources\fP are not presently mapped for access by CUDA then \fBcudaErrorUnknown\fP is returned.
531 .PP
532 \fBParameters:\fP
533 .RS 4
534 \fIcount\fP - Number of resources to unmap for CUDA 
535 .br
536 \fIppResources\fP - Resources to unmap for CUDA
537 .RE
538 .PP
539 \fBReturns:\fP
540 .RS 4
541 \fBcudaSuccess\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
542 .RE
543 .PP
544 \fBNote:\fP
545 .RS 4
546 Note that this function may also return error codes from previous, asynchronous launches.
547 .RE
548 .PP
549 \fBSee also:\fP
550 .RS 4
551 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9UnregisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
552 .RE
553 .PP
554
555 .SS "\fBcudaError_t\fP cudaD3D9UnregisterResource (IDirect3DResource9 * pResource)"
556 .PP
557 Unregisters the Direct3D resource \fCpResource\fP so it is not accessible by CUDA unless registered again.
558 .PP
559 If \fCpResource\fP is not registered, then \fBcudaErrorInvalidResourceHandle\fP is returned.
560 .PP
561 \fBParameters:\fP
562 .RS 4
563 \fIpResource\fP - Resource to unregister
564 .RE
565 .PP
566 \fBReturns:\fP
567 .RS 4
568 \fBcudaSuccess\fP, \fBcudaErrorInvalidResourceHandle\fP, \fBcudaErrorUnknown\fP 
569 .RE
570 .PP
571 \fBNote:\fP
572 .RS 4
573 Note that this function may also return error codes from previous, asynchronous launches.
574 .RE
575 .PP
576 \fBSee also:\fP
577 .RS 4
578 \fBcudaD3D9GetDevice\fP, \fBcudaD3D9SetDirect3DDevice\fP, \fBcudaD3D9GetDirect3DDevice\fP, \fBcudaD3D9RegisterResource\fP, \fBcudaD3D9MapResources\fP, \fBcudaD3D9UnmapResources\fP, \fBcudaD3D9ResourceGetSurfaceDimensions\fP, \fBcudaD3D9ResourceSetMapFlags\fP, \fBcudaD3D9ResourceGetMappedArray\fP, \fBcudaD3D9ResourceGetMappedPointer\fP, \fBcudaD3D9ResourceGetMappedSize\fP, \fBcudaD3D9ResourceGetMappedPitch\fP 
579 .RE
580 .PP
581
582 .SH "Author"
583 .PP 
584 Generated automatically by Doxygen for NVIDIA CUDA Library from the source code.