Go to file
openharmony_ci 4e38bf513d
!24 回退 'Pull Request !23 : opencl-headers修正子系统名'
Merge pull request !24 from openharmony_ci/revert-merge-23-master
2023-06-19 02:43:58 +00:00
.github/workflows re-enable format string warning in CI 2020-12-09 11:53:44 -05:00
CL fix origin argument names for rect functions 2020-12-09 11:52:47 -05:00
include add wrapper 2022-08-31 17:51:26 +08:00
src 预处理指令规范 2023-05-16 16:42:42 +08:00
tests 部件化整改,修改part_name 2023-04-23 14:40:33 +08:00
BUILD.gn 回退 'Pull Request !23 : opencl-headers修正子系统名' 2023-06-19 02:43:39 +00:00
CMakeLists.txt Comprehensive CMake Package Config support (#107) 2020-11-24 19:18:58 +01:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2018-10-10 15:50:24 -04:00
LICENSE Change license to Apache 2.0 (#76) 2020-03-25 00:52:39 -07:00
OAT.xml fix license bug 2022-09-22 15:37:15 +08:00
README_zh.md add wrapper 2022-08-31 17:51:26 +08:00
README.md Comprehensive CMake Package Config support (#107) 2020-11-24 19:18:58 +01:00
README.OpenSource add README.OpenSource 2022-03-24 06:27:07 -07:00

OpenCLTM API Headers

This repository contains C language headers for the OpenCL API.

The authoritative public repository for these headers is located at:

https://github.com/KhronosGroup/OpenCL-Headers

Issues, proposed fixes for issues, and other suggested changes should be created using Github.

CMake Package

While the headers may just be copied as-is, this repository also contains a CMake script with an install rule to allow for packaging the headers.

cmake -S . -B build -DCMAKE_INSTALL_PREFIX=/chosen/install/prefix
cmake --build build --target install

To consume the package:

cmake path/to/opencl/app -DOpenCLHeaders_ROOT=/chosen/install/prefix
cmake_minimum_required(VERSION 3.0)
cmake_policy(VERSION 3.0...3.18.4)
project(proj)
add_executable(app main.cpp)
find_package(OpenCLHeaders REQUIRED)
target_link_libraries(app PRIVATE OpenCL::Headers)

Branch Structure

The OpenCL API headers in this repository are Unified headers and are designed to work with all released OpenCL versions. This differs from previous OpenCL API headers, where version-specific API headers either existed in separate branches, or in separate folders in a branch.

Compiling for a Specific OpenCL Version

By default, the OpenCL API headers in this repository are for the latest OpenCL version (currently OpenCL 2.2). To use these API headers to target a different OpenCL version, an application may #define the preprocessor value CL_TARGET_OPENCL_VERSION before including the OpenCL API headers. The CL_TARGET_OPENCL_VERSION is a three digit decimal value representing the OpenCL API version.

For example, to enforce usage of no more than the OpenCL 1.2 APIs, you may include the OpenCL API headers as follows:

#define CL_TARGET_OPENCL_VERSION 120
#include <CL/opencl.h>

Directory Structure

README.md               This file
LICENSE                 Source license for the OpenCL API headers
CL/                     Unified OpenCL API headers tree

License

See LICENSE.


OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.