OSDN Git Service

new file: Integration/Tomography/Makefile.recent
[eos/hostdependX86LINUX64.git] / util / X86MAC64 / cuda / man / man3 / CUMODULE.3
1 pCtx, unsigned int Flags)pCtx, unsigned int Flags, \fBCUdevice\fP dev)ctx)pCtx)device)pCtx)NewCtx).TH "Module Management" 3 "30 Mar 2009" "Version 2.2" "NVIDIA CUDA Library" \" -*- nroff -*-
2 .ad l
3 .nh
4 .SH NAME
5 Module Management \- 
6 .SS "Functions"
7
8 .in +1c
9 .ti -1c
10 .RI "\fBCUresult\fP \fBcuModuleGetFunction\fP (\fBCUfunction\fP *func, \fBCUmodule\fP mod, const char *name)"
11 .br
12 .RI "\fIReturns a function handle. \fP"
13 .ti -1c
14 .RI "\fBCUresult\fP \fBcuModuleGetGlobal\fP (\fBCUdeviceptr\fP *ret_dptr, unsigned int *ret_bytes, \fBCUmodule\fP mod, const char *name)"
15 .br
16 .RI "\fIReturns a global pointer from a module. \fP"
17 .ti -1c
18 .RI "\fBCUresult\fP \fBcuModuleGetTexRef\fP (\fBCUtexref\fP *ppTexRef, \fBCUmodule\fP mod, const char *name)"
19 .br
20 .RI "\fIReturns a handle to a texture-reference. \fP"
21 .ti -1c
22 .RI "\fBCUresult\fP \fBcuModuleLoad\fP (\fBCUmodule\fP *phMod, const char *fname)"
23 .br
24 .RI "\fILoads a compute module. \fP"
25 .ti -1c
26 .RI "\fBCUresult\fP \fBcuModuleLoadData\fP (\fBCUmodule\fP *phMod, const void *p)"
27 .br
28 .RI "\fILoad a module's data. \fP"
29 .ti -1c
30 .RI "\fBCUresult\fP \fBcuModuleLoadDataEx\fP (\fBCUmodule\fP *phMod, const void *p, unsigned int numOptions, \fBCUjit_option\fP *options, void **optionValues)"
31 .br
32 .RI "\fILoad a module's data with options. \fP"
33 .ti -1c
34 .RI "\fBCUresult\fP \fBcuModuleLoadFatBinary\fP (\fBCUmodule\fP *phMod, const void *vfatCubin)"
35 .br
36 .RI "\fILoad a module's data. \fP"
37 .ti -1c
38 .RI "\fBCUresult\fP \fBcuModuleUnload\fP (\fBCUmodule\fP mod)"
39 .br
40 .RI "\fIUnloads a module. \fP"
41 .in -1c
42 .SH "Detailed Description"
43 .PP 
44 This section describes the module management functions of the low-level CUDA driver application programming interface. 
45 .SH "Function Documentation"
46 .PP 
47 .SS "\fBCUresult\fP cuModuleGetFunction (\fBCUfunction\fP * func, \fBCUmodule\fP mod, const char * name)"
48 .PP
49 Returns in \fC*func\fP the handle of the function of name \fCname\fP located in module \fCmod\fP. If no function of that name exists, \fBcuModuleGetFunction()\fP returns \fBCUDA_ERROR_NOT_FOUND\fP.
50 .PP
51 \fBParameters:\fP
52 .RS 4
53 \fIfunc\fP - Returned function handle 
54 .br
55 \fImod\fP - Module to retrieve function from 
56 .br
57 \fIname\fP - Name of function to retrieve
58 .RE
59 .PP
60 \fBReturns:\fP
61 .RS 4
62 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_NOT_FOUND\fP 
63 .RE
64 .PP
65 \fBNote:\fP
66 .RS 4
67 Note that this function may also return error codes from previous, asynchronous launches.
68 .RE
69 .PP
70 \fBSee also:\fP
71 .RS 4
72 \fBcuModuleGetGlobal\fP, \fBcuModuleGetTexRef\fP, \fBcuModuleLoad\fP, \fBcuModuleLoadData\fP, \fBcuModuleLoadDataEx\fP, \fBcuModuleLoadFatBinary\fP, \fBcuModuleUnload\fP 
73 .RE
74 .PP
75
76 .SS "\fBCUresult\fP cuModuleGetGlobal (\fBCUdeviceptr\fP * ret_dptr, unsigned int * ret_bytes, \fBCUmodule\fP mod, const char * name)"
77 .PP
78 Returns in \fC*ret_dptr\fP and \fC*ret_bytes\fP the base pointer and size of the global of name \fCname\fP located in module \fCmod\fP. If no variable of that name exists, \fBcuModuleGetGlobal()\fP returns \fBCUDA_ERROR_NOT_FOUND\fP. Both parameters \fCret_dptr\fP and \fCret_bytes\fP are optional. If one of them is NULL, it is ignored.
79 .PP
80 \fBParameters:\fP
81 .RS 4
82 \fIret_dptr\fP - Returned global device pointer 
83 .br
84 \fIret_bytes\fP - Returned global size in bytes 
85 .br
86 \fImod\fP - Module to retrieve function from 
87 .br
88 \fIname\fP - Name of global to retrieve
89 .RE
90 .PP
91 \fBReturns:\fP
92 .RS 4
93 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_NOT_FOUND\fP 
94 .RE
95 .PP
96 \fBNote:\fP
97 .RS 4
98 Note that this function may also return error codes from previous, asynchronous launches.
99 .RE
100 .PP
101 \fBSee also:\fP
102 .RS 4
103 \fBcuModuleGetFunction\fP, \fBcuModuleGetTexRef\fP, \fBcuModuleLoad\fP, \fBcuModuleLoadData\fP, \fBcuModuleLoadDataEx\fP, \fBcuModuleLoadFatBinary\fP, \fBcuModuleUnload\fP 
104 .RE
105 .PP
106
107 .SS "\fBCUresult\fP cuModuleGetTexRef (\fBCUtexref\fP * ppTexRef, \fBCUmodule\fP mod, const char * name)"
108 .PP
109 Returns in \fC*ppTexRef\fP the handle of the texture reference of name \fCname\fP in the module \fCmod\fP. If no texture reference of that name exists, \fBcuModuleGetTexRef()\fP returns \fBCUDA_ERROR_NOT_FOUND\fP. This texture reference handle should not be destroyed, since it will be destroyed when the module is unloaded.
110 .PP
111 \fBParameters:\fP
112 .RS 4
113 \fIppTexRef\fP - Returned global device pointer 
114 .br
115 \fImod\fP - Module to retrieve texture-reference from 
116 .br
117 \fIname\fP - Name of texture-reference to retrieve
118 .RE
119 .PP
120 \fBReturns:\fP
121 .RS 4
122 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_NOT_FOUND\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 \fBcuModuleGetFunction\fP, \fBcuModuleGetGlobal\fP, \fBcuModuleLoad\fP, \fBcuModuleLoadData\fP, \fBcuModuleLoadDataEx\fP, \fBcuModuleLoadFatBinary\fP, \fBcuModuleUnload\fP 
133 .RE
134 .PP
135
136 .SS "\fBCUresult\fP cuModuleLoad (\fBCUmodule\fP * phMod, const char * fname)"
137 .PP
138 Takes a filename \fCfname\fP and loads the corresponding module \fCphMod\fP into the current context. The CUDA driver API does not attempt to lazily allocate the resources needed by a module; if the memory for functions and data (constant and global) needed by the module cannot be allocated, \fBcuModuleLoad()\fP fails. The file should be a \fIcubin\fP file as output by \fBnvcc\fP or a \fIPTX\fP file, either as output by \fBnvcc\fP or handwrtten.
139 .PP
140 \fBParameters:\fP
141 .RS 4
142 \fIphMod\fP - Returned module 
143 .br
144 \fIfname\fP - Filename of module to load
145 .RE
146 .PP
147 \fBReturns:\fP
148 .RS 4
149 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_NOT_FOUND\fP, \fBCUDA_ERROR_OUT_OF_MEMORY\fP, \fBCUDA_ERROR_FILE_NOT_FOUND\fP 
150 .RE
151 .PP
152 \fBNote:\fP
153 .RS 4
154 Note that this function may also return error codes from previous, asynchronous launches.
155 .RE
156 .PP
157 \fBSee also:\fP
158 .RS 4
159 \fBcuModuleGetFunction\fP, \fBcuModuleGetGlobal\fP, \fBcuModuleGetTexRef\fP, \fBcuModuleLoadData\fP, \fBcuModuleLoadDataEx\fP, \fBcuModuleLoadFatBinary\fP, \fBcuModuleUnload\fP 
160 .RE
161 .PP
162
163 .SS "\fBCUresult\fP cuModuleLoadData (\fBCUmodule\fP * phMod, const void * p)"
164 .PP
165 Takes a pointer \fCp\fP and loads the corresponding module \fCphMod\fP into the current context. The pointer may be obtained by mapping a \fIcubin\fP or \fIPTX\fP file, passing a \fIcubin\fP or \fIPTX\fP file as a text string, or incorporating a \fIcubin\fP object into the executable resources and using operating system calls such as Windows \fCFindResource()\fP to obtain the pointer.
166 .PP
167 \fBParameters:\fP
168 .RS 4
169 \fIphMod\fP - Returned module 
170 .br
171 \fIp\fP - Module data to load
172 .RE
173 .PP
174 \fBReturns:\fP
175 .RS 4
176 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_OUT_OF_MEMORY\fP 
177 .RE
178 .PP
179 \fBNote:\fP
180 .RS 4
181 Note that this function may also return error codes from previous, asynchronous launches.
182 .RE
183 .PP
184 \fBSee also:\fP
185 .RS 4
186 \fBcuModuleGetFunction\fP, \fBcuModuleGetGlobal\fP, \fBcuModuleGetTexRef\fP, \fBcuModuleLoad\fP, \fBcuModuleLoadDataEx\fP, \fBcuModuleLoadFatBinary\fP, \fBcuModuleUnload\fP 
187 .RE
188 .PP
189
190 .SS "\fBCUresult\fP cuModuleLoadDataEx (\fBCUmodule\fP * phMod, const void * p, unsigned int numOptions, \fBCUjit_option\fP * options, void ** optionValues)"
191 .PP
192 Takes a pointer \fCp\fP and loads the corresponding module \fCphMod\fP into the current context. The pointer may be obtained by mapping a \fIcubin\fP or \fIPTX\fP file, passing a \fIcubin\fP or \fIPTX\fP file as a text string, or incorporating a \fIcubin\fP object into the executable resources and using operating system calls such as Windows \fCFindResource()\fP to obtain the pointer. Options are passed as an array via \fCoptions\fP and any corresponding parameters are passed in \fCoptionValues\fP. The number of total options is supplied via \fCnumOptions\fP. Any outputs will be returned via \fCoptionValues\fP. Supported options are:
193 .PP
194 .IP "\(bu" 2
195 \fBCU_JIT_MAX_REGISTERS\fP: input specifies the maximum number of registers per thread;
196 .IP "\(bu" 2
197 \fBCU_JIT_THREADS_PER_BLOCK\fP: input specifies number of threads per block to target compilation for; output returns the number of threads the compiler actually targeted;
198 .IP "\(bu" 2
199 \fBCU_JIT_WALL_TIME\fP: output returns the float value of wall clock time, in milliseconds, spent compiling the \fIPTX\fP code;
200 .IP "\(bu" 2
201 \fBCU_JIT_INFO_LOG_BUFFER\fP: input is a pointer to a buffer in which to print any informational log messages from \fIPTX\fP assembly;
202 .IP "\(bu" 2
203 \fBCU_JIT_INFO_LOG_BUFFER_SIZE_BYTES\fP: input is the size in bytes of the buffer; output is the number of bytes filled with messages;
204 .IP "\(bu" 2
205 \fBCU_JIT_ERROR_LOG_BUFFER\fP: input is a pointer to a buffer in which to print any error log messages from \fIPTX\fP assembly;
206 .IP "\(bu" 2
207 \fBCU_JIT_ERROR_LOG_BUFFER_SIZE_BYTES\fP: input is the size in bytes of the buffer; output is the number of bytes filled with messages;
208 .IP "\(bu" 2
209 \fBCU_JIT_OPTIMIZATION_LEVEL\fP: input is the level of optimization to apply to generated code (0 - 4), with 4 being the default and highest level;
210 .IP "\(bu" 2
211 \fBCU_JIT_TARGET_FROM_CUCONTEXT\fP: causes compilation target to be determined based on current attached context (default);
212 .IP "\(bu" 2
213 \fBCU_JIT_TARGET\fP: input is the compilation target based on supplied \fBCUjit_target_enum\fP; possible values are:
214 .IP "  \(bu" 4
215 \fBCU_TARGET_COMPUTE_10\fP
216 .IP "  \(bu" 4
217 \fBCU_TARGET_COMPUTE_11\fP
218 .IP "  \(bu" 4
219 \fBCU_TARGET_COMPUTE_12\fP
220 .IP "  \(bu" 4
221 \fBCU_TARGET_COMPUTE_13\fP
222 .PP
223
224 .PP
225 .PP
226 \fBParameters:\fP
227 .RS 4
228 \fIphMod\fP - Returned module 
229 .br
230 \fIp\fP - Module data to load 
231 .br
232 \fInumOptions\fP - Number of options 
233 .br
234 \fIoptions\fP - Options for JIT 
235 .br
236 \fIoptionValues\fP - Option values for JIT
237 .RE
238 .PP
239 \fBReturns:\fP
240 .RS 4
241 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_OUT_OF_MEMORY\fP, \fBCUDA_ERROR_NO_BINARY_FOR_GPU\fP 
242 .RE
243 .PP
244 \fBNote:\fP
245 .RS 4
246 Note that this function may also return error codes from previous, asynchronous launches.
247 .RE
248 .PP
249 \fBSee also:\fP
250 .RS 4
251 \fBcuModuleGetFunction\fP, \fBcuModuleGetGlobal\fP, \fBcuModuleGetTexRef\fP, \fBcuModuleLoad\fP, \fBcuModuleLoadData\fP, \fBcuModuleLoadFatBinary\fP, \fBcuModuleUnload\fP 
252 .RE
253 .PP
254
255 .SS "\fBCUresult\fP cuModuleLoadFatBinary (\fBCUmodule\fP * phMod, const void * vfatCubin)"
256 .PP
257 Takes a pointer \fCvfatCubin\fP and loads the corresponding module \fCphMod\fP into the current context. The pointer represents a \fIfat binary\fP object, which is a collection of different \fIcubin\fP files, all representing the same device code, but compiled and optimized for different architectures. There is currently no documented API for constructing and using fat binary objects by programmers, and therefore this function is an internal function in this version of CUDA. More information can be found in the \fBnvcc\fP document.
258 .PP
259 \fBParameters:\fP
260 .RS 4
261 \fIphMod\fP - Returned module 
262 .br
263 \fIvfatCubin\fP - Fat binary to load
264 .RE
265 .PP
266 \fBReturns:\fP
267 .RS 4
268 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP, \fBCUDA_ERROR_NOT_FOUND\fP, \fBCUDA_ERROR_OUT_OF_MEMORY\fP, \fBCUDA_ERROR_NO_BINARY_FOR_GPU\fP 
269 .RE
270 .PP
271 \fBNote:\fP
272 .RS 4
273 Note that this function may also return error codes from previous, asynchronous launches.
274 .RE
275 .PP
276 \fBSee also:\fP
277 .RS 4
278 \fBcuModuleGetFunction\fP, \fBcuModuleGetGlobal\fP, \fBcuModuleGetTexRef\fP, \fBcuModuleLoad\fP, \fBcuModuleLoadData\fP, \fBcuModuleLoadDataEx\fP, \fBcuModuleUnload\fP 
279 .RE
280 .PP
281
282 .SS "\fBCUresult\fP cuModuleUnload (\fBCUmodule\fP mod)"
283 .PP
284 Unloads a module \fCmod\fP from the current context.
285 .PP
286 \fBParameters:\fP
287 .RS 4
288 \fImod\fP - Module to unload
289 .RE
290 .PP
291 \fBReturns:\fP
292 .RS 4
293 \fBCUDA_SUCCESS\fP, \fBCUDA_ERROR_DEINITIALIZED\fP, \fBCUDA_ERROR_NOT_INITIALIZED\fP, \fBCUDA_ERROR_INVALID_CONTEXT\fP, \fBCUDA_ERROR_INVALID_VALUE\fP 
294 .RE
295 .PP
296 \fBNote:\fP
297 .RS 4
298 Note that this function may also return error codes from previous, asynchronous launches.
299 .RE
300 .PP
301 \fBSee also:\fP
302 .RS 4
303 \fBcuModuleGetFunction\fP, \fBcuModuleGetGlobal\fP, \fBcuModuleGetTexRef\fP, \fBcuModuleLoad\fP, \fBcuModuleLoadData\fP, \fBcuModuleLoadDataEx\fP, \fBcuModuleLoadFatBinary\fP 
304 .RE
305 .PP
306
307 .SH "Author"
308 .PP 
309 Generated automatically by Doxygen for NVIDIA CUDA Library from the source code.