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

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

Conversation

jorge-ortega
Copy link
Collaborator

@jorge-ortega jorge-ortega commented Apr 15, 2025

  • Allow list files instead of types/var/functions.
  • Split out type headers from runtime/cublas to their own crate.

This restructures cust_raw to the following:

src/
├── cublas_sys/        # 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_sys.rs
├── lib.rs
├── nvptx-compiler_sys.rs
├── nvvm_sys.rs
├── runtime_sys.rs

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

@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.

…cust_raw`'s crates

- Allow list files instead of types/var/functions.
- Split out type headers from runtime/cublas to their own crates.
@jorge-ortega
Copy link
Collaborator Author

I'm splitting out the module renames from this change and will open a separate PR for that. This should now contain just the restructuring and new type bindings.

Clippy seems to be building the examples and is now failing during LTO. I don't repro this on windows or in ubuntu24 devcontainer.

@jorge-ortega jorge-ortega marked this pull request as ready for review April 22, 2025 06:29
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