Skip to content

Reduction to scalar (not array) fails #338

Open
@AlexanderKalistratov

Description

@AlexanderKalistratov
from dpctl import tensor as np
from numba_mlir import njit
import numba
from numba import prange

size = 10*1000

@njit(parallel=True)
def foo(a):
    acc = 0
    for i in prange(size):
        acc += a[i]

    return acc

a = np.ones(size)
print(foo(a))

Output:

RuntimeError: Failed in nopython mode pipeline (step: <class 'numba_mlir.mlir.passes.MlirBackend'>)
MLIR pipeline failed
failed to legalize operation 'gpu.func'
see current operation:
"gpu.func"() <{function_type = (memref<?xf32>, memref<?xf64>) -> ()}> ({
^bb0(%arg0: memref<?xf32>, %arg1: memref<?xf64>):
....

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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