{"id":13819266,"url":"https://github.com/rsnemmen/OpenCL-examples","last_synced_at":"2025-05-16T04:33:14.702Z","repository":{"id":50598461,"uuid":"94150455","full_name":"rsnemmen/OpenCL-examples","owner":"rsnemmen","description":"Simple OpenCL examples for exploiting GPU computing","archived":false,"fork":false,"pushed_at":"2024-08-01T00:20:05.000Z","size":3630,"stargazers_count":190,"open_issues_count":1,"forks_count":70,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-05T08:07:50.815Z","etag":null,"topics":["c","examples","gpu","gpu-computing","numerical-calculations","opencl","opencl-device"],"latest_commit_sha":null,"homepage":null,"language":"Objective-C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rsnemmen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-06-12T23:48:17.000Z","updated_at":"2024-08-01T00:20:09.000Z","dependencies_parsed_at":"2024-01-13T16:21:20.877Z","dependency_job_id":"6f098fc0-802d-498c-a2c8-5ca32b0bc057","html_url":"https://github.com/rsnemmen/OpenCL-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsnemmen%2FOpenCL-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsnemmen%2FOpenCL-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsnemmen%2FOpenCL-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsnemmen%2FOpenCL-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsnemmen","download_url":"https://codeload.github.com/rsnemmen/OpenCL-examples/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225405586,"owners_count":17469373,"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":["c","examples","gpu","gpu-computing","numerical-calculations","opencl","opencl-device"],"created_at":"2024-08-04T08:00:43.789Z","updated_at":"2024-11-19T18:31:39.778Z","avatar_url":"https://github.com/rsnemmen.png","language":"Objective-C++","funding_links":["https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee\u0026emoji=\u0026slug=nemmen\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=ffffff","https://www.buymeacoffee.com/nemmen"],"categories":["Objective-C++"],"sub_categories":[],"readme":"Simple examples of OpenCL code\n===============================\n\nSimple examples of OpenCL code, which I am using to learn heterogeneous and GPU computing with OpenCL. \n\n## Examples included\n\n- `add_numbers`: add a list of numbers together. Includes detailed error handling which makes the code harder to read and understand\n- `square_array`: computes *array*^2 (I am playing mostly with this one)\n- `sum_array`: sums two arrays\n- `cf4cl`: testing OpenCL C wrapper\n- `Hello_World`: OpenCL \"Hello World\" by Apple\n- `mandelbrot`: my attempt at a simple Mandelbrot set calculation\n- `N-BodySimulation`: Apple's N-body simulator which clearly illustrates the speedup gained by using the GPU. Requires Xcode\n- `RayTraced_Quaternion_Julia-Set_Example`: Apple\n- `rng`: Illustrates how to generate random numbers in the host and in the GPU using the library [`clRNG`](http://clmathlibraries.github.io/clRNG/htmldocs/index.html)\n- `auger`: generates random cosmic rays on an isotropic sky\n\nThe examples that clearly demonstrate the computational advantage of using a GPU for processing are `N-BodySimulation`, `RayTraced_Quaternion_Julia-Set_Example` (both developed by Apple programmers) and `auger`. For `auger`, I got impressive speedups of \u003e200x compared to a serial code on the CPU.\n\n## Info about OpenCL devices\n\nTo learn about your OpenCL devices, try:\n\n    clinfo\n\nTo install `clinfo` on MacOS:\n\n    brew install homebrew/science/clinfo\n\n## References\n\n### Slides\n\n- [OpenCL introduction](https://www.eecis.udel.edu/~cavazos/cisc879/Lecture-06.pdf), S. Grauer-Gray\n- [OpenCL introduction](http://smai.emath.fr/cemracs/cemracs16/images/FDesprez.pdf), F. Desprez\n\n### Code walkthroughs \n\n- [Vector addition in OpenCL](https://www.olcf.ornl.gov/tutorials/opencl-vector-addition/) (Oak Ridge National Lab)\n- [Getting started with OpenCL and GPU computing](https://www.eriksmistad.no/getting-started-with-opencl-and-gpu-computing/), by E. Smistad\n- [A gentle introduction to OpenCL](http://www.drdobbs.com/parallel/a-gentle-introduction-to-opencl/231002854), Dr. Dobbs. Includes interesting analogies, but may be too hard as a first read\n\n### Courses\n\n- Hands-on OpenCL\n- AMD OpenCL course\n- Introduction to OpenCL, Manchester\n\n## Like it?\n\nIf you are really happy with these examples, you can:  \n[![Buy Me a Coffee](https://img.buymeacoffee.com/button-api/?text=Buy%20me%20a%20coffee\u0026emoji=\u0026slug=nemmen\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Cookie\u0026outline_colour=000000\u0026coffee_colour=ffffff)](https://www.buymeacoffee.com/nemmen)\n\n\n\n## TODO\n\n- [ ] similar repo with CUDA examples\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsnemmen%2FOpenCL-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsnemmen%2FOpenCL-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsnemmen%2FOpenCL-examples/lists"}