https://github.com/jgbit/vuda Skip to content Toggle navigation Sign up * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Case Studies + Customer Stories + Resources * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing [ ] * # In this repository All GitHub | Jump to | * No suggested jump to results * # In this repository All GitHub | Jump to | * # In this user All GitHub | Jump to | * # In this repository All GitHub | Jump to | Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. {{ message }} jgbit / vuda Public * Notifications * Fork 25 * Star 630 VUDA is a header-only library based on Vulkan that provides a CUDA Runtime API interface for writing GPU-accelerated applications. License MIT license 630 stars 25 forks Star Notifications * Code * Issues 5 * Pull requests 0 * Actions * Projects 0 * Wiki * Security * Insights More * Code * Issues * Pull requests * Actions * Projects * Wiki * Security * Insights jgbit/vuda This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master Switch branches/tags [ ] Branches Tags Could not load branches Nothing to show {{ refName }} default View all branches Could not load tags Nothing to show {{ refName }} default View all tags Name already in use A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch? Cancel Create 1 branch 0 tags Code * Local * Codespaces * Clone HTTPS GitHub CLI [https://github.com/j] Use Git or checkout with SVN using the web URL. [gh repo clone jgbit/] Work fast with our official CLI. Learn more about the CLI. * Open with GitHub Desktop * Download ZIP Sign In Required Please sign in to use Codespaces. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching GitHub Desktop If nothing happens, download GitHub Desktop and try again. Launching Xcode If nothing happens, download Xcode and try again. Launching Visual Studio Code Your codespace will open once ready. There was a problem preparing your codespace, please try again. Latest commit @nikisalli nikisalli fix compilation error (#24) ... 6fc7688 Feb 16, 2022 fix compilation error (#24) 6fc7688 Git stats * 40 commits Files Permalink Failed to load latest commit information. Type Name Latest commit message Commit time inc fix compilation error (#24) February 16, 2022 21:11 samples conformity vulkan October 10, 2020 14:13 LICENSE Initial commit October 6, 2018 21:53 README.md bst fix, vuda runtime, device query sample April 9, 2020 18:02 View code VUDA Documentation Usage README.md VUDA VUDA is a header-only library based on Vulkan that provides a CUDA Runtime API interface for writing GPU-accelerated applications. Documentation VUDA is based on the Vulkan API. 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, otherwise check the VUDA wiki: * Change List * Setup and Compilation * Deviations from CUDA * Implementation Details Usage All VUDA functionality can be accessed by including vuda.hpp and using its namespace vuda::. Alternatively, one can utilize vuda_runtime.hpp which wraps and redirect all CUDA functionality. #if defined(__NVCC__) #include #else #include #endif int main(void) { // assign a device to the thread cudaSetDevice(0); // allocate memory on the device const int N = 5000; int a[N], b[N], c[N]; for(int i = 0; i < N; ++i) { a[i] = -i; b[i] = i * i; } int *dev_a, *dev_b, *dev_c; cudaMalloc((void**)&dev_a, N * sizeof(int)); cudaMalloc((void**)&dev_b, N * sizeof(int)); cudaMalloc((void**)&dev_c, N * sizeof(int)); // copy the arrays a and b to the device cudaMemcpy(dev_a, a, N * sizeof(int), cudaMemcpyHostToDevice); cudaMemcpy(dev_b, b, N * sizeof(int), cudaMemcpyHostToDevice); // run kernel (vulkan shader module) const int blocks = 128; const int threads = 128; #if defined(__NVCC__) add<<>>(dev_a, dev_b, dev_c, N); #else const int stream_id = 0; vuda::launchKernel("add.spv", "main", stream_id, blocks, threads, dev_a, dev_b, dev_c, N); #endif // copy result to host cudaMemcpy(c, dev_c, N * sizeof(int), cudaMemcpyDeviceToHost); // do something useful with the result in array c ... // free memory on device cudaFree(dev_a); cudaFree(dev_b); cudaFree(dev_c); } About VUDA is a header-only library based on Vulkan that provides a CUDA Runtime API interface for writing GPU-accelerated applications. Topics vulkan cuda vuda Resources Readme License MIT license Stars 630 stars Watchers 32 watching Forks 25 forks Report repository Releases No releases published Packages 0 No packages published Contributors 6 * * * * * * Languages * C++ 100.0% Footer (c) 2023 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact GitHub * Pricing * API * Training * Blog * About You can't perform that action at this time.