Skip to content

Constify @Const arguments when launching instead of in the kernel - #872

Merged
vchuravy merged 2 commits into
mainfrom
tb/const-at-launch
Oct 11, 2026
Merged

vchuravy merged 2 commits into
mainfrom
tb/const-at-launch

Conversation

@maleadt

@maleadt maleadt commented Oct 11, 2026 •

Copy link
Copy Markdown
Member

@Const(B) used to expand to B = constify(B) at the top of the kernel body, so Adapt.jl's rules for whatever B contains ran in device code. Several of those rules rebuild wrappers through Base constructors that validate their arguments and format the error message eagerly ("length cannot be negative, got $len"), which doesn't compile for GPUs. #867 hits this with a StepRangeLen, which Oceananigans grids carry and GPUArrays' reductions pass as @Const:

@kernel function copy_range!(dst, @Const(r))
    i = @index(Global)
    @inbounds dst[i] = r[i]
end
copy_range!(backend)(dst, StepRangeLen(0f0, 0.5f0, 16); ndrange=16)
# ERROR: InvalidIRError: ... unsupported call to the Julia runtime (call to __sigsetjmp)

This fails on POCL and Metal; LinRange fails on CUDA too (CUDA.jl only happens to override StepRangeLen's constructor). #793 already had to add device-safe rules for reshaped and permuted arrays, and AcceleratedKernels dropped @Const from its mapreduce for the same reason.

Running constify in the kernel goes back to the old CPU backend, which needed Base.Experimental.Const inside an @aliasscope in the same function; nothing requires it anymore since #785. So this PR constifies @Const arguments when launching instead, as CUDA (const __restrict__), SYCL (read accessors) and Kokkos (View<const T, RandomAccess>) put read-only-ness in the argument's type at the launch boundary:

  • The launch wraps @Const arguments in a ConstArg, whose Adapt rule constifies the argument after the backend converted it. Adapt's rules now run on the host, where validation is harmless, and the backend still does its own conversion (and memory tracking). This requires a backend's argument conversion to recurse with Adapt.jl, which all of them do; the backend notes now say so.
  • To know which arguments to wrap, the launch calls the kernel function with ConstArgs() in place of the context. Every kernel method starts by answering that with its @Const mask, so the answer comes from the method the converted arguments dispatch to, and the check folds away for the real context. Separate metadata methods would not work for kernels defined in local scope (global definitions aren't allowed there, and extra methods box the closure, Do not capture recursive local function's self-identifier (to avoid box) JuliaLang/julia#53295). Default arguments get explicit forwarding methods that answer before evaluating the next default, so that defaults are only evaluated on the device.

The kernel body sees the same constified types as before. Since the old expansion re-asserted an argument's type annotation on the constified value (B::T = constify(B::T)), annotations on @Const arguments already had to accept the read-only type, so dispatch doesn't change for kernels that worked; the ones that change are those that failed before (e.g. @Const(B::P) where {P}). Which arguments are @Const is decided by the method the arguments select before being constified, so kernel methods that dispatch on the read-only type aren't supported; the docstring says so. A generated=true kernel's generator now sees the read-only type for @Const arguments, as the body already did. @Const on varargs, which didn't work before, is now rejected when expanding the kernel.

The first commit fixes device-side reinterpret on POCL, found along the way: it referred to GPUArrays' _reinterpret_exception without depending on GPUArrays (#869).

Tested with the full test suite on POCL, CUDA.jl's and Metal.jl's (on an M1) ka-0.10 KernelAbstractions tests, with the new range tests failing on main (POCL, Metal) and passing here. The per-backend constructor quirks that would make these ranges work when constructed in device code are tracked in JuliaGPU/GPUToolbox.jl#29.

Fixes #867, fixes #869

The POCL device array code came from OpenCL.jl, where `reinterpret`
validates its arguments with `GPUArrays._reinterpret_exception`.
KernelAbstractions doesn't depend on GPUArrays, so the call referred to
an undefined name and every kernel using `reinterpret` failed to
compile. Inline the same checks; the thrown value is dropped on the
device anyway.

Fixes #869
`@Const(B)` expanded to `B = constify(B)` at the top of the kernel body,
so Adapt.jl's rules for whatever the argument contained ran in device
code. Several of them rebuild wrappers through constructors that check
their arguments and format the error message eagerly, which doesn't
compile for GPUs: passing a `StepRangeLen` or `LinRange` as `@Const`
failed on POCL, Metal and (for `LinRange`) CUDA, and #793 had to add
device-safe rules for reshaped and permuted arrays.

Instead, the launch wraps `@Const` arguments in a `ConstArg`, whose Adapt
rule constifies the argument after the backend converted it. Adapt's
rules now run on the host, and the backend still does its own
conversion (and e.g. memory tracking). To find out which arguments to
wrap, the launch calls the kernel function with `ConstArgs()` in place of
the context: every kernel method starts by answering that with its mask,
so the answer comes from the method the converted arguments dispatch to,
and the check folds away for the actual context. Default arguments get
explicit forwarding methods that answer before evaluating the defaults.

The kernel sees the same constified types as before, so annotations on
`@Const` arguments, which already had to accept them, keep working.
`@Const` on varargs, which did not work before, is now rejected when
expanding the kernel.

Fixes #867
@maleadt
maleadt force-pushed the tb/const-at-launch branch from 1f57668 to f95ae43 Compare October 11, 2026 09:23
@github-actions

github-actions Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results

Show table
main f95ae43... main / f95ae43...
const/@Const/Float32/262144 0.289 ± 0.011 ms 0.293 ± 0.011 ms 0.986 ± 0.052
const/@Const/Float32/65536 0.0893 ± 0.0035 ms 0.0882 ± 0.0033 ms 1.01 ± 0.056
const/@Const/Float64/262144 0.572 ± 0.012 ms 0.58 ± 0.022 ms 0.985 ± 0.043
const/@Const/Float64/65536 0.164 ± 0.007 ms 0.174 ± 0.015 ms 0.94 ± 0.092
const/unmarked/Float32/262144 0.419 ± 0.017 ms 0.473 ± 0.012 ms 0.886 ± 0.042
const/unmarked/Float32/65536 0.124 ± 0.0087 ms 0.12 ± 0.0047 ms 1.03 ± 0.083
const/unmarked/Float64/262144 0.841 ± 0.029 ms 0.888 ± 0.022 ms 0.947 ± 0.04
const/unmarked/Float64/65536 0.205 ± 0.0086 ms 0.208 ± 0.011 ms 0.985 ± 0.065
launch/3D static workgroup, dynamic ndrange 6.89 ± 1 μs 7.08 ± 1 μs 0.973 ± 0.2
launch/3D static workgroup, static ndrange 7.64 ± 1.2 μs 7.93 ± 1 μs 0.963 ± 0.2
launch/dynamic workgroup, dynamic ndrange 7.61 ± 1.1 μs 8.22 ± 1 μs 0.926 ± 0.18
launch/dynamic workgroup, dynamic ndrange, workgroupsize given 7.67 ± 0.96 μs 8.24 ± 1.1 μs 0.931 ± 0.17
launch/static workgroup, dynamic ndrange 7.62 ± 1.1 μs 8.12 ± 0.94 μs 0.939 ± 0.18
launch/static workgroup, static ndrange 7.24 ± 1 μs 7.82 ± 1.5 μs 0.926 ± 0.22
partition/dynamic workgroup, dynamic ndrange 0.0335 ± 0.0068 μs 0.0351 ± 0.017 μs 0.952 ± 0.49
partition/static workgroup, dynamic ndrange 0.034 ± 0.0082 μs 0.0362 ± 0.0087 μs 0.94 ± 0.32
partition/static workgroup, static ndrange 1.63 ± 0.03 ns 1.63 ± 0.001 ns 0.999 ± 0.018
saxpy/default/Float16/1024 7.64 ± 0.86 μs 8.11 ± 1 μs 0.943 ± 0.16
saxpy/default/Float16/1048576 0.296 ± 0.032 ms 0.352 ± 0.051 ms 0.839 ± 0.15
saxpy/default/Float16/16384 13.6 ± 0.82 μs 14.9 ± 1.2 μs 0.913 ± 0.091
saxpy/default/Float16/2048 7.68 ± 0.96 μs 8.93 ± 0.8 μs 0.86 ± 0.13
saxpy/default/Float16/256 7.38 ± 0.33 μs 8.57 ± 1.2 μs 0.861 ± 0.12
saxpy/default/Float16/262144 0.0887 ± 0.031 ms 0.101 ± 0.013 ms 0.881 ± 0.33
saxpy/default/Float16/32768 17.7 ± 0.75 μs 18.3 ± 1.3 μs 0.967 ± 0.078
saxpy/default/Float16/4096 8.11 ± 0.8 μs 8.87 ± 1.2 μs 0.915 ± 0.16
saxpy/default/Float16/512 7.62 ± 0.19 μs 9.09 ± 1.9 μs 0.838 ± 0.18
saxpy/default/Float16/64 7.79 ± 0.16 μs 8.81 ± 0.39 μs 0.884 ± 0.043
saxpy/default/Float16/65536 25.5 ± 1.1 μs 27.9 ± 2.1 μs 0.913 ± 0.079
saxpy/default/Float32/1024 7.39 ± 1.1 μs 7.91 ± 1.2 μs 0.934 ± 0.2
saxpy/default/Float32/1048576 0.249 ± 0.034 ms 0.341 ± 0.078 ms 0.729 ± 0.19
saxpy/default/Float32/16384 10 ± 2.1 μs 10.9 ± 2.2 μs 0.921 ± 0.27
saxpy/default/Float32/2048 8.36 ± 2.2 μs 8.17 ± 1.3 μs 1.02 ± 0.32
saxpy/default/Float32/256 7.67 ± 0.29 μs 7.76 ± 0.2 μs 0.988 ± 0.045
saxpy/default/Float32/262144 0.0814 ± 0.033 ms 0.101 ± 0.02 ms 0.804 ± 0.36
saxpy/default/Float32/32768 11.5 ± 2.1 μs 17.4 ± 1.8 μs 0.661 ± 0.14
saxpy/default/Float32/4096 7.58 ± 0.78 μs 8.46 ± 1.9 μs 0.896 ± 0.23
saxpy/default/Float32/512 7.52 ± 1.1 μs 10.1 ± 0.39 μs 0.747 ± 0.11
saxpy/default/Float32/64 7.8 ± 1.1 μs 7.82 ± 0.22 μs 0.997 ± 0.14
saxpy/default/Float32/65536 24.3 ± 6.7 μs 25.6 ± 3.7 μs 0.949 ± 0.29
saxpy/default/Float64/1024 7.49 ± 0.81 μs 9.28 ± 2.3 μs 0.808 ± 0.22
saxpy/default/Float64/1048576 0.634 ± 0.15 ms 0.792 ± 0.18 ms 0.8 ± 0.26
saxpy/default/Float64/16384 16.4 ± 1.3 μs 16.7 ± 1.6 μs 0.979 ± 0.12
saxpy/default/Float64/2048 8.56 ± 2.2 μs 8.5 ± 2.4 μs 1.01 ± 0.38
saxpy/default/Float64/256 7.32 ± 0.85 μs 8.05 ± 2.2 μs 0.909 ± 0.27
saxpy/default/Float64/262144 0.146 ± 0.017 ms 0.165 ± 0.021 ms 0.885 ± 0.15
saxpy/default/Float64/32768 21.7 ± 2.7 μs 24.2 ± 3.1 μs 0.897 ± 0.16
saxpy/default/Float64/4096 9.1 ± 2.5 μs 9.16 ± 1.2 μs 0.994 ± 0.31
saxpy/default/Float64/512 7.03 ± 0.67 μs 8.21 ± 2.2 μs 0.857 ± 0.24
saxpy/default/Float64/64 7.69 ± 1 μs 8.08 ± 1.1 μs 0.951 ± 0.18
saxpy/default/Float64/65536 0.0383 ± 0.02 ms 0.0375 ± 0.015 ms 1.02 ± 0.67
saxpy/static workgroup=(1024,)/Float16/1024 8.21 ± 2.2 μs 8.36 ± 0.99 μs 0.982 ± 0.29
saxpy/static workgroup=(1024,)/Float16/1048576 0.319 ± 0.045 ms 0.391 ± 0.07 ms 0.816 ± 0.19
saxpy/static workgroup=(1024,)/Float16/16384 14.4 ± 1.3 μs 14.5 ± 0.77 μs 0.988 ± 0.11
saxpy/static workgroup=(1024,)/Float16/2048 7.87 ± 0.92 μs 8.85 ± 2.3 μs 0.889 ± 0.26
saxpy/static workgroup=(1024,)/Float16/256 7.6 ± 0.29 μs 8.19 ± 0.96 μs 0.928 ± 0.11
saxpy/static workgroup=(1024,)/Float16/262144 0.0968 ± 0.038 ms 0.0988 ± 0.0099 ms 0.98 ± 0.39
saxpy/static workgroup=(1024,)/Float16/32768 17.9 ± 0.89 μs 19.4 ± 1.4 μs 0.926 ± 0.079
saxpy/static workgroup=(1024,)/Float16/4096 8.4 ± 1.1 μs 9.63 ± 2.3 μs 0.872 ± 0.24
saxpy/static workgroup=(1024,)/Float16/512 7.8 ± 0.37 μs 8.02 ± 0.24 μs 0.973 ± 0.055
saxpy/static workgroup=(1024,)/Float16/64 8.92 ± 1.3 μs 8.02 ± 0.18 μs 1.11 ± 0.16
saxpy/static workgroup=(1024,)/Float16/65536 25.1 ± 1.6 μs 28.5 ± 1.9 μs 0.88 ± 0.081
saxpy/static workgroup=(1024,)/Float32/1024 7.13 ± 0.74 μs 8.43 ± 0.79 μs 0.846 ± 0.12
saxpy/static workgroup=(1024,)/Float32/1048576 0.253 ± 0.04 ms 0.341 ± 0.051 ms 0.744 ± 0.16
saxpy/static workgroup=(1024,)/Float32/16384 8.78 ± 1.4 μs 9.86 ± 1.2 μs 0.89 ± 0.18
saxpy/static workgroup=(1024,)/Float32/2048 7.7 ± 0.84 μs 8.02 ± 1.2 μs 0.96 ± 0.18
saxpy/static workgroup=(1024,)/Float32/256 7.26 ± 0.17 μs 8.47 ± 1.3 μs 0.857 ± 0.13
saxpy/static workgroup=(1024,)/Float32/262144 0.0811 ± 0.033 ms 0.0966 ± 0.019 ms 0.84 ± 0.37
saxpy/static workgroup=(1024,)/Float32/32768 16.4 ± 1.5 μs 17.7 ± 1.9 μs 0.928 ± 0.13
saxpy/static workgroup=(1024,)/Float32/4096 7.99 ± 1.3 μs 8.09 ± 1 μs 0.988 ± 0.2
saxpy/static workgroup=(1024,)/Float32/512 7.88 ± 2 μs 8.04 ± 0.86 μs 0.98 ± 0.27
saxpy/static workgroup=(1024,)/Float32/64 7.77 ± 0.16 μs 7.9 ± 0.21 μs 0.985 ± 0.033
saxpy/static workgroup=(1024,)/Float32/65536 25.9 ± 5.1 μs 25.6 ± 3.7 μs 1.01 ± 0.25
saxpy/static workgroup=(1024,)/Float64/1024 7.88 ± 1.1 μs 8.27 ± 0.94 μs 0.953 ± 0.18
saxpy/static workgroup=(1024,)/Float64/1048576 0.541 ± 0.14 ms 0.859 ± 0.19 ms 0.629 ± 0.21
saxpy/static workgroup=(1024,)/Float64/16384 12.4 ± 1.9 μs 17.4 ± 1.8 μs 0.709 ± 0.13
saxpy/static workgroup=(1024,)/Float64/2048 8.1 ± 1.1 μs 8.83 ± 1 μs 0.917 ± 0.17
saxpy/static workgroup=(1024,)/Float64/256 7.49 ± 0.85 μs 7.89 ± 1.1 μs 0.95 ± 0.17
saxpy/static workgroup=(1024,)/Float64/262144 0.141 ± 0.014 ms 0.171 ± 0.025 ms 0.826 ± 0.15
saxpy/static workgroup=(1024,)/Float64/32768 23.3 ± 5.1 μs 25.8 ± 4.5 μs 0.904 ± 0.25
saxpy/static workgroup=(1024,)/Float64/4096 7.92 ± 0.77 μs 9.04 ± 0.98 μs 0.876 ± 0.13
saxpy/static workgroup=(1024,)/Float64/512 7.84 ± 2.3 μs 9.22 ± 2.7 μs 0.851 ± 0.36
saxpy/static workgroup=(1024,)/Float64/64 7.83 ± 0.28 μs 8.13 ± 0.31 μs 0.963 ± 0.051
saxpy/static workgroup=(1024,)/Float64/65536 0.0466 ± 0.019 ms 0.039 ± 0.018 ms 1.19 ± 0.72
time_to_load 0.348 ± 0.01 s 0.382 ± 0.018 s 0.91 ± 0.05
main f95ae43... main / f95ae43...
const/@Const/Float32/262144 9 allocs: 0.203 kB 9 allocs: 0.203 kB 1
const/@Const/Float32/65536 9 allocs: 0.203 kB 9 allocs: 0.203 kB 1
const/@Const/Float64/262144 9 allocs: 0.203 kB 9 allocs: 0.203 kB 1
const/@Const/Float64/65536 9 allocs: 0.203 kB 9 allocs: 0.203 kB 1
const/unmarked/Float32/262144 9 allocs: 0.203 kB 9 allocs: 0.203 kB 1
const/unmarked/Float32/65536 9 allocs: 0.203 kB 9 allocs: 0.203 kB 1
const/unmarked/Float64/262144 9 allocs: 0.203 kB 9 allocs: 0.203 kB 1
const/unmarked/Float64/65536 9 allocs: 0.203 kB 9 allocs: 0.203 kB 1
launch/3D static workgroup, dynamic ndrange 9 allocs: 0.219 kB 9 allocs: 0.219 kB 1
launch/3D static workgroup, static ndrange 9 allocs: 0.219 kB 9 allocs: 0.219 kB 1
launch/dynamic workgroup, dynamic ndrange 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
launch/dynamic workgroup, dynamic ndrange, workgroupsize given 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
launch/static workgroup, dynamic ndrange 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
launch/static workgroup, static ndrange 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
partition/dynamic workgroup, dynamic ndrange 2 allocs: 0.0625 kB 2 allocs: 0.0625 kB 1
partition/static workgroup, dynamic ndrange 2 allocs: 32 B 2 allocs: 32 B 1
partition/static workgroup, static ndrange 0 allocs: 0 B 0 allocs: 0 B
saxpy/default/Float16/1024 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float16/1048576 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/default/Float16/16384 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float16/2048 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float16/256 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/default/Float16/262144 8 allocs: 0.141 kB 12 allocs: 0.25 kB 0.562
saxpy/default/Float16/32768 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float16/4096 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float16/512 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float16/64 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/default/Float16/65536 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float32/1024 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float32/1048576 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/default/Float32/16384 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float32/2048 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float32/256 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/default/Float32/262144 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float32/32768 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float32/4096 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float32/512 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float32/64 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/default/Float32/65536 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float64/1024 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float64/1048576 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/default/Float64/16384 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float64/2048 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float64/256 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/default/Float64/262144 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/default/Float64/32768 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float64/4096 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float64/512 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/default/Float64/64 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/default/Float64/65536 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float16/1024 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float16/1048576 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/static workgroup=(1024,)/Float16/16384 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float16/2048 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float16/256 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/static workgroup=(1024,)/Float16/262144 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/static workgroup=(1024,)/Float16/32768 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float16/4096 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float16/512 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float16/64 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/static workgroup=(1024,)/Float16/65536 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float32/1024 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float32/1048576 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/static workgroup=(1024,)/Float32/16384 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float32/2048 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float32/256 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/static workgroup=(1024,)/Float32/262144 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float32/32768 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float32/4096 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float32/512 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float32/64 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/static workgroup=(1024,)/Float32/65536 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float64/1024 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float64/1048576 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/static workgroup=(1024,)/Float64/16384 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float64/2048 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float64/256 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/static workgroup=(1024,)/Float64/262144 12 allocs: 0.25 kB 12 allocs: 0.25 kB 1
saxpy/static workgroup=(1024,)/Float64/32768 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float64/4096 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float64/512 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
saxpy/static workgroup=(1024,)/Float64/64 5 allocs: 0.0938 kB 5 allocs: 0.0938 kB 1
saxpy/static workgroup=(1024,)/Float64/65536 8 allocs: 0.141 kB 8 allocs: 0.141 kB 1
time_to_load 0.2 k allocs: 11.8 kB 0.2 k allocs: 11.8 kB 1

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

@codecov

codecov Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.47619% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.49%. Comparing base (1c2be35) to head (f95ae43).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/macros.jl 83.78% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #872      +/-   ##
==========================================
+ Coverage   79.89%   80.49%   +0.60%     
==========================================
  Files          26       26              
  Lines        2149     2210      +61     
==========================================
+ Hits         1717     1779      +62     
+ Misses        432      431       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maleadt
maleadt requested a review from vchuravy October 11, 2026 11:00
@vchuravy

Copy link
Copy Markdown
Member

Also matches well with JuliaGPU/GPUCompiler.jl#1002

@vchuravy
vchuravy merged commit f34a52b into main Oct 11, 2026
69 checks passed
@vchuravy
vchuravy deleted the tb/const-at-launch branch October 11, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

POCL: reinterpret of a device array refers to undefined _reinterpret_exception @Const argument containing a StepRangeLen does not compile on the GPU

2 participants