Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduction to scalar (not array) fails #338

Open
AlexanderKalistratov opened this issue Nov 13, 2023 · 0 comments
Open

Reduction to scalar (not array) fails #338

AlexanderKalistratov opened this issue Nov 13, 2023 · 0 comments

Comments

@AlexanderKalistratov
Copy link
Contributor

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>):
....
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant