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 @@ -41,7 +41,7 @@ Adapt = "4"
CEnum = "0.5, 1"
Crayons = "4"
GPUArrays = "12.1"
GPUCompiler = "2.24"
GPUCompiler = "2.26"
GPUToolbox = "3.7"
IntelITT = "0.2"
KernelAbstractions = "0.10"
Expand Down
44 changes: 44 additions & 0 deletions test/execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,50 @@ end
@test Array(out) == [0, 10, 20, 30, 0, 10, 20, 30]
end

@testset "#783: 128-bit integers" begin
# SPIR-V has none, and the Khronos translator crashes on them instead of failing
function f(x)
x[1] *= x[1]
return
end
@test_throws oneAPI.InvalidIRError @oneapi f(oneArray(Int128[3]))
end

@static if isdefined(Core, :BFloat16)
if oneAPI.compiler_config(device()).target.supports_bfloat16
@testset "#783: BFloat16 arithmetic" begin
n = 1024
a = Core.BFloat16.(100 .* randn(Float32, n))
b = Core.BFloat16.(100 .* randn(Float32, n))
da, db = oneArray(a), oneArray(b)

# IGC used to round the results of bf16 instructions towards zero
function binary(y, op, a, b)
i = get_global_id()
@inbounds y[i] = op(a[i], b[i])
return
end
dy = similar(da)
@testset "$op" for op in (+, -, *, /)
@oneapi items=256 groups=n÷256 binary(dy, op, da, db)
@test Array(dy) == op.(a, b)
end

# ... and applied `abs` to the bits of the bf16 value it converted to Float32
function unary(y, op, a)
i = get_global_id()
@inbounds y[i] = op(Float32(a[i]))
return
end
dy = oneArray{Float32}(undef, n)
@testset "$op" for op in (-, abs)
@oneapi items=256 groups=n÷256 unary(dy, op, da)
@test Array(dy) == op.(Float32.(a))
end
end
end
end

@testset "#160: barrier intrinsincs should be convergent" begin
# Solve L*x = r and store the result in r.
function cpu(n::Int, r::Vector{Float32})
Expand Down
Loading