Skip to content

reactor(cust_raw): Generate bindings for cuda types and restructure cust_raw's crates #201

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jorge-ortega
Copy link
Collaborator

  • Allow list files instead of types/var/functions.
  • Split out type headers from runtime/cublas to their own crate.
  • Drop sys prefix from internal crates. (Hopefully we can still get ownership of cuda-sys, which would make the internal sys suffix redundant).

This restructures cust_raw to the following:

src/
├── cublas/        # Cublas and its extensions
│   ├── core.rs
│   ├── lt.rs
│   ├── mod.rs
│   └── xt.rs
├── types/         # Common CUDA Runtime types
│   ├── driver.rs
│   ├── library.rs
│   ├── mod.rs
│   ├── surface.rs
│   └── texture.rs
├── driver.rs
├── lib.rs
├── nvptx.rs
├── nvvm.rs
├── runtime.rs

This is a precursor to adding other CUDA library bindings, like nvJPEG and cudaFFT.

…cust_raw`'s crates

- Allow list files instead of types/var/functions.
- Split out type headers from runtime/cublas to their own crates.
- Drop sys prefix from internal crates.
@adamcavendish
Copy link
Contributor

The _sys suffix was originally used because it was a bindgen generated system bindings. I propose that we should align with the community and call them -sys packages.

@jorge-ortega
Copy link
Collaborator Author

The convention tends to only apply to the top-level crate name, not the crates inside of it. The raw in cust_raw kinda conveys what sys is supposed to (there be bindings in here), so if you consider that it comes off a bit redundant:

import cust_raw::driver_sys
            ^           ^_bindings, dammit!
            |_bindings

The important thing is users understand that the crate as a whole only contains bindings before they even add it as a dependency, which should make them gravitate to the higher-level crates.

Still hoping on hearing back from the owner of cuda-sys in #182.

@adamcavendish
Copy link
Contributor

The convention tends to only apply to the top-level crate name, not the crates inside of it. The raw in cust_raw kinda conveys what sys is supposed to (there be bindings in here), so if you consider that it comes off a bit redundant:

import cust_raw::driver_sys
            ^           ^_bindings, dammit!
            |_bindings

The important thing is users understand that the crate as a whole only contains bindings before they even add it as a dependency, which should make them gravitate to the higher-level crates.

Still hoping on hearing back from the owner of cuda-sys in #182.

Yeah, if we do can get the cuda-sys crate, I agree that we can drop the "-sys" suffix.

@LegNeato
Copy link
Contributor

I reached out to them over email.

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.

3 participants