Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ CEnum = "0.4, 0.5"
ExprTools = "0.1"
GPUArrays = "11.5.14"
GPUCompiler = "2.8"
GPUToolbox = "0.1, 0.2, 0.3, 1, 3"
GPUToolbox = "3.1"
KernelAbstractions = "0.9.39"
LLVM = "6, 7, 8, 9"
NEO_jll = "=26.18.38308"
Expand Down
12 changes: 10 additions & 2 deletions src/compiler/compilation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,16 @@ GPUCompiler.runtime_module(::oneAPICompilerJob) = oneAPI

GPUCompiler.kernel_state_type(::oneAPICompilerJob) = KernelState

GPUCompiler.method_table_view(job::oneAPICompilerJob) =
GPUCompiler.StackedMethodTable(job.world, method_table, SPIRVIntrinsics.method_table)
function GPUCompiler.method_table_view(job::oneAPICompilerJob)
if job.config.target.supports_fp64
parent = SPIRVIntrinsics.method_table
else
# keep single-precision math that Base computes in Float64 out of double precision
parent = GPUCompiler.StackedMethodTable(job.world, SPIRVIntrinsics.method_table,
GPUToolbox.Overlays.float64_overrides)
end
GPUCompiler.StackedMethodTable(job.world, method_table, parent)
end

# filter out OpenCL built-ins
# TODO: eagerly lower these using the translator API
Expand Down
4 changes: 0 additions & 4 deletions src/device/quirks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,4 @@ end
@inline
return checkindex(Bool, eachindex(IndexLinear(), v), i)
end

# Less accurate division for Float32 than Base Julia which relies on Float64
# https://github.com/JuliaLang/julia/pull/49637
@device_override Base.div(x::Float32, y::Float32) = trunc(x / y)
end
1 change: 1 addition & 0 deletions src/oneAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ using GPUArrays
using Adapt

using GPUCompiler
import GPUToolbox

import ExprTools

Expand Down
Loading