Skip to content

[BUG] Importing cuda_models breaks StructModel usage #630

@brandon-b-miller

Description

@brandon-b-miller

importing import numba.cuda.datamodel.cuda_models as models causes subsequent kernel launches to fail.

from numba import cuda
from numba.cuda.types import int64, void
import numba.cuda.datamodel.cuda_models as models

@cuda.jit(void(int64[::1]))
def kernel(ary):
    print(ary[0])
TypeError: Not a structure model: <numba.cuda.datamodel.cuda_models.ArrayModel object at 0x7f95349116a0>

This appears to be due to a conflict between the numba.cuda StructModel class and the upstream version in a place they're not meant to coexist. It's possible that the module redirector hasn't had time to replace the values in the models namespace before something is being registered from the upstream namespace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions