Skip to content

Commit 8f1bab4

Browse files
committed
Updated test lowering of float64
1 parent 5fa68d7 commit 8f1bab4

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

tests/python/unittest/test_target_codegen_llvm.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from tvm import te
2929
from tvm.contrib import clang, utils
3030
from tvm.relay.backend import Runtime
31-
from tvm.script import tir as T
31+
from tvm.script import tir as T, ir as I
3232
from tvm.target.codegen import llvm_get_intrinsic_name, llvm_lookup_intrinsic_id
3333

3434

@@ -1007,19 +1007,25 @@ def test_debug_symbol_for_float64():
10071007
"""Check that LLVM can define DWARF debug type for float64
10081008
10091009
In previous versions, only specific data types could exist in the
1010-
function signature. In this test, the "calling_conv" attribute
1011-
prevents lowering to the PackedFunc API.
1010+
function signature. In this test, the subroutine is a context
1011+
that isn't lowered to the PackedFunc API.
10121012
"""
10131013

1014-
@T.prim_func
1015-
def func(a: T.handle("float64"), b: T.handle("float64"), n: T.int64):
1016-
T.func_attr({"calling_conv": 2})
1017-
A = T.Buffer(16, "float64", data=a)
1018-
B = T.Buffer(16, "float64", data=b)
1019-
for i in range(n):
1020-
B[i] = A[i]
1021-
1022-
tvm.build(func, target="llvm")
1014+
@I.ir_module
1015+
class mod:
1016+
@T.prim_func
1017+
def main(A: T.Buffer(16, "float64"), B: T.Buffer(16, "float64")):
1018+
T.func_attr({"global_symbol": "main"})
1019+
mod.subroutine(A.data, B.data, T.int64(16))
1020+
1021+
@T.prim_func
1022+
def subroutine(a: T.handle("float64"), b: T.handle("float64"), n: T.int64):
1023+
A = T.Buffer(16, "float64", data=a)
1024+
B = T.Buffer(16, "float64", data=b)
1025+
for i in range(n):
1026+
B[i] = A[i]
1027+
1028+
tvm.build(mod, target="llvm")
10231029

10241030

10251031
if __name__ == "__main__":

0 commit comments

Comments
 (0)