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

Fix cts to validate scratch register. #84

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
12 changes: 7 additions & 5 deletions conformance_tests/tools/debug/src/test_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,15 +1234,17 @@ TEST(
}

void zetDebugReadWriteRegistersTest::run_read_write_registers_test(
std::vector<ze_device_handle_t> &devices, bool use_sub_devices) {
std::vector<ze_device_handle_t> &devices, bool use_sub_devices,
bool test_slm) {
for (auto &device : devices) {
print_device(device);
if (!is_debug_supported(device))
continue;

synchro->clear_debugger_signal();
debugHelper = launch_process(LONG_RUNNING_KERNEL_INTERRUPTED, device,
use_sub_devices);
debug_test_type_t test_type = test_slm ? LONG_RUNNING_KERNEL_INTERRUPTED_SLM
: LONG_RUNNING_KERNEL_INTERRUPTED;
debugHelper = launch_process(test_type, device, use_sub_devices);

zet_debug_event_t module_event;
attach_and_get_module_event(debugHelper.id(), synchro, device, debugSession,
Expand Down Expand Up @@ -1381,14 +1383,14 @@ TEST_F(
GivenActiveDebugSessionWhenReadingAndWritingRegistersThenValidDataReadAndDataWrittenSuccessfully) {
auto driver = lzt::get_default_driver();
auto devices = lzt::get_devices(driver);
run_read_write_registers_test(devices, false);
run_read_write_registers_test(devices, false, true);
}

TEST_F(
zetDebugReadWriteRegistersTest,
GivenActiveDebugSessionWhenReadingAndWritingSubDeviceRegistersThenValidDataReadAndDataWrittenSuccessfully) {
auto all_sub_devices = lzt::get_all_sub_devices();
run_read_write_registers_test(all_sub_devices, true);
run_read_write_registers_test(all_sub_devices, true, false);
}

void zetDebugThreadControlTest::SetUpThreadControl(ze_device_handle_t &device,
Expand Down
6 changes: 3 additions & 3 deletions conformance_tests/tools/debug/src/test_debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace fs = boost::filesystem;
namespace bp = boost::process;
namespace bi = boost::interprocess;

const uint16_t eventsTimeoutMS = 30000;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will remove this in final patch. For testing purpose used this.

const uint16_t eventsTimeoutS = 30;
const uint16_t eventsTimeoutMS = 3000000;
const uint16_t eventsTimeoutS = 3600;

namespace lzt = level_zero_tests;

Expand Down Expand Up @@ -254,7 +254,7 @@ class zetDebugReadWriteRegistersTest : public zetDebugMemAccessTest {
void SetUp() override { zetDebugMemAccessTest::SetUp(); }
void TearDown() override { zetDebugMemAccessTest::TearDown(); }
void run_read_write_registers_test(std::vector<ze_device_handle_t> &devices,
bool use_sub_devices);
bool use_sub_devices, bool test_slm);
};

class zetDebugThreadControlTest : public zetDebugBaseSetup {
Expand Down
11 changes: 7 additions & 4 deletions conformance_tests/tools/debug/src/test_debug_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ void multiple_modules_created_test(ze_context_handle_t context,
}

void run_long_kernel(ze_context_handle_t context, ze_device_handle_t device,
process_synchro &synchro, debug_options &options) {
process_synchro &synchro, debug_options &options,
bool test_slm) {

auto command_list = lzt::create_command_list(device);
auto command_queue = lzt::create_command_queue(device);
Expand All @@ -426,9 +427,11 @@ void run_long_kernel(ze_context_handle_t context, ze_device_handle_t device,
}

synchro.wait_for_debugger_signal();
const char *build_flags =
test_slm ? "-g" : "-g -igc_opts 'VISAOptions=-forcespills'";
auto module =
lzt::create_module(device, module_name, ZE_MODULE_FORMAT_IL_SPIRV,
"-g" /* include debug symbols*/, nullptr);
build_flags /* include debug symbols*/, nullptr);

auto kernel = lzt::create_function(module, kernel_name);

Expand Down Expand Up @@ -1219,13 +1222,13 @@ int main(int argc, char **argv) {
attach_after_module_destroyed_test(context, device, synchro, options);
break;
case LONG_RUNNING_KERNEL_INTERRUPTED:
run_long_kernel(context, device, synchro, options);
run_long_kernel(context, device, synchro, options, false);
break;
case LONG_RUNNING_KERNEL_INTERRUPTED_SLM:
options.use_custom_module = true;
options.module_name_in = "debug_loop_slm.spv";
options.kernel_name_in = "long_kernel_slm";
run_long_kernel(context, device, synchro, options);
run_long_kernel(context, device, synchro, options, true);
break;
case MULTIPLE_THREADS:
run_multiple_threads(context, device, synchro, options);
Expand Down
Loading