{"id":27940493,"url":"https://github.com/khronosgroup/opencl-headers","last_synced_at":"2025-05-14T22:08:21.703Z","repository":{"id":2992772,"uuid":"47572476","full_name":"KhronosGroup/OpenCL-Headers","owner":"KhronosGroup","description":"Khronos OpenCL-Headers","archived":false,"fork":false,"pushed_at":"2025-05-06T16:37:01.000Z","size":819,"stargazers_count":705,"open_issues_count":45,"forks_count":252,"subscribers_count":74,"default_branch":"main","last_synced_at":"2025-05-14T22:08:15.205Z","etag":null,"topics":["opencl"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KhronosGroup.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2015-12-07T18:54:52.000Z","updated_at":"2025-05-06T16:37:06.000Z","dependencies_parsed_at":"2023-07-06T07:28:39.571Z","dependency_job_id":"b5a88d87-71b3-4b3a-9eb6-0f3c4ae457f8","html_url":"https://github.com/KhronosGroup/OpenCL-Headers","commit_stats":{"total_commits":242,"total_committers":50,"mean_commits":4.84,"dds":0.7644628099173554,"last_synced_commit":"1080743ea047d6467bc609f979a21f00e06ac928"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-Headers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-Headers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-Headers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-Headers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhronosGroup","download_url":"https://codeload.github.com/KhronosGroup/OpenCL-Headers/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254235700,"owners_count":22036964,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opencl"],"created_at":"2025-05-07T10:17:09.815Z","updated_at":"2025-05-14T22:08:16.692Z","avatar_url":"https://github.com/KhronosGroup.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenCL\u003csup\u003eTM\u003c/sup\u003e API Headers\n\nThis repository contains C language headers for the OpenCL API.\n\nThe authoritative public repository for these headers is located at:\n\nhttps://github.com/KhronosGroup/OpenCL-Headers\n\nIssues, proposed fixes for issues, and other suggested changes should be\ncreated using Github.\n\n## Build instructions\n\n\u003e While the OpenCL Headers can be built and installed in isolation, it is part of the [OpenCL SDK](https://github.com/KhronosGroup/OpenCL-SDK). If looking for streamlined build experience and a complete development package, refer to the SDK build instructions instead of the following guide.\n\n### Dependencies\n\n- The OpenCL Headers CMake package support uses CMake for its build system.\nIf CMake is not provided by your build system or OS package manager, please consult the [CMake website](https://cmake.org).\n\n### Example Build\nWhile the headers may just be copied as-is, this repository also contains a\nCMake script with an install rule to allow for packaging the headers.\n\n```bash\ncmake -S . -B build -DCMAKE_INSTALL_PREFIX=/chosen/install/prefix\ncmake --build build --target install\n```\n \n### Example Use\n\nExample CMake invocation\n\n```bash\ncmake -D CMAKE_PREFIX_PATH=/chosen/install/prefix /path/to/opencl/app \n```\n\nand sample `CMakeLists.txt`\n\n```cmake\ncmake_minimum_required(VERSION 3.0)\ncmake_policy(VERSION 3.0...3.18.4)\nproject(proj)\nadd_executable(app main.cpp)\nfind_package(OpenCLHeaders REQUIRED)\ntarget_link_libraries(app PRIVATE OpenCL::Headers)\n```\n\n## Branch Structure\n\nThe OpenCL API headers in this repository are Unified headers and are designed\nto work with all released OpenCL versions. This differs from previous OpenCL\nAPI headers, where version-specific API headers either existed in separate\nbranches, or in separate folders in a branch.\n\n## Compiling for a Specific OpenCL Version\n\nBy default, the OpenCL API headers in this repository are for the latest\nOpenCL version (currently OpenCL 3.0).  To use these API headers to target\na different OpenCL version, an application may `#define` the preprocessor\nvalue `CL_TARGET_OPENCL_VERSION` before including the OpenCL API headers.\nThe `CL_TARGET_OPENCL_VERSION` is a three digit decimal value representing\nthe OpenCL API version.\n\nFor example, to enforce usage of no more than the OpenCL 1.2 APIs, you may\ninclude the OpenCL API headers as follows:\n\n```c\n#define CL_TARGET_OPENCL_VERSION 120\n#include \u003cCL/opencl.h\u003e\n```\n\n## Controlling Function Prototypes\n\nBy default, the OpenCL API headers in this repository declare function\nprototypes for every known core OpenCL API and OpenCL extension API.  If this is\nnot desired, the declared function prototypes can be controlled by the following\npreprocessor defines:\n\n* `CL_NO_PROTOTYPES`: No function prototypes will be declared.  This control\n  applies to core OpenCL APIs and OpenCL extension APIs.\n* `CL_NO_CORE_PROTOTYPES`: No function prototypes will be declared for core\n  OpenCL APIs.  \n* `CL_NO_EXTENSION_PROTOTYPES`: No function prototypes will be declared for\n  OpenCL extension APIs.  This control applies to all OpenCL extension APIs.\n* `CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES`: No function prototypes will be\n  declared for OpenCL extension APIs that are in the ICD dispatch table for\n  historical reasons.\n* `CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES`: No function prototypes will be\n  declared for OpenCL extension APIs that are not in the ICD dispatch table.\n\nFor example, to declare function prototypes for core OpenCL 3.0 APIs only, you\nmay include the OpenCL API headers as follows:\n\n```c\n#define CL_TARGET_OPENCL_VERSION 300\n#define CL_NO_EXTENSION_PROTOTYPES\n#include \u003cCL/opencl.h\u003e\n```\n\n## Compatibility Notes\n\nOpenCL values backward compatibility and in most cases an application using an\nolder version of the OpenCL API headers can seamlessly update to a newer version\nof the OpenCL API headers.  In rare cases, though, the OpenCL API headers may\nbreak backward compatibility:\n\n* Very rarely, there may be bugs or other issues in the OpenCL API headers that\n  cannot be fixed without breaking compatibility.\n* The OpenCL API headers for beta features or beta extensions may\n  be changed in a way that breaks compatibility.\n\nApplications or libraries that require stable OpenCL API headers are encouraged\nto use tagged or released OpenCL API headers.  We will do our best to document\nany breaking changes in the description of each release.  The OpenCL API headers\nare tagged at least as often as each OpenCL specification release.\n\n## Beta Extensions\n\nBeta extensions are extensions that are still in development and are\nhence subject to change. To further improve compatibility for applications that\ndo not use beta features, support for beta extensions must be\nexplicitly enabled.  Support for beta extensions is controlled by the\n`CL_ENABLE_BETA_EXTENSIONS` preprocessor define.\n\nFor example, to enable support for OpenCL 3.0 APIs and all extensions, including\nbeta extensions, you may include the OpenCL API headers as follows:\n\n```c\n#define CL_TARGET_OPENCL_VERSION 300\n#define CL_ENABLE_BETA_EXTENSIONS\n#include \u003cCL/opencl.h\u003e\n```\n\n## Directory Structure\n\n```\nREADME.md               This file\nLICENSE                 Source license for the OpenCL API headers\nCL/                     Unified OpenCL API headers tree\nscripts/                Scripts for generating OpenCL extension headers\ntests/                  OpenCL API header tests\n```\n\n## Packaging\n\nFor packaging instructions, see [RELEASE.md](https://github.com/KhronosGroup/OpenCL-SDK/blob/main/docs/RELEASE.md)\nin the OpenCL SDK repository.\n\n## License\n\nSee [LICENSE](LICENSE).\n\n---\n\nOpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fopencl-headers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhronosgroup%2Fopencl-headers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fopencl-headers/lists"}