diff --git a/numba_dpex/examples/debug/side-by-side.py b/numba_dpex/examples/debug/side-by-side.py index 5df0b551eb..972b05844e 100644 --- a/numba_dpex/examples/debug/side-by-side.py +++ b/numba_dpex/examples/debug/side-by-side.py @@ -59,7 +59,7 @@ def ndpx_func_driver(a, b, c): @ndpx.kernel(debug=True) def _kernel(item, a_in_kernel, b_in_kernel, c_in_kernel): - i = item.get_global_id(0) + i = item.get_id(0) c_in_kernel[i] = ndpx_loop_body(a_in_kernel[i], b_in_kernel[i]) diff --git a/numba_dpex/tests/debugging/test_breakpoints.py b/numba_dpex/tests/debugging/test_breakpoints.py index bcb87fe179..321f49e687 100644 --- a/numba_dpex/tests/debugging/test_breakpoints.py +++ b/numba_dpex/tests/debugging/test_breakpoints.py @@ -21,7 +21,7 @@ @pytest.mark.parametrize( "breakpoint", [ - "side-by-side.py:16", + "side-by-side.py:15", "common_loop_body", "side-by-side.py:common_loop_body", ], @@ -63,7 +63,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:16") + app.expect_hit_breakpoint("side-by-side.py:15") if exp_var is not None: app.print(exp_var, expected=exp_val) diff --git a/numba_dpex/tests/debugging/test_info.py b/numba_dpex/tests/debugging/test_info.py index e09d37858a..421aba8e16 100644 --- a/numba_dpex/tests/debugging/test_info.py +++ b/numba_dpex/tests/debugging/test_info.py @@ -24,7 +24,7 @@ ( "simple_dpex_func.py:18", "simple_dpex_func.py", - r"18\s+i = ndpx\.get_global_id\(0\)", + r"18\s+i = item\.get_id\(0\)", [ ( "a_in_kernel", @@ -47,18 +47,18 @@ ], ), ( - "side-by-side.py:16", + "side-by-side.py:15", "side-by-side.py --api=numba", - r"16\s+param_c = param_a \+ numba\.float32\(10\)", + r"15\s+param_c = param_a \+ numba\.float32\(10\)", [ ("param_a", r"[0-9]+", r"type = float32", r"type = float32"), ("param_b", r"[0-9]+", r"type = float32", r"type = float32"), ], ), ( - "side-by-side.py:16", + "side-by-side.py:15", "side-by-side.py --api=numba-ndpx-kernel", - r"16\s+param_c = param_a \+ numba\.float32\(10\)", + r"15\s+param_c = param_a \+ numba\.float32\(10\)", [ ("param_a", r"[0-9]+", r"type = float32", r"type = float32"), ("param_b", r"[0-9]+", r"type = float32", r"type = float32"), @@ -100,7 +100,7 @@ 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(r"12\s+i = ndpx.get_global_id\(0\)", with_eol=True) + app.expect(r"12\s+i = item.get_id\(0\)", with_eol=True) app.info_functions("data_parallel_sum") @@ -117,7 +117,7 @@ def test_info_functions(app): def test_print_array_element(app, api): """Test access to array elements""" - app.breakpoint("side-by-side-2.py:17 if param_a == 5") + 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") @@ -140,9 +140,9 @@ def test_print_array_element(app, api): ], ) def test_assignment_to_variable(app, api, assign): - app.breakpoint("side-by-side-2.py:18", condition="param_a == 5") + 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:18") + app.expect_hit_breakpoint("side-by-side-2.py:17") app.print("param_a", expected=5) if assign == "print": diff --git a/numba_dpex/tests/debugging/test_stepping.py b/numba_dpex/tests/debugging/test_stepping.py index 44f7e89246..58464350b4 100644 --- a/numba_dpex/tests/debugging/test_stepping.py +++ b/numba_dpex/tests/debugging/test_stepping.py @@ -22,7 +22,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(r"18\s+i = ndpx.get_global_id\(0\)", with_eol=True) + app.expect(r"18\s+i = item.get_id\(0\)", with_eol=True) app.set_scheduler_lock() app.next() app.expect( @@ -35,19 +35,22 @@ def test_next(app: gdb): def test_step(app: gdb): - app.breakpoint("simple_dpex_func.py:18") + app.breakpoint("simple_dpex_func.py:19") app.run("simple_dpex_func.py") - app.expect_hit_breakpoint("simple_dpex_func.py:18") - app.expect(r"18\s+i = ndpx.get_global_id\(0\)", with_eol=True) - app.set_scheduler_lock() - app.step() + app.expect_hit_breakpoint("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, ) + app.set_scheduler_lock() app.step() app.expect(r"__main__::func_sum.* at simple_dpex_func.py:12", with_eol=True) app.expect(r"12\s+result = a_in_func \+ b_in_func", with_eol=True) + app.step() + app.expect( + r"13\s+return result", + with_eol=True, + ) @pytest.mark.parametrize("func", ["stepi", "nexti"])