{"id":24557986,"url":"https://github.com/guoci/sycl-examples","last_synced_at":"2026-01-03T21:04:59.567Z","repository":{"id":196590668,"uuid":"694805735","full_name":"guoci/sycl-examples","owner":"guoci","description":"Simple SYCL examples","archived":false,"fork":false,"pushed_at":"2024-10-03T21:50:28.000Z","size":23306,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T05:34:29.361Z","etag":null,"topics":["cuda-by-example","gpu","gpu-programming","julia-set","maxwell-boltzmann-distribution","sycl"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guoci.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-09-21T18:21:22.000Z","updated_at":"2024-10-03T21:50:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"ddbbd6d5-9205-4c10-a70e-94c402897c10","html_url":"https://github.com/guoci/sycl-examples","commit_stats":null,"previous_names":["guoci/sycl-examples"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoci%2Fsycl-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoci%2Fsycl-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoci%2Fsycl-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guoci%2Fsycl-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guoci","download_url":"https://codeload.github.com/guoci/sycl-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243912608,"owners_count":20367888,"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":["cuda-by-example","gpu","gpu-programming","julia-set","maxwell-boltzmann-distribution","sycl"],"created_at":"2025-01-23T05:31:35.396Z","updated_at":"2026-01-03T21:04:59.518Z","avatar_url":"https://github.com/guoci.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SYCL examples\n\nSome simple SYCL code examples.\n\n## N-body Maxwell-Boltzmann distribution\n\nUses N-body simulation to\napproximate [Maxwell-Boltzmann distribution](https://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_distribution).\n\nhttps://github.com/guoci/sycl-examples/assets/1260178/161a5c62-2759-4e99-92a2-502f1f6e88da\n\u003cdetails\u003e\n\u003csummary\u003eNotes\u003c/summary\u003e\n\nAnother implementation written in PyTorch can be\nfound [here](https://github.com/lukepolson/youtube_channel/blob/main/Python%20GPU/multibody_boltzmann.ipynb).\nI found an [issue](https://github.com/lukepolson/youtube_channel/issues/12) with that code. The total energy do not\nremain constant over time due to multiple collisions per particle at an iteration.\n\nFor my SYCL implementation, I resolved that with allowing only one collision per particle at an iteration.\n\u003c/details\u003e\n\n\n## Ripple\n\nSYCL rewrite\nof [CUDA code](https://github.com/CodedK/CUDA-by-Example-source-code-for-the-book-s-examples-/blob/master/chapter05/ripple.cu)\nin the \"CUDA By Example\" book.\n\nhttps://github.com/guoci/sycl-examples/assets/1260178/e31a7f02-8a2e-40f5-a549-9171d0b4b5c9\n\u003cdetails\u003e\n\u003csummary\u003eNotes\u003c/summary\u003e\nThe \u003ccode\u003eupdate_host\u003c/code\u003e member function can be very useful when we have a loop where a buffer is used repeatedly and we need the host data to update at each iteration.\nSince we cannot destroy a buffer in the loop, the only way of forcing the update is to use \u003ccode\u003eupdate_host\u003c/code\u003e.\n\u003c/details\u003e\n\n## Julia set\n\nSYCL rewrite\nof [CUDA code](https://github.com/CodedK/CUDA-by-Example-source-code-for-the-book-s-examples-/blob/master/chapter04/julia_gpu.cu)\nin the \"CUDA By Example\" book.\n![Julia set](julia_gpu/julia_gpu.png)\n\n## Ray tracing\n\nSYCL rewrite\nof [CUDA code](https://github.com/CodedK/CUDA-by-Example-source-code-for-the-book-s-examples-/blob/master/chapter06/ray.cu)\nin the \"CUDA By Example\" book.\n![ray tracing](ray_tracing/ray.png)\n\n## build and run\nA SYCL compiler is required to compiler SYCL code. A normal C++ compiler would not work. See https://sycl.tech/ for more information.\n\nThis is built with the SYCL [compiler](https://software.intel.com/oneapi) from Intel.\n\n`cd` into the directory of the example, then run the following in shell\n\n```shell\ncmake -DCMAKE_BUILD_TYPE=Release -S . -B ./cmake-build-release\ncmake --build ./cmake-build-release --target \u003ctarget_name\u003e -j\ncmake-build-release/\u003ctarget_name\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguoci%2Fsycl-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguoci%2Fsycl-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguoci%2Fsycl-examples/lists"}