From c91ca02f7a396847444ece11062e70d8722a1ff3 Mon Sep 17 00:00:00 2001 From: Michel Schanen Date: Tue, 21 Jul 2026 10:57:58 -0500 Subject: [PATCH 1/4] Make floating-point atomics work on the LLVM back-end path Two pieces, without which oneAPI.atomic_add!/atomic_sub! on Float32 fail on discrete GPUs (4 errors in device/intrinsics on an Arc A750): - use the SPIRVIntrinsics atomic-float-ops revision, whose atomic intrinsics lower properly instead of falling back to an unsupported runtime call ("unsupported call to an unknown function gpu_malloc"); - declare SPV_EXT_shader_atomic_float_add (and the relaxed-printf extension) for the LLVM SPIR-V back-end: extensions must be declared to permit the corresponding instructions during translation, and without them the atomic float instructions fail to translate. --- Project.toml | 5 +++++ src/compiler/compilation.jl | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d3f514fa..fdf82061 100644 --- a/Project.toml +++ b/Project.toml @@ -56,3 +56,8 @@ oneAPI_Support_jll = "0.10.0" [extras] libigc_jll = "94295238-5935-5bd7-bb0f-b00942e9bdd5" + +[sources] +# Pin to a commit SHA, not the mutable `atomic-float-ops` branch head, so builds are +# reproducible and a force-push upstream cannot silently change what users resolve. +SPIRVIntrinsics = {url = "https://github.com/michel2323/OpenCL.jl", rev = "4257d4075162276d9985168923788490e4071e9e", subdir = "lib/intrinsics"} diff --git a/src/compiler/compilation.jl b/src/compiler/compilation.jl index 5a398a65..928c1de9 100644 --- a/src/compiler/compilation.jl +++ b/src/compiler/compilation.jl @@ -328,7 +328,14 @@ end # advertise the extension). We lower bfloat→i16 in finish_ir! when needed. supports_bfloat16 = _device_supports_bfloat16(dev) - extensions = String[] + # SPIR-V extensions the LLVM back-end may emit. Declaring them permits the + # corresponding instructions during translation: without + # SPV_EXT_shader_atomic_float_add, floating-point atomic operations fail to + # translate ("The atomic float instruction requires ... SPV_EXT_shader_atomic_float_add"). + extensions = String[ + "SPV_EXT_relaxed_printf_string_address_space", + "SPV_EXT_shader_atomic_float_add", + ] # Only add the SPIR-V extension if the runtime actually supports it if _driver_supports_bfloat16_spirv(dev) push!(extensions, "SPV_KHR_bfloat16") From 2b571e8ab04dca0c78b5a5f8fbd8bc4d1c4ae60e Mon Sep 17 00:00:00 2001 From: Michel Schanen Date: Thu, 30 Jul 2026 09:57:00 -0500 Subject: [PATCH 2/4] Test wtih JuliaGPU/OpenCL.jl#main --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index fdf82061..f00980de 100644 --- a/Project.toml +++ b/Project.toml @@ -60,4 +60,4 @@ libigc_jll = "94295238-5935-5bd7-bb0f-b00942e9bdd5" [sources] # Pin to a commit SHA, not the mutable `atomic-float-ops` branch head, so builds are # reproducible and a force-push upstream cannot silently change what users resolve. -SPIRVIntrinsics = {url = "https://github.com/michel2323/OpenCL.jl", rev = "4257d4075162276d9985168923788490e4071e9e", subdir = "lib/intrinsics"} +SPIRVIntrinsics = {url = "https://github.com/JuliaGPU/OpenCL.jl", rev = "main", subdir = "lib/intrinsics"} From 4a530f209dfd7aeb587406b2dec65052e02831ea Mon Sep 17 00:00:00 2001 From: Michel Schanen Date: Sat, 1 Aug 2026 15:23:22 -0500 Subject: [PATCH 3/4] Use release SPIRVIntrinsics --- Project.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/Project.toml b/Project.toml index f00980de..d3f514fa 100644 --- a/Project.toml +++ b/Project.toml @@ -56,8 +56,3 @@ oneAPI_Support_jll = "0.10.0" [extras] libigc_jll = "94295238-5935-5bd7-bb0f-b00942e9bdd5" - -[sources] -# Pin to a commit SHA, not the mutable `atomic-float-ops` branch head, so builds are -# reproducible and a force-push upstream cannot silently change what users resolve. -SPIRVIntrinsics = {url = "https://github.com/JuliaGPU/OpenCL.jl", rev = "main", subdir = "lib/intrinsics"} From c487a8ebb2f86728bb986be797a31dc637892bac Mon Sep 17 00:00:00 2001 From: Michel Schanen Date: Sat, 1 Aug 2026 15:24:51 -0500 Subject: [PATCH 4/4] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d3f514fa..20bf5ddc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "oneAPI" uuid = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b" authors = ["Tim Besard ", "Alexis Montoison", "Michel Schanen "] -version = "2.7.2" +version = "2.7.3" [deps] AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"