When running julia with --check-bounds=no something goes wrong with Bumper. It should be noted in the docs.
The MWE is the example from the docs:
using Bumper
using BenchmarkTools
using StrideArrays
function f(x)
# Set up a scope where memory may be allocated, and does not escape:
@no_escape begin
# Allocate a `PtrArray` (see StrideArraysCore.jl) using memory from the default buffer.
y = @alloc(eltype(x), length(x))
# Now do some stuff with that vector:
y .= x .+ 1
sum(y) # It's okay for the sum of y to escape the block, but references to y itself must not do so!
end
end
@benchmark f(x) setup=(x = rand(1:10, 30))
Starting julia with --check-bounds=auto I get this output:
When running julia with
--check-bounds=no
something goes wrong withBumper
. It should be noted in the docs.The MWE is the example from the docs:
Starting julia with
--check-bounds=auto
I get this output:With
--check-bounds=no
it is quite a bit slower, and allocating:Julia Version 1.12.0-DEV.606 Commit 6f569c7ba0* (2024-05-27 08:27 UTC) Platform Info: OS: Linux (x86_64-linux-gnu) CPU: 24 × AMD Ryzen Threadripper PRO 5945WX 12-Cores WORD_SIZE: 64 LLVM: libLLVM-17.0.6 (ORCJIT, znver3) Threads: 24 default, 0 interactive, 24 GC (on 24 virtual cores) Environment: JULIA_NUM_THREADS = auto JULIA_EDITOR = emacs -nw