back to home

bashbaug / SimpleOpenCLSamples

Simple OpenCL Samples that Build with Khronos Headers and Libs

View on GitHub
121 stars
28 forks
0 issues

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing bashbaug/SimpleOpenCLSamples in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context on-demand, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Source files are only loaded when you start an analysis to optimize performance.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind.in/repo/bashbaug/SimpleOpenCLSamples)
Preview:Analyzed by RepoMind

Repository Overview (README excerpt)

Crawler view

Simple OpenCL TM Samples This repo contains simple OpenCL samples that demonstrate how to build OpenCL applications using only the Khronos-provided headers and libs. All samples have been tested on Windows and Linux. Most of the samples are written in C and C++ using the OpenCL C++ bindings. A few of the samples have been ported to Python using PyOpenCL. Code Structure How to Build the Samples The samples require the following external dependencies: OpenCL Headers: git clone https://github.com/KhronosGroup/OpenCL-Headers external/OpenCL-Headers OpenCL ICD Loader: git clone https://github.com/KhronosGroup/opencl-icd-loader external/opencl-icd-loader Many samples that use extensions additionally require the OpenCL Extension Loader: git clone https://github.com/bashbaug/opencl-extension-loader external/opencl-extension-loader Several samples that interact with SPIR-V require the SPIR-V headers: git clone https://github.com/KhronosGroup/SPIRV-Headers external/SPIRV-Headers After satisfying the external dependencies create build files using CMake. For example: mkdir build && cd build cmake .. Then, build with the generated build files. How to Run the Samples To run the samples, you will need to obtain and install an ICD loader and an OpenCL implementation (ICD) that supports the extension. The ICD loader is likely provided by your operating system or an OpenCL implementation. If desired, you may use the ICD loader that is built along with these OpenCL samples. The OpenCL implementation will likely be provided by your OpenCL device vendor. There are several open source OpenCL implementations as well. Further Reading • Environment Setup for Ubuntu 22.04 • OpenCLPapers • OpenCL Specs • OpenCL Error Codes A Note About Error Checking For brevity, most samples do not include error checking. This means that a sample may crash or incorrectly report success if an OpenCL error occurs. By defining the CMake variable many samples can instead throw an exception if an OpenCL error occurs. Tools like the OpenCL Intercept Layer can also be useful to detect when an OpenCL error occurs and to identify the cause of the error. License These samples are licensed under the MIT License. Notes: • The OpenCL C++ bindings are built from the Khronos OpenCL-CLHPP Repo, and is licensed under the Khronos(tm) License. • The samples use popl for its options parsing, which is licensed under the MIT License. • The samples use stb for image reading and writing, which is dual-licensed under a public domain license and the MIT license. --- OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos. \* Other names and brands may be claimed as the property of others.