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

Add usage for single-source example #21

Open
JordanLloydHall opened this issue Sep 25, 2024 · 1 comment
Open

Add usage for single-source example #21

JordanLloydHall opened this issue Sep 25, 2024 · 1 comment

Comments

@JordanLloydHall
Copy link

I really love the work you're doing here, and want to use it in my own personal project!
However I'm currently getting to grips with the usage of this crate, and I'm struggling to get single-source to do anything once it's built. Would it be possible to have more examples to work off of, or have this example come with a bin target?

Many thanks for your work! And I would be happy to take a look at creating more examples once I've wrapped my head around it!

@juntyr
Copy link
Owner

juntyr commented Sep 26, 2024

Thank you for your interest in my crate!

The print example is currently the only one that is fully executable.

I initially developed rust-cuda for necsim-rust, a neutral ecology model. It shows the full in-action usage of this crate:

If your kernel linking is ever so slightly complex, I'd recommend to also make the three-crate split (single-source kernel, linking, host) to improve compile times (since otherwise any change in the host code recompiles all kernel variants as well).

The important things to make sure everything runs, is to have the required CUDA libraries and the "llvm-bitcode-linker" and "llvm-tools" rust components installed, and to put the https://github.com/juntyr/rust-cuda/blob/main/examples/print/.cargo/config.toml file in the crate that contains your kernel.

I hope this helps a bit :) I could also have a look at your code to help you integrate rust-cuda if you'd like.

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

No branches or pull requests

2 participants