'\" t .\" Title: clGetContextInfo .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLGETCONTEXTINFO" "3clc" "01/14/2021" "The Khronos Group" "OpenCL Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" clGetContextInfo \- Query information about a context\&. .SH "" .HP \w'cl_int\ clGetContextInfo('u .BI "cl_int clGetContextInfo(cl_context\ " "context" ", cl_context_info\ " "param_name" ", size_t\ " "param_value_size" ", void\ *" "param_value" ", size_t\ *" "param_value_size_ret" ");" .SH "PARAMETERS" .PP \fIcontext \fR .RS 4 Specifies the OpenCL context being queried\&. .RE .PP \fI param_name \fR .RS 4 An enumeration constant that specifies the information to query\&. The valid values for \fIparam_name\fR are: .TS allbox tab(:); lB lB lB. T{ cl_context_info T}:T{ Return Type T}:T{ Information returned in param_value T} .T& l l l l l l l l l l l l l l l l l l. T{ \fBCL_CONTEXT_REFERENCE_COUNT\fR T}:T{ cl_uint T}:T{ Return the \fIcontext\fR reference count\&. The reference count returned should be considered immediately stale\&. It is unsuitable for general use in applications\&. This feature is provided for identifying memory leaks\&. T} T{ \fBCL_CONTEXT_NUM_DEVICES\fR T}:T{ cl_uint T}:T{ Return the number of devices in \fIcontext\fR\&. T} T{ \fBCL_CONTEXT_DEVICES\fR T}:T{ cl_device_id[] T}:T{ Return the list of devices in \fIcontext\fR\&. T} T{ \fBCL_CONTEXT_PROPERTIES\fR T}:T{ cl_context_\- properties[] T}:T{ Return the \fIproperties\fR argument specified in \fBclCreateContext\fR(3clc) or \fBclCreateContextFromType\fR(3clc)\&. If the \fIproperties\fR argument specified in \fBclCreateContext\fR(3clc) or \fBclCreateContextFromType\fR(3clc) used to create \fIcontext\fR is not NULL, the implementation must return the values specified in the \fIproperties\fR argument\&. .sp If the \fIproperties\fR argument specified in \fBclCreateContext\fR(3clc) or \fBclCreateContextFromType\fR(3clc) used to create \fIcontext\fR is NULL, the implementation may return either a \fIparam_value_size_ret\fR of 0, i\&.e\&. there is no context property value to be returned or can return a context property value of 0 (where 0 is used to terminate the context properties list) in the memory that \fIparam_value\fR points to\&. T} T{ \fBCL_CONTEXT_D3D10_PREFER_\- SHARED_RESOURCES_KHR\fR T}:T{ cl_bool T}:T{ If the \fBcl_khr_d3d10_sharing\fR(3clc) extension is enabled, returns CL_TRUE if Direct3D 10 resources created as shared by setting \fIMiscFlags\fR to include \fBD3D10_RESOURCE_MISC_SHARED\fR will perform faster when shared with OpenCL, compared with resources which have not set this flag\&. Otherwise returns \fBCL_FALSE\fR\&. T} T{ \fBCL_CONTEXT_D3D11_PREFER_\- SHARED_RESOURCES_KHR\fR T}:T{ cl_bool T}:T{ If the cl_khr_d3d11_sharing extension is supported, Returns \fBCL_TRUE\fR if Direct3D 11 resources created as shared by setting \fIMiscFlags\fR to include \fBD3D11_RESOURCE_MISC_SHARED\fR will perform faster when shared with OpenCL, compared with resources which have not set this flag\&. Otherwise returns \fBCL_FALSE\fR\&. T} .TE .sp 1 .RE .PP \fI \fR\fI\fR\fI param_value \fR .RS 4 A pointer to memory where the appropriate result being queried is returned\&. If \fIparam_value\fR is NULL, it is ignored\&. .RE .PP \fI \fR\fI\fR\fI param_value_size \fR .RS 4 Specifies the size in bytes of memory pointed to by \fIparam_value\fR\&. This size must be greater than or equal to the size of return type as described in the table above\&. .RE .PP \fI \fR\fI\fR\fI param_value_size_ret \fR .RS 4 Returns the actual size in bytes of data being queried by \fIparam_value\fR\&. If \fIparam_value_size_ret\fR is NULL, it is ignored\&. .RE .SH "ERRORS" .PP Returns CL_SUCCESS if the function executed successfully, or one of the errors below: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_CONTEXT if \fIcontext\fR is not a valid context\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_VALUE if \fIparam_name\fR is not one of the supported values or if size in bytes specified by \fIparam_value_size\fR is < size of return type as specified in the table above and \fIparam_value\fR is not a NULL value\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_RESOURCES if there is a failure to allocate resources required by the OpenCL implementation on the device\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_OUT_OF_HOST_MEMORY if there is a failure to allocate resources required by the OpenCL implementation on the host\&. .RE .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclGetDeviceInfo\fR(3clc) .SH "AUTHORS" .PP \fBThe Khronos Group\fR .SH "COPYRIGHT" .br Copyright \(co 2007-2011 The Khronos Group Inc. .br Permission is hereby granted, free of charge, to any person obtaining a copy of this software and/or associated documentation files (the "Materials"), to deal in the Materials without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Materials, and to permit persons to whom the Materials are furnished to do so, subject to the condition that this copyright notice and permission notice shall be included in all copies or substantial portions of the Materials. .sp .SH "NOTES" .IP " 1." 4 OpenCL Specification .RS 4 \%page 58, section 4.4 - Contexts .RE