* Add CMake Packaging + CI For Package * Uniform formatting * Explicit compiler detection * Simplify exported target name * Changed include dir to SYSTEM BEFORE * Remove travis * Initial Github Actions yaml * Fix CWD * Remove CWD from YAML * MSVC warning flags * Fix CWD for CTest invocations * Relative CWD * runner.workspace * enable tests in build * Move to C flags * Enable testing in CI * GCC warnings * Don't meddle with compiler flags in CMake * C2059: syntax error: 'bad suffix on number' * C4001: nonstd ext 'single line comment' was used * /wd4001 * /wd4001 again * Remove Za builds of cl_icd_h.c * Fix oeprator precedence * Refrain from altering global state * Add C_STANDARD to GCC build * Add 32-bit and 64-bit matrix dims * Change -march to -m * Try adding host * install gcc-multilib * Add GCC 8 & 9 multilib * Install GCC multilib conditionally * Add note on Windows C versions incoming * Add INCRMENTAL to silence notice on full link * Experiment with disabling * Initial MacOS config * Add ninja to MacOS build * Fix nproc * nproc -> sysctl * Xcode * cmd -> bash * which gcc-9 * Actual GCC invocation * Check gcc if symlink * follow link * Obtain env * Cleanup * Re-enable Windows and Linux * Check pkgconfig * Syntax fix * INSTALL_PREFIX to PREFIX_PATH * Use CONFIG * Added bare and SDK consumption * Fix bare target * Fix test for unsued variable * Add missing semi-colons * Rework SDK emulation * Fix indentation * Fix build path for SDK consumption * Add Windows consumption test * MacOS * Fix indentation * Enable MacOS * CMAKE_INSTALL_PREFIX >> CMAKE_PREFIX_PATH * Fix install * Install Release on Windows * Re-enable Linux and Windows * Added C99 builds * Removed pkgconfig.c duplication * Fix out-of-sync target in readme * Added policy to make readme sample work * match up paths in readme samples * Homogenize target names * Remove all warnings from sample readme Co-authored-by: sL1pKn07 <sl1pkn07@gmail.com>
2.1 KiB
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.