{"id":13731784,"url":"https://github.com/jgbit/vuda","last_synced_at":"2025-04-12T18:48:57.262Z","repository":{"id":33110067,"uuid":"151876489","full_name":"jgbit/vuda","owner":"jgbit","description":"VUDA is a header-only library based on Vulkan that provides a CUDA Runtime API interface for writing GPU-accelerated applications.","archived":false,"fork":false,"pushed_at":"2024-01-21T12:08:08.000Z","size":546,"stargazers_count":888,"open_issues_count":5,"forks_count":35,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-04-03T21:13:20.423Z","etag":null,"topics":["cuda","vuda","vulkan"],"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/jgbit.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":"2018-10-06T19:53:52.000Z","updated_at":"2025-03-28T21:54:16.000Z","dependencies_parsed_at":"2024-10-23T07:19:00.537Z","dependency_job_id":"670365b2-b9ac-49f8-9ddf-90d2110ca819","html_url":"https://github.com/jgbit/vuda","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/jgbit%2Fvuda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgbit%2Fvuda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgbit%2Fvuda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgbit%2Fvuda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgbit","download_url":"https://codeload.github.com/jgbit/vuda/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248618217,"owners_count":21134199,"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","vuda","vulkan"],"created_at":"2024-08-03T02:01:38.346Z","updated_at":"2025-04-12T18:48:57.239Z","avatar_url":"https://github.com/jgbit.png","language":"C++","readme":"## VUDA\n\nVUDA is a header-only library based on Vulkan that provides a CUDA Runtime API interface for writing GPU-accelerated applications.\n\n## Documentation\n\nVUDA is based on the [Vulkan API](https://www.khronos.org/vulkan/). The functionality of VUDA conforms (as much as possible) to the specification of the CUDA runtime. For normal usage consult the reference guide for the [NVIDIA CUDA Runtime API](https://docs.nvidia.com/cuda/cuda-runtime-api/index.html), otherwise check the VUDA wiki:\n\n- [Change List](https://github.com/jgbit/vuda/wiki/Change-List)\n- [Setup and Compilation](https://github.com/jgbit/vuda/wiki/Setup-and-Compilation)\n- [Deviations from CUDA](https://github.com/jgbit/vuda/wiki/Deviations-from-CUDA)\n- [Implementation Details](https://github.com/jgbit/vuda/wiki/Implementation-Details)\n\n## Usage\n\nAll VUDA functionality can be accessed by including `vuda.hpp` and using its namespace `vuda::`.\nAlternatively, one can utilize `vuda_runtime.hpp` which wraps and redirect all CUDA functionality.\n\n```c++\n#if defined(__NVCC__)\n    #include \u003ccuda_runtime.h\u003e\n#else\n    #include \u003cvuda_runtime.hpp\u003e\n#endif\n\nint main(void)\n{\n    // assign a device to the thread\n    cudaSetDevice(0);\n    // allocate memory on the device\n    const int N = 5000;\n    int a[N], b[N], c[N];\n    for(int i = 0; i \u003c N; ++i)\n    {\n        a[i] = -i;\n        b[i] = i * i;\n    }\n    int *dev_a, *dev_b, *dev_c;\n    cudaMalloc((void**)\u0026dev_a, N * sizeof(int));\n    cudaMalloc((void**)\u0026dev_b, N * sizeof(int));\n    cudaMalloc((void**)\u0026dev_c, N * sizeof(int));\n    // copy the arrays a and b to the device\n    cudaMemcpy(dev_a, a, N * sizeof(int), cudaMemcpyHostToDevice);\n    cudaMemcpy(dev_b, b, N * sizeof(int), cudaMemcpyHostToDevice);\n    // run kernel (vulkan shader module)\n    const int blocks = 128;\n    const int threads = 128;\n#if defined(__NVCC__)\n    add\u003c\u003c\u003cblocks, threads\u003e\u003e\u003e(dev_a, dev_b, dev_c, N);\n#else\n    const int stream_id = 0;\n    vuda::launchKernel(\"add.spv\", \"main\", stream_id, blocks, threads, dev_a, dev_b, dev_c, N);\n#endif\n    // copy result to host\n    cudaMemcpy(c, dev_c, N * sizeof(int), cudaMemcpyDeviceToHost);\n\n    // do something useful with the result in array c ...        \n\n    // free memory on device\n    cudaFree(dev_a);\n    cudaFree(dev_b);\n    cudaFree(dev_c);\n}\n```","funding_links":[],"categories":["Libraries","GPU","Graphics"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgbit%2Fvuda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgbit%2Fvuda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgbit%2Fvuda/lists"}