Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Required fixes to run test suite on Max GPU #1451

Merged
merged 3 commits into from
May 7, 2024
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
1 change: 1 addition & 0 deletions numba_dpex/kernel_api_impl/spirv/spirv_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ def finalize(self):
"--spirv-ext=+SPV_EXT_shader_atomic_float_add",
"--spirv-ext=+SPV_EXT_shader_atomic_float_min_max",
"--spirv-ext=+SPV_INTEL_arbitrary_precision_integers",
"--spirv-ext=+SPV_INTEL_variable_length_array",
]
for key in list(self.context.extra_compile_options.keys()):
if key == LLVM_SPIRV_ARGS:
Expand Down
2 changes: 1 addition & 1 deletion numba_dpex/tests/codegen/test_intenum_literal_codegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def pass_flags_to_func(a):

pattern = re.compile(
r"call spir_func i32 @\_Z.*bitwise\_or"
r"\_flags.*\(i64\* nonnull %.*, i64 1, i64 2\)"
r"\_flags.*\(i64\*\s(\w+)?\s*%.*, i64 1, i64 2\)"
)

assert re.search(pattern, llvm_ir_mod) is not None
8 changes: 4 additions & 4 deletions numba_dpex/tests/debugging/gdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
r"layout=[A-Z],\s+"
r"address_space=[0-4],\s+"
r"usm_type=[a-z]+,\s+"
r"device=[a-z:0-9]+,\s+"
r"sycl_queue=[A-Za-z:0-9 ]+\)"
r"device=[a-z\_:0-9]+,\s+"
r"sycl_queue=[A-Za-z:0-9\s\_:]+\)"
)


Expand All @@ -52,7 +52,7 @@ def spawn(self):
env["NUMBA_DEBUGINFO"] = "1"

self.child = pexpect.spawn(
"gdb-oneapi -q python", env=env, encoding="utf-8"
"gdb-oneapi -q python", env=env, encoding="utf-8", timeout=60
)
if config.TESTING_LOG_DEBUGGING:
self.child.logfile = sys.stdout
Expand Down Expand Up @@ -109,7 +109,7 @@ def expect_eol(self):
self.child.expect(r"[^\n]*\n")

def expect_hit_breakpoint(self, expected_location=None):
expect = r"Thread [0-9A-Za-z \"]+ hit Breakpoint [0-9\.]+"
expect = r"Breakpoint [0-9\.]+"
if expected_location is not None:
# function name + args could be long, so we have to assume that
# the message may be splitted in multiple lines. It potentially can
Expand Down
2 changes: 1 addition & 1 deletion numba_dpex/tests/debugging/test_breakpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_device_func_breakpoint(

app.breakpoint(breakpoint, condition=condition)
app.run(f"side-by-side.py --api={api}")
app.expect_hit_breakpoint("side-by-side.py:15")
app.expect_hit_breakpoint(expected_location="side-by-side.py:15")
if exp_var is not None:
app.print(exp_var, expected=exp_val)

Expand Down
8 changes: 4 additions & 4 deletions numba_dpex/tests/debugging/test_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_info_args(
):
app.breakpoint(breakpoint)
app.run(script)
app.expect_hit_breakpoint(breakpoint)
app.expect_hit_breakpoint(expected_location=breakpoint)
app.expect(expected_line, with_eol=True)

if kind == "info":
Expand All @@ -99,7 +99,7 @@ def test_info_args(
def test_info_functions(app):
app.breakpoint("simple_sum.py:12")
app.run("simple_sum.py")
app.expect_hit_breakpoint("simple_sum.py:12")
app.expect_hit_breakpoint(expected_location="simple_sum.py:12")
app.expect(r"12\s+i = item.get_id\(0\)", with_eol=True)

app.info_functions("data_parallel_sum")
Expand All @@ -119,7 +119,7 @@ def test_print_array_element(app, api):

app.breakpoint("side-by-side-2.py:17", condition="param_a == 5")
app.run(f"side-by-side-2.py --api={api}")
app.expect_hit_breakpoint("side-by-side-2.py:17")
app.expect_hit_breakpoint(expected_location="side-by-side-2.py:17")

# We can access only c_array, not python style array
app.print("b.data[5]", 5)
Expand All @@ -142,7 +142,7 @@ def test_print_array_element(app, api):
def test_assignment_to_variable(app, api, assign):
app.breakpoint("side-by-side-2.py:17", condition="param_a == 5")
app.run(f"side-by-side-2.py --api={api}")
app.expect_hit_breakpoint("side-by-side-2.py:17")
app.expect_hit_breakpoint(expected_location="side-by-side-2.py:17")

app.print("param_a", expected=5)
if assign == "print":
Expand Down
6 changes: 3 additions & 3 deletions numba_dpex/tests/debugging/test_stepping.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
def test_next(app: gdb):
app.breakpoint("simple_dpex_func.py:18")
app.run("simple_dpex_func.py")
app.expect_hit_breakpoint("simple_dpex_func.py:18")
app.expect_hit_breakpoint(expected_location="simple_dpex_func.py:18")
app.expect(r"18\s+i = item.get_id\(0\)", with_eol=True)
app.set_scheduler_lock()
app.next()
Expand All @@ -37,7 +37,7 @@ def test_next(app: gdb):
def test_step(app: gdb):
app.breakpoint("simple_dpex_func.py:19")
app.run("simple_dpex_func.py")
app.expect_hit_breakpoint("simple_dpex_func.py:19")
app.expect_hit_breakpoint(expected_location="simple_dpex_func.py:19")
app.expect(
r"19\s+c_in_kernel\[i\] = func_sum\(a_in_kernel\[i\], b_in_kernel\[i\]\)",
with_eol=True,
Expand All @@ -57,7 +57,7 @@ def test_step(app: gdb):
def test_stepi(app: gdb, func: str):
app.breakpoint("simple_dpex_func.py:19")
app.run("simple_dpex_func.py")
app.expect_hit_breakpoint("simple_dpex_func.py:19")
app.expect_hit_breakpoint(expected_location="simple_dpex_func.py:19")
app.expect(
r"19\s+c_in_kernel\[i\] = func_sum\(a_in_kernel\[i\], b_in_kernel\[i\]\)",
with_eol=True,
Expand Down
Loading