opencl-clhpp/README.md
2021-11-12 10:30:12 +08:00

45 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# OpenCL<sup>TM</sup> API C++ 绑定
cl2.hpp 头文件的 Doxgen 文档可以在这里找到:
http://khronosgroup.github.io/OpenCL-CLHPP/
软件架构:
* `include/CL/cl2.hpp`
最新的、维护的 C++ 绑定版本。它应该适用于所有版本的 OpenCL包括 1.x。这是大多数用户想要的。
* `docs`
Doxygen 文件用于为 `cl2.hpp` 生成 HTML 文档。
* `examples`
使用Bind的基本功能的简单示例应用程序。
* `tests`
一组(非常小,不完整的)回归测试。构建测试需要 Python、Ruby、Unity 和 CMock。对于最后两个我们使用 [Unity 2.1.0](https://github.com/ThrowTheSwitch/Unity/releases/tag/v2.1.0) 和 [CMock top-of-tree from Github](https://github .com/ThrowTheSwitch/CMockSourceforge 上的 2.0.204 版本不起作用)。
* `CMakeLists.txt`
为Bind安装的示例和测试以及逻辑构建系统。
要获取测试所需的外部依赖项,请在克隆存储库时使用 `--recursive`,或运行 `git submodule update --init`
您可能需要使用变量 `OPENCL_INCLUDE_DIR``OPENCL_LIB_DIR` 告诉 CMake 在哪里可以找到 OpenCL 头文件和库。
这些可以设置为环境变量,也可以使用语法`-D<VAR>=<VALUE>`在cmake命令行上设置。
以下是用于检出和构建 C++ 绑定的示例命令集(根据需要调整路径):
```
git clone --recursive https://github.com/KhronosGroup/OpenCL-CLHPP
cd OpenCL-CLHPP
mkdir build
cd build
cmake .. -DOPENCL_INCLUDE_DIR=/path/to/OpenCL/headers -DOPENCL_LIB_DIR=/path/to/OpenCL/library
make
make test
```
构建后,头文件保存在`build/include/CL/`中。
如果 Doxygen 可用,您可以通过键入 `make docs` 来生成 HTML 文档。