{"id":27099526,"url":"https://github.com/puzzlef/vector-max-cuda","last_synced_at":"2026-05-17T19:38:35.781Z","repository":{"id":109078729,"uuid":"558019967","full_name":"puzzlef/vector-max-cuda","owner":"puzzlef","description":"Performance of sequential vs CUDA-based vector element max.","archived":false,"fork":false,"pushed_at":"2025-04-08T18:02:50.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-05T15:28:19.972Z","etag":null,"topics":["basics","cuda","element","experiment","max","vector"],"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/puzzlef.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-26T18:40:34.000Z","updated_at":"2025-04-08T18:02:53.000Z","dependencies_parsed_at":"2023-04-21T14:00:43.923Z","dependency_job_id":null,"html_url":"https://github.com/puzzlef/vector-max-cuda","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"puzzlef/vector-sum-openmp","purl":"pkg:github/puzzlef/vector-max-cuda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puzzlef%2Fvector-max-cuda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puzzlef%2Fvector-max-cuda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puzzlef%2Fvector-max-cuda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puzzlef%2Fvector-max-cuda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puzzlef","download_url":"https://codeload.github.com/puzzlef/vector-max-cuda/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puzzlef%2Fvector-max-cuda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279276352,"owners_count":26138741,"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","status":"online","status_checked_at":"2025-10-17T02:00:07.504Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["basics","cuda","element","experiment","max","vector"],"created_at":"2025-04-06T12:35:59.193Z","updated_at":"2025-10-17T03:21:45.355Z","avatar_url":"https://github.com/puzzlef.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"Comparing performance of *sequential* vs *CUDA-based* **vector element max**.\n\nFor each experiment given below, we attempt each approach on a number of vector\nsizes, running each approach 5 times per size to get a good time measure. Note\nthat time taken to copy data back and forth from the GPU is not measured, and\nthe sequential approach does not make use of *SIMD instructions*. The experiments\nare done with guidance from [Prof. Kishore Kothapalli] and\n[Prof. Dip Sankar Banerjee].\n\n\u003cbr\u003e\n\n\n### Comparison with Sequential approach\n\nThis experiment ([compare-sequential], [main]) compares the performance\nbetween finding `max(x)` using a single thread (**sequential**) and using\n**CUDA** (*not power-of-2* and *power-of-2* reduce). Here `x` is a 32-bit\ninteger vector. While it might seem that **CUDA** approach would be a clear\nwinner, the results indicate it is dependent upon the workload. Results indicate\nthat **from 10^5 elements, CUDA approach performs better** than sequential.\nBoth CUDA approaches (*not power-of-2*/*power-of-2* reduce) seem to have\nsimilar performance. All outputs are saved in a [gist]. Some [charts] are also\nincluded below, generated from [sheets].\n\n[![](https://i.imgur.com/Xm9M2wx.png)][sheetp]\n\n[compare-sequential]: https://github.com/puzzlef/vector-max-cuda/tree/compare-sequential\n[main]: https://github.com/puzzlef/vector-max-cuda\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n## References\n\n- [CUDA by Example :: Jason Sanders, Edward Kandrot](https://gist.github.com/wolfram77/72c51e494eaaea1c21a9c4021ad0f320)\n- [Managed memory vs cudaHostAlloc - TK1](https://forums.developer.nvidia.com/t/managed-memory-vs-cudahostalloc-tk1/34281)\n- [How to enable C++17 code generation in VS2019 CUDA project](https://stackoverflow.com/a/63057409/1413259)\n- [\"More than one operator + matches these operands\" error](https://stackoverflow.com/a/10343618/1413259)\n- [How to import VSCode keybindings into Visual Studio?](https://stackoverflow.com/a/62417446/1413259)\n- [Explicit conversion constructors (C++ only)](https://www.ibm.com/docs/en/i/7.3?topic=only-explicit-conversion-constructors-c)\n- [Configure X11 Forwarding with PuTTY and Xming](https://www.centlinux.com/2019/01/configure-x11-forwarding-putty-xming-windows.html)\n- [code-server setup and configuration](https://coder.com/docs/code-server/latest/guide)\n- [Installing snap on CentOS](https://snapcraft.io/docs/installing-snap-on-centos)\n\n\u003cbr\u003e\n\u003cbr\u003e\n\n\n[![](https://i.imgur.com/MOJPoM0.jpg)](https://www.youtube.com/watch?v=E0_Ic1P-Hzg)\u003cbr\u003e\n[![ORG](https://img.shields.io/badge/org-puzzlef-green?logo=Org)](https://puzzlef.github.io)\n[![DOI](https://zenodo.org/badge/558019967.svg)](https://zenodo.org/badge/latestdoi/558019967)\n![](https://ga-beacon.deno.dev/G-KD28SG54JQ:hbAybl6nQFOtmVxW4if3xw/github.com/puzzlef/vector-max-cuda)\n\n[Prof. Dip Sankar Banerjee]: https://sites.google.com/site/dipsankarban/\n[Prof. Kishore Kothapalli]: https://faculty.iiit.ac.in/~kkishore/\n[gist]: https://gist.github.com/wolfram77/57ea86e0e71fb88f2dfd925b7fb753cd\n[charts]: https://imgur.com/a/AO4iYAB\n[sheets]: https://docs.google.com/spreadsheets/d/1TSEh0slMEZg47Rp01LzoPVvG9kVJZLP2RbGJdwsqmP0/edit?usp=sharing\n[sheetp]: https://docs.google.com/spreadsheets/d/e/2PACX-1vTOsNQOXDX3K7nQ256HHwKRnIydERHPoYA7IFmNlH58pTQb7sGBSMu1fAjA-Tk_VEs4tfm9iXb22_FS/pubhtml\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuzzlef%2Fvector-max-cuda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpuzzlef%2Fvector-max-cuda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpuzzlef%2Fvector-max-cuda/lists"}