Skip to content

applying map to each index results in Scalar Indexing is Disallowed Error #1618

@ctessum

Description

@ctessum

Hello!

I have some code that uses a pattern like this:

using Reactant

input1 = Reactant.ConcreteRArray(rand(10))
input2 = Reactant.ConcreteRArray(rand(10))

function fff(i, x, y)
    c = max(x[i], y[i])
    x[i] + y[i] + c
end
function mctr(f, range, x, y)
    f2(i) = f(i, x, y)
    map(f2, range)
end

f = @compile mctr(fff, 1:10, input1, input2)

The code above gives the error "Scalar Indexing is Disallowed". However, this type of pattern works fine when using AcceleratedKernels.jl. Is this something that Reactant would at some point be expected to support? Apologies if this is a dumb question!

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