{"id":32750546,"url":"https://github.com/lyynn777/cuda-bitonic-sort","last_synced_at":"2026-04-15T13:31:52.217Z","repository":{"id":322062865,"uuid":"1088095526","full_name":"Lyynn777/CUDA-Bitonic-sort","owner":"Lyynn777","description":"Simple CUDA project to implement Bitonic Sort and compare it with normal CPU sorting.","archived":false,"fork":false,"pushed_at":"2025-11-02T10:12:47.000Z","size":183,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-02T11:41:29.847Z","etag":null,"topics":["bitonic-sort","cuda","gpu-computing","gpu-vs-cpu","parallel-computing","performance-testing","pycuda","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/Lyynn777.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-02T09:55:13.000Z","updated_at":"2025-11-02T10:15:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Lyynn777/CUDA-Bitonic-sort","commit_stats":null,"previous_names":["lyynn777/cuda-bitonic-sort"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Lyynn777/CUDA-Bitonic-sort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lyynn777%2FCUDA-Bitonic-sort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lyynn777%2FCUDA-Bitonic-sort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lyynn777%2FCUDA-Bitonic-sort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lyynn777%2FCUDA-Bitonic-sort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lyynn777","download_url":"https://codeload.github.com/Lyynn777/CUDA-Bitonic-sort/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lyynn777%2FCUDA-Bitonic-sort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":282542839,"owners_count":26686795,"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-11-03T02:00:05.676Z","response_time":108,"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":["bitonic-sort","cuda","gpu-computing","gpu-vs-cpu","parallel-computing","performance-testing","pycuda","python"],"created_at":"2025-11-03T23:01:04.588Z","updated_at":"2026-04-15T13:31:52.207Z","avatar_url":"https://github.com/Lyynn777.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CUDA Bitonic Sort — GPU Sorting in Google Colab\n![Python](https://img.shields.io/badge/Python-3.x-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n![CUDA](https://img.shields.io/badge/CUDA-Parallel_Computing-76B900?style=for-the-badge\u0026logo=nvidia\u0026logoColor=white)\n![PyCUDA](https://img.shields.io/badge/PyCUDA-GPU_Programming-00599C?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n![Google Colab](https://img.shields.io/badge/Colab-GPU%20(T4)-F9AB00?style=for-the-badge\u0026logo=googlecolab\u0026logoColor=white)\n![Sorting Algorithm](https://img.shields.io/badge/Algorithm-Bitonic_Sort-blueviolet?style=for-the-badge)\n![Matplotlib](https://img.shields.io/badge/Visualization-Matplotlib-003B57?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n\n\nThis project implements the **Bitonic Sorting Algorithm on GPU using CUDA (PyCUDA)** and compares performance against CPU sorting.\nThe goal is to understand **parallel sorting networks** and observe when GPU parallelism becomes beneficial.\n\n---\n\n## **Project Objectives**\n\n* Implement **Bitonic Sort** in CUDA using PyCUDA\n* Sort arrays and verify correctness vs. CPU sorting\n* Measure execution time for multiple input sizes\n* Plot **CPU vs GPU runtime graph**\n* Run fully in **Google Colab** (Tesla T4 GPU)\n\n---\n\n## **Why Bitonic Sort?**\n\nBitonic Sort is chosen because:\n\n* Perfectly fits **parallel execution model**\n* Regular \u0026 predictable memory access\n* No recursion or branching complexity\n* Ideal for learning GPU sorting architectures\n\nIt's used in academic \u0026 research demos for **GPU parallel algorithms**.\n\n---\n\n## **Tech Stack**\n\n| Component     | Details         |\n| ------------- | --------------- |\n| Language      | Python          |\n| GPU           | NVIDIA Tesla T4 |\n| CUDA Library  | PyCUDA          |\n| Visualization | Matplotlib      |\n| Environment   | Google Colab    |\n\n---\n\n## **Project Structure**\n\n```\ncuda-bitonic-sort/\n├── README.md\n├── bitonic_sort.ipynb\n├── images/\n│   └── sort_time.png\n│   └── sorting_time_comparison..png\n\n```\n\n---\n\n##  **Running the Project in Colab**\n\n### 1️⃣ Load GPU\n\n```\nRuntime \u003e Change runtime type \u003e GPU\n```\n\n### 2️⃣ Install Dependencies\n\n```bash\n!pip install pycuda\n```\n\n### 3️⃣ Run Notebook\n\nOpen: `bitonic_sort.ipynb`\n\n---\n\n##  **Results Overview**\n\n| Array Size | CPU Time | GPU Time | Correct? |\n| ---------- | -------- | -------- | -------- |\n| 512        | ✅        | ✅        | True     |\n| 1024       | ✅        | ✅        | True     |\n| 2048       | ✅        | ✅        | True     |\n| 4096       | ✅        | ✅        | True     |\n| 8192       | ✅        | ✅        | True     |\n| 16384      | ✅        | ✅        | True     |\n\n **Observation:**\n\n* GPU is slower for small inputs (kernel overhead)\n* GPU becomes beneficial as input size increases\n* Demonstrates parallel scalability behavior\n\n---\n\n##  **Performance Graph**\n\n![](images/sorting_time_comparison.png)\n\n\n---\n\n##  **Learning Outcomes**\n\nBy completing this project, you achieved:\n\n* Understanding of **GPU threads \u0026 blocks**\n* Knowledge of **parallel sorting networks**\n* Experience with **PyCUDA kernel programming**\n* Performance benchmarking \u0026 graphing\n\n---\n\n##  **References**\n\n* NVIDIA CUDA Programming Guide\n* PyCUDA Documentation\n* Bitonic Sorting Network Theory\n\n---\n\n## **Conclusion**\n\nThis project demonstrates how GPU parallelism behaves for sorting tasks.\nIt’s a **simple but powerful** introduction to CUDA-based parallel computing.\n\n---\n\n### ⭐ If this helped, star the repo!\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyynn777%2Fcuda-bitonic-sort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flyynn777%2Fcuda-bitonic-sort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flyynn777%2Fcuda-bitonic-sort/lists"}