Skip to content

Commit b7ba416

Browse files
committed
fixup! [USMP] Adding support for U4 usecase
Change-Id: I9676b5198ae5485815ac601eb30d496d09f981ad
1 parent 1da8837 commit b7ba416

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/python/relay/aot/test_c_device_api.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
import numpy as np
2222
import pytest
23+
import re
2324

2425
from tvm import relay
2526
from tvm.ir.module import IRModule
@@ -133,7 +134,6 @@ def compile_to_main_func(interface_api="c", use_unpacked_api=True):
133134
def test_device_api_hooks_unpacked_api(device_api_main_func):
134135
"""Check for Device API hooks with unpacked internal calls"""
135136
main_func = device_api_main_func(interface_api="c", use_unpacked_api=True)
136-
input_name = main_func.params[0].name
137137

138138
# Activate Device
139139
assert (
@@ -150,12 +150,12 @@ def test_device_api_hooks_unpacked_api(device_api_main_func):
150150
+ " device_context_ethos_u))\n"
151151
)
152152
# Device Call
153-
assert (
154-
str(main_func.body[1][0][0][1])
155-
== "tir.tvm_check_return(0, -1, tir.call_extern("
156-
+ '"tvmgen_default_ethos_u_main_0",'
157-
+ f" {input_name}_buffer_var, output_buffer_var, device_context_ethos_u))\n"
153+
# We dont need to check exact input and output var names in this test.
154+
# Hence, using a regex to cover any legal I/O name.
155+
regex = re.compile(
156+
'tir\.tvm_check_return\(0, -1, tir\.call_extern\("tvmgen_default_ethos_u_main_0", \w+, \w+, device_context_ethos_u\)\)'
158157
)
158+
assert regex.match(str(main_func.body[1][0][0][1]))
159159
# Close Device
160160
assert (
161161
str(main_func.body[1][0][0][2])

0 commit comments

Comments
 (0)