-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
MWE:
using StaticArrays: SVector, SMatrix
using Polyester: @batch
function test()
A = SMatrix{1, 2}(-160.12486538933146, 39.88422637822968)
x = SVector(-1.000000018394, -1.000000013424)
result_batch = zeros(2)
result_serial = zeros(2)
@batch for i in 1:2
result = A * x
result_batch[i] = result[1]
end
for i in 1:2
result = A * x
result_serial[i] = result[1]
end
@info "" result_batch.-result_serial
endTested on different architectures with Polyester v0.7.16:
julia> versioninfo()
Julia Version 1.11.5
Commit 760b2e5b739 (2025-04-14 06:53 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 128 × AMD Ryzen Threadripper 3990X 64-Core Processor
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, znver2)
Threads: 32 default, 0 interactive, 16 GC (on 128 virtual cores)
julia> test()
┌ Info:
│ result_batch .- result_serial =
│ 2-element Vector{Float64}:
│ -1.4210854715202004e-14
└ 0.0
julia> versioninfo()
Julia Version 1.11.5
Commit 760b2e5b739 (2025-04-14 06:53 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin24.0.0)
CPU: 10 × Apple M2 Pro
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
Threads: 6 default, 0 interactive, 3 GC (on 6 virtual cores)
julia> test()
┌ Info:
│ result_batch .- result_serial =
│ 2-element Vector{Float64}:
│ -1.4210854715202004e-14
└ 0.0
Happens both with --check-bounds=auto and --check-bounds=yes.
Metadata
Metadata
Assignees
Labels
No labels