Skip to content

Errors with certain simple for loop #483

Open
@junyuan-chen

Description

@junyuan-chen

Depending on how the index ranges are specified, there are a few cases in which I get unexpected errors.

For example, I am getting errors on something like this:

using LoopVectorization
a = zeros(3,2)
N = 2
@turbo thread=true for i in 1:1, j in 1:N
    a[i,j] += 1.0
end
ERROR: MethodError: no method matching vmul_nw(::Int64)

The following also errors:

v = zeros(3)
N1 = 1
N2 = 3
@turbo thread=true for i in 1:N2, j in 1:N1
    v[i,j] += 1.0
end
ERROR: BoundsError: attempt to access 1-element Vector{Any} at index [2]

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