{"id":27940548,"url":"https://github.com/khronosgroup/opencl-clhpp","last_synced_at":"2025-05-15T13:07:28.338Z","repository":{"id":41322204,"uuid":"47572511","full_name":"KhronosGroup/OpenCL-CLHPP","owner":"KhronosGroup","description":"Khronos OpenCL-CLHPP ","archived":false,"fork":false,"pushed_at":"2025-04-01T16:32:46.000Z","size":7442,"stargazers_count":397,"open_issues_count":60,"forks_count":132,"subscribers_count":50,"default_branch":"main","last_synced_at":"2025-05-15T13:07:25.481Z","etag":null,"topics":[],"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.txt","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:55:31.000Z","updated_at":"2025-04-04T03:12:38.000Z","dependencies_parsed_at":"2022-09-16T04:10:20.954Z","dependency_job_id":"380ca1a2-78d1-4f12-a7c6-3220deace450","html_url":"https://github.com/KhronosGroup/OpenCL-CLHPP","commit_stats":{"total_commits":369,"total_committers":49,"mean_commits":7.530612244897959,"dds":0.8157181571815718,"last_synced_commit":"039e13b0701ab801f83ebac1a8e67cd3b8827847"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-CLHPP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-CLHPP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-CLHPP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-CLHPP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhronosGroup","download_url":"https://codeload.github.com/KhronosGroup/OpenCL-CLHPP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"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":[],"created_at":"2025-05-07T10:18:11.152Z","updated_at":"2025-05-15T13:07:26.425Z","avatar_url":"https://github.com/KhronosGroup.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenCL\u003csup\u003eTM\u003c/sup\u003e API C++ bindings\r\n\r\nDoxgen documentation for the bindings is available here:\r\n\r\n  http://khronosgroup.github.io/OpenCL-CLHPP/\r\n\r\nComponents:\r\n\r\n  * `include/CL/opencl.hpp`:\r\n    The latest, maintained, version of the C++ bindings. It should work with all\r\n    versions of OpenCL (including 1.x). This is what most users will want.\r\n\r\n  * `include/CL/cl2.hpp`:\r\n    Includes `opencl.hpp` and emits a warning, for backwards compability.\r\n\r\n  * `docs`:\r\n    Doxygen file used to generate HTML documentation for `opencl.hpp`.\r\n\r\n  * `examples`:\r\n    A simple example application using the very basic features of the bindings.\r\n\r\n  * `tests`:\r\n    A (very small, incomplete) set of regression tests. Building the tests\r\n    requires Python, Ruby, and CMock. For the last one we use\r\n    [CMock top-of-tree from Github](https://github.com/ThrowTheSwitch/CMock),\r\n    as the latest (at the time this was written) released CMock version,\r\n    v2.5.3, has some issues.\r\n\r\n  * `CMakeLists.txt`:\r\n    Build system for the examples and tests and logic for the bindings\r\n    installation.\r\n\r\n## Build Instructions\r\n\r\n\u003e While the C++ 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.\r\n\r\n### Dependencies\r\n\r\nThe C++ Headers require:\r\n\r\n- the [OpenCL Headers](https://github.com/KhronosGroup/OpenCL-Headers/).\r\n  - It is recommended to install the headers via CMake, however a convenience shorthand is provided. Providing `OPENCL_CLHPP_HEADERS_DIR` to CMake, one may specify the location of OpenCL Headers. By default, the C++ Headers will look for OpenCL Headers under `${OPENCL_DIST_DIR}/include`.\r\n- the [OpenCL-ICD-Loader](https://github.com/KhronosGroup/OpenCL-ICD-Loader/) when building the examples\r\n  - It is recommended to install the ICD loader via CMake, however a convenience shorthand is provided. Providing `OPENCL_CLHPP_LOADER_DIR` to CMake, one may specify the location of the OpenCL ICD loader. By default, the C++ headers will look for OpenCL ICD loader under `${OPENCL_DIST_DIR}/lib`.\r\n- The C++ Headers uses CMake for its build system.\r\nIf CMake is not provided by your build system or OS package manager, please consult the [CMake website](https://cmake.org).\r\n- The unit tests require [CMock](https://github.com/ThrowTheSwitch/CMock). To get this external dependency, use `--recursive` when cloning\r\nthe repository, or run `git submodule update --init --recursive`.\r\n- Generating the mock input requires [Ruby](https://www.ruby-lang.org/en/).\r\n- Generating the docs requires Doxygen. When it is available, you can generate HTML documentation by building the `docs` target.\r\n\r\n### Example Build\r\n\r\n1. Clone this repo, the OpenCL ICD Loader and the OpenCL Headers:\r\n\r\n        git clone --recursive https://github.com/KhronosGroup/OpenCL-CLHPP\r\n        git clone https://github.com/KhronosGroup/OpenCL-ICD-Loader\r\n        git clone https://github.com/KhronosGroup/OpenCL-Headers\r\n\r\n1. Install OpenCL Headers CMake package\r\n\r\n        cmake -D CMAKE_INSTALL_PREFIX=./OpenCL-Headers/install -S ./OpenCL-Headers -B ./OpenCL-Headers/build \r\n        cmake --build ./OpenCL-Headers/build --target install\r\n\r\n1. Build and install OpenCL ICD Loader CMake package. _(Note that `CMAKE_PREFIX_PATH` need to be an absolute path. Update as needed.)_\r\n\r\n        cmake -D CMAKE_PREFIX_PATH=/absolute/path/to/OpenCL-Headers/install -D CMAKE_INSTALL_PREFIX=./OpenCL-ICD-Loader/install -S ./OpenCL-ICD-Loader -B ./OpenCL-ICD-Loader/build \r\n        cmake --build ./OpenCL-ICD-Loader/build --target install\r\n\r\n1. Build and install OpenCL C++ Headers CMake package.\r\n\r\n        cmake -D CMAKE_PREFIX_PATH=\"/absolute/path/to/OpenCL-Headers/install;/absolute/path/to/OpenCL-ICD-Loader/install\" -D CMAKE_INSTALL_PREFIX=./OpenCL-CLHPP/install -S ./OpenCL-CLHPP -B ./OpenCL-CLHPP/build \r\n        cmake --build ./OpenCL-CLHPP/build --target install\r\n\r\n### Example Use\r\n\r\nExample CMake invocation\r\n\r\n```bash\r\ncmake -D CMAKE_PREFIX_PATH=\"/chosen/install/prefix/of/headers;/chosen/install/prefix/of/loader;/chosen/install/prefix/of/cppheaders\" /path/to/opencl/app\r\n```\r\n\r\nand sample `CMakeLists.txt`\r\n\r\n```cmake\r\ncmake_minimum_required(VERSION 3.0)\r\ncmake_policy(VERSION 3.0...3.18.4)\r\nproject(proj)\r\nadd_executable(app main.cpp)\r\nfind_package(OpenCLHeaders REQUIRED)\r\nfind_package(OpenCLICDLoader REQUIRED)\r\nfind_package(OpenCLHeadersCpp REQUIRED)\r\ntarget_link_libraries(app PRIVATE OpenCL::Headers OpenCL::OpenCL OpenCL::HeadersCpp)\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fopencl-clhpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhronosgroup%2Fopencl-clhpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fopencl-clhpp/lists"}