Skip to content

Commit 27ad818

Browse files
committed
Support libdevice from CUDA 11.0.
1 parent 0e1195e commit 27ad818

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/ptx.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,10 @@ function nvvm_reflect!(fun::LLVM.Function)
427427
str = operands(call)[1]
428428
isa(str, LLVM.ConstantExpr) || error("Format of __nvvm__reflect function not recognized")
429429
sym = operands(str)[1]
430+
if isa(sym, LLVM.ConstantExpr) && opcode(sym) == LLVM.API.LLVMGetElementPtr
431+
# CUDA 11.0 or below
432+
sym = operands(sym)[1]
433+
end
430434
isa(sym, LLVM.GlobalVariable) || error("Format of __nvvm__reflect function not recognized")
431435
sym_op = operands(sym)[1]
432436
isa(sym_op, LLVM.ConstantArray) || error("Format of __nvvm__reflect function not recognized")

0 commit comments

Comments
 (0)