'\" t .\" Title: clGetSupportedImageFormats .\" Author: The Khronos Group .\" Generator: DocBook XSL Stylesheets vsnapshot .\" Date: 01/14/2021 .\" Manual: OpenCL Manual .\" Source: The Khronos Group .\" Language: English .\" .TH "CLGETSUPPORTEDIMAGEF" "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" clGetSupportedImageFormats \- Get the list of image formats supported by an OpenCL implementation\&. .SH "" .HP \w'cl_int\ clGetSupportedImageFormats('u .BI "cl_int clGetSupportedImageFormats(cl_context\ " "context" ", cl_mem_flags\ " "flags" ", cl_mem_object_type\ " "image_type" ", cl_uint\ " "num_entries" ", cl_image_format\ *" "image_formats" ", cl_uint\ *" "num_image_formats" ");" .SH "PARAMETERS" .PP \fI context \fR .RS 4 A valid OpenCL context on which the image object(s) will be created\&. .RE .PP \fI flags \fR .RS 4 A bit\-field that is used to specify allocation and usage information about the image memory object being created and is described in the table below\&. .TS allbox tab(:); lB lB. T{ cl_mem_flags T}:T{ Description T} .T& l l l l l l l l l l l l l l l l l l. T{ \fBCL_MEM_READ_WRITE\fR T}:T{ This flag specifies that the memory object will be read and written by a kernel\&. This is the default\&. T} T{ \fBCL_MEM_WRITE_ONLY\fR T}:T{ This flags specifies that the memory object will be written but not read by a kernel\&. .sp Reading from a buffer or image object created with \fBCL_MEM_WRITE_ONLY\fR inside a kernel is undefined\&. .sp \fBCL_MEM_READ_WRITE\fR and \fBCL_MEM_WRITE_ONLY\fR are mutually exclusive\&. T} T{ \fBCL_MEM_READ_ONLY\fR T}:T{ This flag specifies that the memory object is a read\-only memory object when used inside a kernel\&. .sp Writing to a buffer or image object created with \fBCL_MEM_READ_ONLY\fR inside a kernel is undefined\&. .sp \fBCL_MEM_READ_WRITE\fR or \fBCL_MEM_WRITE_ONLY\fR and \fBCL_MEM_READ_ONLY\fR are mutually exclusive\&. T} T{ \fBCL_MEM_USE_HOST_PTR\fR T}:T{ This flag is valid only if \fIhost_ptr\fR is not NULL\&. If specified, it indicates that the application wants the OpenCL implementation to use memory referenced by \fIhost_ptr\fR as the storage bits for the memory object\&. .sp OpenCL implementations are allowed to cache the buffer contents pointed to by \fIhost_ptr\fR in device memory\&. This cached copy can be used when kernels are executed on a device\&. .sp The result of OpenCL commands that operate on multiple buffer objects created with the same \fIhost_ptr\fR or overlapping host regions is considered to be undefined\&. .sp Refer to the \fBdataTypes\fR(3clc) for \fIhost_ptr\fR for memory objects (buffer and images) created using \fBCL_MEM_USE_HOST_PTR\fR\&. T} T{ \fBCL_MEM_ALLOC_HOST_PTR\fR T}:T{ This flag specifies that the application wants the OpenCL implementation to allocate memory from host accessible memory\&. .sp \fBCL_MEM_ALLOC_HOST_PTR\fR and \fBCL_MEM_USE_HOST_PTR\fR are mutually exclusive\&. T} T{ \fBCL_MEM_COPY_HOST_PTR\fR T}:T{ This flag is valid only if \fIhost_ptr\fR is not NULL\&. If specified, it indicates that the application wants the OpenCL implementation to allocate memory for the memory object and copy the data from memory referenced by \fIhost_ptr\fR\&. .sp \fBCL_MEM_COPY_HOST_PTR\fR and \fBCL_MEM_USE_HOST_PTR\fR are mutually exclusive\&. .sp \fBCL_MEM_COPY_HOST_PTR\fR can be used with \fBCL_MEM_ALLOC_HOST_PTR\fR to initialize the contents of the \fBcl_mem\fR object allocated using host\-accessible (e\&.g\&. PCIe) memory\&. T} T{ \fBCL_MEM_HOST_WRITE_ONLY\fR T}:T{ This flag specifies that the host will only write to the memory object (using OpenCL APIs that enqueue a write or a map for write)\&. This can be used to optimize write access from the host (e\&.g\&. enable write combined allocations for memory objects for devices that communicate with the host over a system bus such as PCIe)\&. T} T{ \fBCL_MEM_HOST_READ_ONLY\fR T}:T{ This flag specifies that the host will only read the memory object (using OpenCL APIs that enqueue a read or a map for read)\&. .sp \fBCL_MEM_HOST_WRITE_ONLY\fR and \fBCL_MEM_HOST_READ_ONLY\fR are mutually exclusive\&. T} T{ \fBCL_MEM_HOST_NO_ACCESS\fR T}:T{ This flag specifies that the host will not read or write the memory object\&. .sp \fBCL_MEM_HOST_WRITE_ONLY\fR or \fBCL_MEM_HOST_READ_ONLY\fR and \fBCL_MEM_HOST_NO_ACCESS\fR are mutually exclusive\&. T} .TE .sp 1 .RE .PP \fI image_type \fR .RS 4 Describes the image type and must be either \fBCL_MEM_OBJECT_IMAGE1D\fR, \fBCL_MEM_OBJECT_IMAGE1D_BUFFER\fR, \fBCL_MEM_OBJECT_IMAGE2D\fR, \fBCL_MEM_OBJECT_IMAGE3D\fR, \fBCL_MEM_OBJECT_IMAGE1D_ARRAY\fR or \fBCL_MEM_OBJECT_IMAGE2D_ARRAY\fR\&. .RE .PP \fI num_entries \fR .RS 4 Specifies the number of entries that can be returned in the memory location given by \fIimage_formats\fR\&. .RE .PP \fI image_formats \fR .RS 4 A pointer to a memory location where the list of supported image formats are returned\&. Each entry describes a \fBcl_image_format\fR(3clc) structure supported by the OpenCL implementation\&. If \fIimage_formats\fR is NULL, it is ignored\&. .RE .PP \fI num_image_formats \fR .RS 4 The actual number of supported image formats for a specific \fIcontext\fR and values specified by \fIflags\fR\&. If \fInum_image_formats\fR is NULL, it is ignored\&. .RE .SH "NOTES" .PP \fBclGetSupportedImageFormats\fR can be used to get the list of image formats supported by an OpenCL implementation when the following information about an image memory object is specified: .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Context .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Image type \- 1D, 2D, or 3D image, 1D image buffer, 1D or 2D image array\&. .RE .sp .RS 4 .ie n \{\ \h'-04'\(bu\h'+03'\c .\} .el \{\ .sp -1 .IP \(bu 2.3 .\} Image object allocation information .RE .PP \fBclGetSupportedImageFormats\fR returns a union of image formats supported by all devices in the context\&. .PP For 2D and 3D image objects, the mandated minimum list of image formats that must be supported by all devices (for reading and writing) that support images is described in the table below: .TS allbox tab(:); lB lB lB. T{ .if n \{\ .RS 4 .\} .nf image_num_channels .fi .if n \{\ .RE .\} T}:T{ .if n \{\ .RS 4 .\} .nf image_channel_order .fi .if n \{\ .RE .\} T}:T{ .if n \{\ .RS 4 .\} .nf image_channel_data_type .fi .if n \{\ .RE .\} T} .T& l l l l l l. T{ .if n \{\ .RS 4 .\} .nf 4 .fi .if n \{\ .RE .\} T}:T{ .if n \{\ .RS 4 .\} .nf CL_RGBA .fi .if n \{\ .RE .\} T}:T{ .if n \{\ .RS 4 .\} .nf CL_UNORM_INT8 CL_UNORM_INT16 CL_SIGNED_INT8 CL_SIGNED_INT16 CL_SIGNED_INT32 CL_UNSIGNED_INT8 CL_UNSIGNED_INT16 CL_UNSIGNED_INT32 CL_HALF_FLOAT CL_FLOAT .fi .if n \{\ .RE .\} .sp T} T{ .if n \{\ .RS 4 .\} .nf 4 .fi .if n \{\ .RE .\} T}:T{ .if n \{\ .RS 4 .\} .nf CL_BGRA .fi .if n \{\ .RE .\} T}:T{ .if n \{\ .RS 4 .\} .nf CL_UNORM_INT8 .fi .if n \{\ .RE .\} T} .TE .sp 1 .PP If \fBCL_DEVICE_IMAGE_SUPPORT\fR specified in the table of OpenCL Device Queries for \fBclGetDeviceInfo\fR(3clc) is \fBCL_TRUE\fR, the values assigned to \fBCL_DEVICE_MAX_READ_IMAGE_ARGS\fR, \fBCL_DEVICE_MAX_WRITE_IMAGE_ARGS\fR, \fBCL_DEVICE_IMAGE2D_MAX_WIDTH\fR, \fBCL_DEVICE_IMAGE2D_MAX_HEIGHT\fR, \fBCL_DEVICE_IMAGE3D_MAX_WIDTH\fR, \fBCL_DEVICE_IMAGE3D_MAX_HEIGHT\fR, \fBCL_DEVICE_IMAGE3D_MAX_DEPTH\fR, and \fBCL_DEVICE_MAX_SAMPLERS\fR by the implementation must be greater than or equal to the minimum values specified in the table of allowed values for \fIparam_name\fR for \fBclGetDeviceInfo\fR(3clc) .SH "ERRORS" .PP Returns CL_SUCCESS if the function is executed successfully\&. Otherwise, it returns a NULL value with 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_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 \fIflags\fR or \fIimage_type\fR are not valid, or if \fInum_entries\fR is 0 and \fIimage_formats\fR is not NULL\&. .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 \fBcl_image_format\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 96, section 5.3.2 - Querying List of Supported Image Formats .RE