Skip to content

Conversation

@nnethercote
Copy link
Collaborator

The #[kernel] proc macro has some code to allow "kernel hints" arguments like this:

    #[kernel(block_dim = 1d, grid_dim = 1d)]

This dates back to the very first rust-cuda commit. However...

  • The parsing code is broken. It requires an identifier after the =, and then checks that identifier has one of the following values: 1d, 1D, 2d, 2D, 3d, 3D. But those aren't valid identifiers because they start with a digit. So you can't actually write any kernel hints that the compiler will accept.

  • Even if the parsing succeeded, the hints are ignored, thanks to this: let _ = parse_macro_input!(input as KernelHints);

  • Unsurprisingly, there are no uses of these hints in the code.

This commit just removes the (broken) support for them.

The `#[kernel]` proc macro has some code to allow "kernel hints"
arguments like this:
```
    #[kernel(block_dim = 1d, grid_dim = 1d)]
```
This dates back to the very first rust-cuda commit. However...

- The parsing code is broken. It requires an identifier after the `=`,
  and then checks that identifier has one of the following values: `1d`,
  `1D`, `2d`, `2D`, `3d`, `3D`. But those aren't valid identifiers
  because they start with a digit. So you can't actually write any
  kernel hints that the compiler will accept.

- Even if the parsing succeeded, the hints are ignored, thanks to this:
  ```
  let _ = parse_macro_input!(input as KernelHints);
  ```
- Unsurprisingly, there are no uses of these hints in the code.

This commit just removes the (broken) support for them.
Copy link
Contributor

@LegNeato LegNeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is probably better as an arch intrinsic...

@LegNeato LegNeato added this pull request to the merge queue Dec 11, 2025
Merged via the queue into Rust-GPU:main with commit 44c44ba Dec 11, 2025
6 checks passed
@nnethercote nnethercote deleted the rm-KernelHints branch December 11, 2025 03:37
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.

2 participants