JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Handle moving operations in reductions

Đang mở
#151 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Julia
Star
789
Fork
73
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

This either `UndefVarError`s or (with a reordering in lowering) produces the wrong answer:
```julia
function doubleadd_loop_avxtest(x,a)
s = zero(eltype(x))
@avx for i in 1:length(x)
s += 2*x[i] + a
end
return s
end
```
because it transforms this into something like
```julia
stemp = s + a
for i in ...
sreduct = 2*x[i] + stemp
end
```
Where
1. `sreduct` isn't being accumulated across the loop's iterations.
2. `a` (after being hoisted out) is missing a constant multiple of `length(x) / W` where `W` is the SIMD vector width.

I should address both of these issues.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Start with the @avx reduction and lowering paths, using the doubleadd_loop_avxtest example in the issue to reproduce the failure. Trace how the reduction and hoisted a are transformed; done means the reduction accumulates across iterations and the hoisted value includes the required multiple of length(x) / W.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
julia
Lĩnh vực
compilers, performance
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
42/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.