cuda-python icon indicating copy to clipboard operation
cuda-python copied to clipboard

Allow user-provided annotation for kernels generated from `Program` and`ObjectCode`

Open leofang opened this issue 3 months ago • 1 comments

We have examples like this today

kernel = module.get_kernel("vectorAdd<float>")

which does not tell us what args are expected on the device side, and so when launch(s, config, kernel, ...) is called we cannot do type checking for users.

leofang avatar Nov 20 '25 22:11 leofang

During the meeting the preliminary idea is to allow users to (optionally) register

  • C/C++ types on the device side
  • Python types on the host side

similar to what cffi does today, ex: https://github.com/NVIDIA/cuda-python/blob/b347255fc142fa49a6155720d66ec23101f1eaa7/cuda_core/examples/strided_memory_view_cpu.py#L98

We still want to be able to keep the fast path that Python int can be interpreted as pointer addresses.

leofang avatar Nov 21 '25 04:11 leofang