NVIDIA / cuda-python

CUDA Python Low-level Bindings
https://nvidia.github.io/cuda-python/
Other
859 stars 68 forks source link

`nvrtcCreateProgram` only accepts lists #72

Closed leofang closed 2 months ago

leofang commented 3 months ago

I think this is a defect likely in the codegen:

  File "/home/leof/dev/cuda_py/cuda/py/compiler.py", line 20, in __init__
    nvrtc.nvrtcCreateProgram(code.encode(), b"default", 0, (), ()))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Argument 'headers' has incorrect type (expected list, got tuple)

which hard-codes the argument types to be a list: https://github.com/NVIDIA/cuda-python/blob/b88592ae51c35af3bf1399a48d2180a6d9cec5cc/cuda/nvrtc.pyx.in#L203 We should do some housekeeping and check other such instances. We don't need to unnecessarily constrain the type of an iterable unless there's a good reason.

vzhurba01 commented 2 months ago

Fixed with 12.6 release, closing.