{"id":23170040,"url":"https://github.com/shehanmunasinghe/learn-opencl-cpp","last_synced_at":"2025-04-04T23:14:49.078Z","repository":{"id":85229341,"uuid":"212054248","full_name":"shehanmunasinghe/Learn-OpenCL-CPP","owner":"shehanmunasinghe","description":null,"archived":false,"fork":false,"pushed_at":"2019-10-01T09:08:07.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T10:11:23.488Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shehanmunasinghe.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-01T09:07:58.000Z","updated_at":"2019-10-01T09:09:10.000Z","dependencies_parsed_at":"2023-03-27T16:47:55.683Z","dependency_job_id":null,"html_url":"https://github.com/shehanmunasinghe/Learn-OpenCL-CPP","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/shehanmunasinghe%2FLearn-OpenCL-CPP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shehanmunasinghe%2FLearn-OpenCL-CPP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shehanmunasinghe%2FLearn-OpenCL-CPP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shehanmunasinghe%2FLearn-OpenCL-CPP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shehanmunasinghe","download_url":"https://codeload.github.com/shehanmunasinghe/Learn-OpenCL-CPP/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247261603,"owners_count":20910108,"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":"2024-12-18T03:25:35.227Z","updated_at":"2025-04-04T23:14:49.049Z","avatar_url":"https://github.com/shehanmunasinghe.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"#Dependencies\n* OpenCL 1.2 (Tested on MacOS)\n\n# To Run\n    clang++ -std=c++0x -framework OpenCL main.cpp -o main.out\n\n# References\n* https://rageandqq.github.io/blog/2018/03/09/opencl-mac-cpp.html\n* https://www.eriksmistad.no/using-the-cpp-bindings-for-opencl/\n* http://simpleopencl.blogspot.com/2013/06/tutorial-simple-start-with-opencl-and-c.html\n* https://github.com/Dakkers/OpenCL-examples/\n\n* https://cnugteren.github.io/tutorial/pages/page1.html [single-precision matrix-multiplication (SGEMM)]\n\n# Codes\n\n### 2-large-vector-addition\n* This example compares the timings of adding vectors on the CPU versus adding vectors on the GPU, the latter of which has different implementations.\n* The code runs the following implementations of adding large vectors (131072 elements; 8 * 32 * 512). The vectors are added together 10000 times.\n\n- CPU\n- GPU, where 1024 threads are spawned and each thread thus gets 128 elements to calculate; there are two implementations of this:\n  - (Version 1) each thread gets 128 sequential elements (thread 0 gets 0-127, 1 gets 128-255, ...)\n  - (Version 2) each thread gets 128 elements, but coalescing happens (thread 0 gets 0,128,256..., thread 1 gets 1,129,257...)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshehanmunasinghe%2Flearn-opencl-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshehanmunasinghe%2Flearn-opencl-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshehanmunasinghe%2Flearn-opencl-cpp/lists"}