{"id":27940496,"url":"https://github.com/khronosgroup/opencl-cts","last_synced_at":"2025-05-16T10:07:30.274Z","repository":{"id":37458233,"uuid":"91338943","full_name":"KhronosGroup/OpenCL-CTS","owner":"KhronosGroup","description":"The OpenCL Conformance Tests","archived":false,"fork":false,"pushed_at":"2025-05-06T16:45:01.000Z","size":35695,"stargazers_count":202,"open_issues_count":405,"forks_count":212,"subscribers_count":34,"default_branch":"main","last_synced_at":"2025-05-07T10:17:24.675Z","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":"2017-05-15T13:06:40.000Z","updated_at":"2025-05-06T16:45:06.000Z","dependencies_parsed_at":"2023-02-15T12:01:20.901Z","dependency_job_id":"bd187175-a85d-45e6-9cc6-c3c977854d45","html_url":"https://github.com/KhronosGroup/OpenCL-CTS","commit_stats":null,"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-CTS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-CTS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-CTS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhronosGroup%2FOpenCL-CTS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhronosGroup","download_url":"https://codeload.github.com/KhronosGroup/OpenCL-CTS/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254509476,"owners_count":22082891,"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:17:10.627Z","updated_at":"2025-05-16T10:07:25.265Z","avatar_url":"https://github.com/KhronosGroup.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenCL Conformance Test Suite (CTS)\n\nThis is the OpenCL CTS for all versions of the Khronos\n[OpenCL](https://www.khronos.org/opencl/) standard.\n\n## Building the CTS\n\nThe CTS supports Linux, Windows, macOS, and Android platforms. In particular,\nGitHub Actions CI builds against Ubuntu 20.04, Windows-latest, and\nmacos-latest.\n\nCompiling the CTS requires the following CMake configuration options to be set:\n\n* `CL_INCLUDE_DIR` Points to the unified\n  [OpenCL-Headers](https://github.com/KhronosGroup/OpenCL-Headers).\n* `CL_LIB_DIR` Directory containing the OpenCL library to build against.\n* `SPIRV_TOOLS_DIR` Directory containing the `spirv-as` and `spirv-val` binaries\n   to be used in the CTS build process. Alternatively, the location to these binaries\n   can be provided via the `PATH` variable.\n* `OPENCL_LIBRARIES` Name of the OpenCL library to link.\n\nIt is advised that the [OpenCL ICD-Loader](https://github.com/KhronosGroup/OpenCL-ICD-Loader)\nis used as the OpenCL library to build against. Where `CL_LIB_DIR` points to a\nbuild of the ICD loader and `OPENCL_LIBRARIES` is \"OpenCL\".\n\n### Example Build\n\nSteps on a Linux platform to clone dependencies from GitHub sources, configure\na build, and compile.\n\n```sh\ngit clone https://github.com/KhronosGroup/OpenCL-CTS.git\ngit clone https://github.com/KhronosGroup/OpenCL-Headers.git\ngit clone https://github.com/KhronosGroup/OpenCL-ICD-Loader.git\ngit clone https://github.com/KhronosGroup/SPIRV-Tools.git\ngit clone https://github.com/KhronosGroup/SPIRV-Headers.git SPIRV-Tools/external/spirv-headers\ngit clone https://github.com/google/effcee.git SPIRV-Tools/external/effcee\ngit clone https://github.com/google/re2.git SPIRV-Tools/external/re2\n\n\nmkdir OpenCL-ICD-Loader/build\ncmake -S OpenCL-ICD-Loader -B OpenCL-ICD-Loader/build \\\n      -DOPENCL_ICD_LOADER_HEADERS_DIR=$PWD/OpenCL-Headers\ncmake --build ./OpenCL-ICD-Loader/build --config Release\n\nmkdir SPIRV-Tools/build\ncmake -S SPIRV-Tools -B SPIRV-Tools/build -DSPIRV_SKIP_TESTS=ON\ncmake --build SPIRV-Tools/build --config Release\n\nmkdir OpenCL-CTS/build\ncmake -S OpenCL-CTS -B OpenCL-CTS/build \\\n      -DCL_INCLUDE_DIR=$PWD/OpenCL-Headers \\\n      -DCL_LIB_DIR=$PWD/OpenCL-ICD-Loader/build \\\n      -DSPIRV_TOOLS_DIR=$PWD/SPIRV-Tools/build/tools/ \\\n      -DOPENCL_LIBRARIES=OpenCL\ncmake --build OpenCL-CTS/build --config Release\n```\n\n## Running the CTS\n\nA build of the CTS contains multiple executables representing the directories in\nthe `test_conformance` folder. Each of these executables contains sub-tests, and\npossibly smaller granularities of testing within the sub-tests.\n\nSee the `--help` output on each executable for the list of sub-tests available,\nas well as other options for configuring execution.\n\nIf the OpenCL library built against is the ICD Loader, and the vendor library to\nbe tested is not registered in the\n[default ICD Loader location](https://github.com/KhronosGroup/OpenCL-ICD-Loader#registering-icds)\nthen the [OCL_ICD_FILENAMES](https://github.com/KhronosGroup/OpenCL-ICD-Loader#table-of-debug-environment-variables)\nenvironment variable will need to be set for the ICD Loader to detect the OpenCL\nlibrary to use at runtime. For example, to run the basic tests on a Linux\nplatform:\n\n```sh\nOCL_ICD_FILENAMES=/path/to/vendor_lib.so ./test_basic\n```\n\n### Offline Compilation\n\nTesting OpenCL drivers which do not have a runtime compiler can be done by using\nadditional command line arguments provided by the test harness for tests which\nrequire compilation, these are:\n\n* `--compilation-mode` Selects if OpenCL-C source code should be compiled using\n  an external tool before being passed on to the OpenCL driver in that form for\n  testing. Online is the default mode, but also accepts the values `spir-v`, and\n  `binary`.\n\n* `--compilation-cache-mode` Controls how the compiled OpenCL-C source code\n  should be cached on disk.\n\n* `--compilation-cache-path` Accepts a path to a directory where the compiled\n  binary cache should be stored on disk.\n\n* `--compilation-program` Accepts a path to an executable (default:\n   cl_offline_compiler) invoked by the test harness to perform offline\n   compilation of OpenCL-C source code.  This executable must match the\n   [interface description](test_common/harness/cl_offline_compiler-interface.txt).\n\n## Generating a Conformance Report\n\nThe Khronos [Conformance Process Document](https://members.khronos.org/document/dl/911)\ndetails the steps required for a conformance submission.\nIn this repository [opencl_conformance_tests_full.csv](test_conformance/opencl_conformance_tests_full.csv)\ndefines the full list of tests which must be run for conformance. The output log\nof which must be included alongside a filled in\n[submission details template](test_conformance/submission_details_template.txt).\n\nUtility script [run_conformance.py](test_conformance/run_conformance.py) can be\nused to help generating the submission log, although it is not required.\n\nGit [tags](https://github.com/KhronosGroup/OpenCL-CTS/tags) are used to define\nthe version of the repository conformance submissions are made against.\n\n## Contributing\n\nContributions are welcome to the project from Khronos members and non-members\nalike via GitHub Pull Requests (PR). Alternatively, if you've found a bug or have\na question please file an issue in the GitHub project. First time contributors\nwill be required to sign the Khronos Contributor License Agreement (CLA) before\ntheir PR can be merged.\n\nPRs to the repository are required to be `clang-format` clean to pass CI.\nDevelopers can either use the `git-clang-format` tool locally to verify this\nbefore contributing, or update their PR based on the diff provided by a failing\nCI job.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fopencl-cts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhronosgroup%2Fopencl-cts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhronosgroup%2Fopencl-cts/lists"}