Skip to content

Deprecate __getitem__ support in numba_dpex.kernel #790

@diptorupd

Description

@diptorupd

The numba_dpex.kernel decorator currently supports passing the global_size and local_size parameters while launching a kernel using the indexing operator ([] operator). Internally, it is implemented by overriding the __getitem__ function in the numba_dpex.compiler.KernelBase class.

The design is a legacy of how numba.cuda does it and we are mimicking their design.

However, IMO there are several problems with the design.

  • Programmers need to be careful that they enter the parameters in the right order.
  • The usage is not clean as it does not allow specifying the arguments as keywords.
  • It is not clear to users that the first argument that corresponds to the global range is required while the second argument corresponding to the local range is optional.

I am in favour of deprecating the feature in 0.19 (next release) and instead asking users to pass the global range and local range using keyword arguments. Of these the global range will be a required argument, but the local range will be optional.

Creating the issue to start a design discussion.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions