Skip to content

[FEA] Make block, thread, and warp indices unsigned #109

@gmarkall

Description

@gmarkall

Block, thread, and warp indices would ideally be unsigned, as in CUDA C/C++. This would:

  • Reduce computation and register usage (due to handling signs)
  • Align better with CUDA C/C++

However, due to Numba's typing it can result in float indices being generated rather than int ones (e.g unsigned + signed = float or something like that), or 32-bit values becoming 64-bit ones (as observed in numba/numba#6112 (comment))

This was started in numba/numba#6112 - completion of this PR would be sufficient to implement this feature request, but it may not be as simple as getting the test suite to behave identically - effects may be observed in more complex programs where types change.

An alternative path may be to define a separate type for thread indices that is more resistant to upcasting when used in computations, but the exact solution is unclear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions