Skip to content

[FEA] Constant lists currently not implemented #580

@brandon-b-miller

Description

@brandon-b-miller

We currently lack the ability to freeze a list in as constant memory:

from numba import cuda
import numpy as np

lst = [1,2,3]

@cuda.jit
def kernel():
    result = np.percentile(lst, 50)
    print(result)

kernel[1,1]()
    raise errors.NumbaNotImplementedError(f"{self}, {sig}")
numba.cuda.core.errors.NumbaNotImplementedError: Failed in cuda mode pipeline (step: cuda native lowering)
<numba.cuda.core.base.OverloadSelector object at 0x7ff724f9ecf0>, (List(int64, True),)
During: lowering "$34load_global.3 = global(lst: [1, 2, 3])" at /home/nfs/brmiller/repro.py (8)
During: Pass cuda_native_lowering

This should work like it does for numpy arrays with the list frozen into the kernel. In the future it may need to be transformed into an persistent 1D device array once we stop moving global arrays of arbitrary length into constant memory, xref numba/numba#9084

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions