'\" t .\" Title: clGetMemObjectInfo .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLGETMEMOBJECTINFO" "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" clGetMemObjectInfo \- Get information that is common to all memory objects (buffer and image objects)\&. .SH "" .HP \w'cl_int\ clGetMemObjectInfo('u .BI "cl_int clGetMemObjectInfo(cl_mem\ " "memobj" ", cl_mem_info\ " "param_name" ", size_t\ " "param_value_size" ", void\ *" "param_value" ", size_t\ *" "param_value_size_ret" ");" .SH "PARAMETERS" .PP \fI memobj \fR .RS 4 Specifies the memory object being queried\&. .RE .PP \fI param_name \fR .RS 4 Specifies the information to query\&. The list of supported \fIparam_name\fR types and the information returned in \fIparam_value\fR by \fBclGetMemObjectInfo\fR is described in the table below\&. .TS allbox tab(:); lB lB lB. T{ cl_mem_info T}:T{ Return Type T}:T{ Info\&. returned in \fIparam_value\fR T} .T& l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l l. T{ \fBCL_MEM_TYPE\fR T}:T{ cl_mem_object_type T}:T{ Returns one of the following values: \fBCL_MEM_OBJECT_BUFFER\fR if \fImemobj\fR is created with \fBclCreateBuffer\fR(3clc) or \fBclCreateSubBuffer\fR(3clc)\&. .sp cl_image_desc\&.image_type argument value if \fImemobj\fR is created with \fBclCreateImage\fR(3clc)\&. T} T{ \fBCL_MEM_FLAGS\fR T}:T{ cl_mem_flags T}:T{ Returns the \fIflags\fR argument value specified when \fImemobj\fR is created with \fBclCreateBuffer\fR(3clc), \fBclCreateSubBuffer\fR(3clc), or \fBclCreateImage\fR(3clc)\&. If \fImemobj\fR is a sub\-buffer the memory access qualifiers inherited from parent buffer is also returned T} T{ \fBCL_MEM_SIZE\fR T}:T{ size_t T}:T{ Return actual size of the data store associated with \fImemobj\fR in bytes\&. T} T{ \fBCL_MEM_HOST_PTR\fR T}:T{ void * T}:T{ If \fImemobj\fR is created with \fBclCreateBuffer\fR(3clc) or \fBclCreateImage\fR(3clc) and \fBCL_MEM_USE_HOST_PTR\fR is specified in \fImem_flags\fR, return the \fIhost_ptr\fR argument value specified when \fImemobj\fR is created\&. Otherwise a NULL value is returned\&. .sp If \fImemobj\fR is created with \fBclCreateSubBuffer\fR(3clc), return the \fIhost_ptr\fR + \fIorigin\fR value specified when \fImemobj\fR is created\&. \fIhost_ptr\fR is the argument value specified to \fBclCreateBuffer\fR(3clc) and \fBCL_MEM_USE_HOST_PTR\fR is specified in \fImem_flags\fR for memory object from which \fImemobj\fR is created\&. Otherwise a NULL value is returned\&. T} T{ \fBCL_MEM_MAP_COUNT\fR T}:T{ cl_uint T}:T{ Map count\&. The map count returned should be considered immediately stale\&. It is unsuitable for general use in applications\&. This feature is provided for debugging\&. T} T{ \fBCL_MEM_REFERENCE_COUNT\fR T}:T{ cl_uint T}:T{ Return \fImemobj\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_MEM_CONTEXT\fR T}:T{ cl_context T}:T{ Return context specified when memory object is created\&. If \fImemobj\fR is created using \fBclCreateSubBuffer\fR(3clc), the context associated with the memory object specified as the \fIbuffer\fR argument to \fBclCreateSubBuffer\fR(3clc) is returned\&. T} T{ \fBCL_MEM_ASSOCIATED_\- MEMOBJECT\fR T}:T{ cl_mem T}:T{ Return memory object from which \fImemobj\fR is created\&. This returns the memory object specified as \fIbuffer\fR argument to \fBclCreateSubBuffer\fR(3clc)\&. .sp Otherwise a NULL value is returned\&. T} T{ \fBCL_MEM_OFFSET\fR T}:T{ size_t T}:T{ Return offset if \fImemobj\fR is a sub\-buffer object created using \fBclCreateSubBuffer\fR(3clc)\&. This returns 0 if \fImemobj\fR is not a subbuffer object\&. T} T{ \fBCL_MEM_D3D10_RESOURCE_KHR\fR T}:T{ ID3D10Resource * T}:T{ The property being queried (if the \fBcl_khr_d3d10_sharing\fR(3clc) extension is enabled)\&. If \fImemobj\fR was created using \fBclCreateFromD3D10BufferKHR\fR(3clc), \fBclCreateFromD3D10Texture2DKHR\fR(3clc), or \fBclCreateFromD3D10Texture3DKHR\fR(3clc), returns the \fIresource\fR argument specified when \fImemobj\fR was created\&. T} T{ \fBCL_MEM_DX9_MEDIA_\- ADAPTER_TYPE_KHR\fR T}:T{ cl_dx9_media_\- adapter_type_khr T}:T{ Returns the \fBcl_dx9_media_adapter_type_khr\fR argument value specified when \fImemobj\fR is created using \fBclCreateFromDX9MediaSurfaceKHR\fR(3clc) (If the \fBcl_khr_dx9_media_sharing\fR(3clc) extension is supported) T} T{ \fBCL_MEM_DX9_MEDIA_\- SURFACE_INFO_KHR\fR T}:T{ cl_dx9_\- surface_info_khr T}:T{ Returns the cl_dx9_surface_info_khr argument value specified when \fImemobj\fR is created using \fBclCreateFromDX9MediaSurfaceKHR\fR(3clc) (If the \fBcl_khr_dx9_media_sharing\fR(3clc) extension is supported) T} T{ \fBCL_MEM_D3D11_RESOURCE_KHR\fR T}:T{ ID3D11Resource * T}:T{ If the cl_khr_d3d11_sharing extension is supported, If \fImemobj\fR was created using \fBclCreateFromD3D11BufferKHR\fR(3clc), \fBclCreateFromD3D11Texture2DKHR\fR(3clc), or \fBclCreateFromD3D11Texture3DKHR\fR(3clc), returns the \fIresource\fR argument specified when \fImemobj\fR was created\&. T} .TE .sp 1 .RE .PP \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 param_value_size \fR .RS 4 Used to specify the size in bytes of memory pointed to by \fIparam_value\fR\&. This size must be ≥ size of return type as described in the table above\&. .RE .PP \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 is executed successfully\&. Otherwise, it returns one of the following errors: .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 valid, or if size in bytes specified by \fIparam_value_size\fR is < the size of return type as described in the table above and \fIparam_value\fR is not NULL\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_MEM_OBJECT if \fImemobj\fR is a not a valid memory object\&. .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 .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_D3D10_RESOURCE_KHR If the \fBcl_khr_d3d10_sharing\fR(3clc) extension is enabled and if \fIparam_name\fR is \fBCL_MEM_D3D10_RESOURCE_KHR\fR and \fImemobj\fR was not created by the function \fBclCreateFromD3D10BufferKHR\fR(3clc), \fBclCreateFromD3D10Texture2DKHR\fR(3clc), or \fBclCreateFromD3D10Texture3DKHR\fR(3clc)\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_DX9_MEDIA_SURFACE_KHR if \fIparam_name\fR is \fBCL_MEM_DX9_MEDIA_SURFACE_INFO_KHR\fR and \fImemobj\fR was not created by the function \fBclCreateFromDX9MediaSurfaceKHR\fR(3clc) from a Direct3D9 surface\&. (If the \fBcl_khr_dx9_media_sharing\fR(3clc) extension is supported) .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} CL_INVALID_D3D11_RESOURCE_KHR If the cl_khr_d3d11_sharing extension is supported, if \fIparam_name\fR is \fBCL_MEM_D3D11_RESOURCE_KHR\fR and \fImemobj\fR was not created by the function \fBclCreateFromD3D11BufferKHR\fR(3clc), \fBclCreateFromD3D11Texture2DKHR\fR(3clc), or \fBclCreateFromD3D11Texture3DKHR\fR(3clc)\&." .RE .SH "SPECIFICATION" .PP \m[blue]\fBOpenCL Specification\fR\m[]\&\s-2\u[1]\d\s+2 .SH "SEE ALSO" .PP \fBclGetImageInfo\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 125, section 5.4.5 - Memory Object Queries .RE