Description

OpenCL extensions approved by the OpenCL working group use the following naming convention:

  • A unique name string of the form cl_khr_<name> or cl_ext_<name> is associated with each extension. If the extension is supported by an implementation, this string will be present in the implementation’s CL_PLATFORM_EXTENSIONS string or CL_DEVICE_EXTENSIONS string.

  • All enumerants defined by the extension will have names of the form CL_<enum_name>_KHR or CL_<enum_name>_EXT.

  • All types defined by the extension will have names of the form cl_<type_name>_khr or cl_<type_name>_ext.

  • All API functions defined by the extension will have names of the form cl<function_name>KHR or cl<function_name>EXT.

Functions and enumerants defined by extensions that are promoted to core features will have their KHR or EXT affix removed. OpenCL implementations of such later revisions must also export the name strings of promoted extensions in the CL_PLATFORM_EXTENSIONS or CL_DEVICE_EXTENSIONS string, and support the KHR- or EXT-affixed versions of functions and enumerants as a transition aid.

Vendor extensions are strongly encouraged to follow a similar naming convention:

  • A unique name string of the form cl_<vendor_tag>_<name> is associated with each extension. If the extension is supported by an implementation, this string will be present in the implementation’s CL_PLATFORM_EXTENSIONS string or CL_DEVICE_EXTENSIONS string.

  • All enumerants defined by the vendor extension should have names of the form CL_<enum_name>_<VENDOR_TAG>.

  • All types defined by the vendor extension should have names of the form cl_<type_name>_<vendor_tag>.

  • All API functions defined by the vendor extension should have names of the form cl<function_name><VENDOR_TAG>.

  • All OpenCL C functions, types, and attribute qualifiers defined by the vendor extension should have names of the form <vendor_tag>_<name>.

Vendor extensions are not currently included in the OpenCL specifications, but vendor extension specifications are frequently included in the online Registry of extensions.

See Also

No cross-references are available

Document Notes

For more information, see the OpenCL Specification

This page is extracted from the OpenCL Specification. Fixes and changes should be made to the Specification, not directly.

Copyright 2014-2026 The Khronos Group Inc.

SPDX-License-Identifier: CC-BY-4.0