Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nvrtc #23

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Nvrtc #23

wants to merge 9 commits into from

Conversation

lilkeet
Copy link
Contributor

@lilkeet lilkeet commented Oct 15, 2024

What

This pr adds two new modules to the library: nvrtc and cuda.

cuda is better known the cuda driver api, which is very similar to the cuda runtime api but a bit lower level.

nvrtc is a module that enables the use of runtime compilation of cuda code.

An example of runtime compilation is also added. #19

Why

Currently, there is no good way to run cuda kernels from Nim. Here are some known options:

Use a cuda compiler to compile the entire project

Transpile nim code to ptx

This pr enables a native, easy solution. Checkout the example (355290f) for all that is required to run a cuda kernel. Much of it is boilerplate that could be minimized by a higher-level library.

The cuda driver api was added mostly due to the fact that nvrtc requires that you use it instead of the cuda runtime api, but it should've been added long ago, imo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant