OpenCL TM SDK (in development)
OpenCL TM SDK(正在开发中)
This is the Khronos OpenCL SDK. It brings together all the components needed to develop OpenCL applications:
这是Khronos OpenCL SDK。它汇集了开发OpenCL应用程序所需的所有组件:
- OpenCL Headers (
include/api) - OpenCL标(include/api)
- OpenCL C++ bindings (
include/cpp) - OpenCL C++绑定(包括/cpp)
- OpenCL Loader
- OpenCL加载器
- OpenCL utility library (
include/utils) - OpenCL实用程序库(包括/utils)
It also contains resources useful to OpenCL developers:
它还包含对OpenCL开发人员有用的资源:
- Code samples (
samples/) - 代码示例(示例/)
- Documentation (
docs/) - 文档(docs/)
Build Instructions
构建说明
Dependencies
依赖
-
This repository uses sub-modules for the OpenCL Headers, OpenCL C++ bindings, and OpenCL ICD Loader and some of their transitive dependencies.
该存储库使用OpenCL Headers、OpenCL C++绑定和OpenCL ICD Loader的子模块以及它们的一些可传递依赖项。-
To clone a new repository with all sub-modules included, use the
--recursiveoption. Note that this option clones all sub-modules and their dependencies, which are not strictly required for the OpenCL SDK: -
要克隆包含所有子模块的新存储库,请使用--recursive选项。请注意,此选项会克隆所有子模块及其依赖项,这对于OpenCL SDK来说并不是严格要求的:
git clone --recursive https://github.com/KhronosGroup/OpenCL-SDK.git -
Alternatively, to clone only the sub-modules for the OpenCL SDK, first clone this repository without sub-modules included then setup submodules non-recursively:
-
或者,要只克隆OpenCL SDK的子模块,请先克隆此存储库,不包括子模块,然后非递归地设置子模块:
git clone https://github.com/KhronosGroup/OpenCL-SDK.git git submodule init git submodule update
-
-
The SDK uses CMake for its build system. If CMake is not provided by your build system or OS package manager, please consult the CMake website.
-
SDK的构建系统使用CMake。如果构建系统或操作系统包管理器没有提供CMake,请访问CMake网站。
-
The SDK samples depend on
- SDK示例取决于
- Templatized C++ Command Line Parser Library (aka. TCLAP)
-
- Simple and Fast Multimedia Library (aka. SFML)
- OpenGL Mathematics (aka. GLM)
Example Build
示例构建
The example build guide uses Vcpkg to fetch all dependencies. Note that Vcpkg is not a requirement and is only used for convenience. One may provide dependencies through any other CMake mechanism. For details on how to install Vcpkg, refer to its Getting Started Guide. The example build assumes targeting 64-bit Windows.
示例构建指南使用Vcpkg获取所有依赖项。请注意,Vcpkg不是必需的,仅用于方便。可以通过任何其他CMake机制提供依赖关系。有关如何安装Vcpkg的详细信息,请参阅其《入门指南》。示例构建假定目标为64位Windows。
1.Clone this repo with the rest of the OpenCL SDK components:
1.将此repo与其他OpenCL SDK组件一起克隆:
git clone https://github.com/KhronosGroup/OpenCL-SDK.git
git submodule init
git submodule update
2.Install dependencies:
2.安装依赖项:
vcpkg --triplet x64-windows install sfml tclap glm
3.Build and install SDK with samples and no downstream unit tests:
3.构建并安装带有示例的SDK,无需下游单元测试:
cmake -A x64 `
-D BUILD_TESTING=OFF `
-D BUILD_DOCS=OFF `
-D BUILD_EXAMPLES=OFF `
-D BUILD_TESTS=OFF `
-D OPENCL_SDK_BUILD_SAMPLES=ON `
-D OPENCL_SDK_TEST_SAMPLES=OFF `
-D CMAKE_TOOLCHAIN_FILE=/vcpkg/install/root/scripts/buildsystems/vcpkg.cmake `
-D VCPKG_TARGET_TRIPLET=x64-windows `
-B ./OpenCL-SDK/build -S ./OpenCL-SDK
cmake --build ./OpenCL-SDK/build --target install
(Note: on Linux, paths to dependent libraries are automatically handled by RPATH in both the build and install tree. On Windows, all DLLs have to be on the PATH. Vcpkg copies dependent DLLs to the build tree, but in order to do the same in the install tree, a sufficiently new CMake version is required. CMake 3.21 introduces install(IMPORTED_RUNTIME_ARTIFACTS).)
(注意:在Linux上,到依赖库的路径由RPATH在生成树和安装树中自动处理。在Windows上,所有DLL都必须在PATH上。Vcpkg将依赖DLL复制到生成树,但为了在安装树中执行相同操作,需要一个足够新的CMake版本。CMake 3.21引入了安装(IMPORTED_RUNTIME_ARTIFACTS)。)
这篇文章介绍了Khronos的OpenCLSDK,它集成了开发OpenCL应用所需的头文件、C++绑定、加载器和实用库等组件。此外,还包括了构建指导、依赖管理和示例代码。开发者需使用CMake构建系统和可选的Vcpkg来获取依赖项。
1573

被折叠的 条评论
为什么被折叠?



