Skip to content

Commit a1c8909

Browse files
wsmosesgiordano
andauthored
Fix 5090 support (#1488)
* Fix 5090 support * Apply suggestion * fix --------- Co-authored-by: Mosè Giordano <[email protected]>
1 parent 24c2392 commit a1c8909

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

ext/ReactantCUDAExt.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,8 +1455,8 @@ end
14551455

14561456
function __init__()
14571457
if CUDA.functional() && !Reactant.precompiling()
1458-
target = CUDA._compiler_config(CUDA.device()).target
1459-
Reactant.Compiler.cubinChip[] = "sm_$(target.cap.major)$(target.cap.minor)"
1458+
cap = CUDA.capability(CUDA.device())
1459+
Reactant.Compiler.cubinChip[] = "sm_$(cap.major)$(cap.minor)"
14601460
end
14611461
return nothing
14621462
end

src/Compiler.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,8 +1375,9 @@ function cubinFeatures()
13751375
major, ver = divrem(ver, 1000)
13761376
minor, patch = divrem(ver, 10)
13771377
version = VersionNumber(major, minor, patch)
1378-
# From https://github.com/llvm/llvm-project/blob/106c483a102e1328f11e2b1d9398f4ad2826b59f/clang/lib/Driver/ToolChains/Cuda.cpp#L685
1378+
# From https://github.com/llvm/llvm-project/blob/b60aed6fbabc291a7afbcb460453f9dcdce76f34/clang/lib/Driver/ToolChains/Cuda.cpp#L686
13791379
cuver_map = Dict([
1380+
(128, 87),
13801381
(126, 85),
13811382
(125, 85),
13821383
(124, 84),
@@ -1401,7 +1402,7 @@ function cubinFeatures()
14011402
(90, 60),
14021403
])
14031404
mver = major * 10 + minor
1404-
if mver > 126
1405+
if !in(mver, keys(cuver_map))
14051406
return 86
14061407
end
14071408
ptx = cuver_map[mver]

test/ops.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ end
2323
@testset "add" begin
2424
a = Reactant.to_rarray([false, false, true, true])
2525
b = Reactant.to_rarray([false, true, false, true])
26-
@test [false, true, true, false] @jit Ops.add(a, b)
26+
@test [false, true, true, true] @jit Ops.add(a, b)
2727

2828
a = Reactant.to_rarray([1, 2, 3, 4])
2929
b = Reactant.to_rarray([5, 6, -7, -8])

0 commit comments

Comments
 (0)