Skip to content

Commit

Permalink
[DeviceASAN][test] Update shadow-virtual-mem.cpp (#16917)
Browse files Browse the repository at this point in the history
1. not treating not having two GPU devices as an error, but skip the
test instead.
2. If the two GPU devices are not the same model, skip the test(not our
targeted setup).
  • Loading branch information
yingcong-wu authored Feb 8, 2025
1 parent 1e3940b commit f791cd1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions sycl/test-e2e/AddressSanitizer/dependency/shadow-virtual-mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,22 @@ int main() {

// Check if we have at least two GPU devices
if (gpuDevices.size() < 2) {
std::cerr << "Less than two GPU devices found." << std::endl;
return 1;
std::cerr << "Less than two GPU devices found, skipped." << std::endl;
return 0;
}

// Create contexts for the first two GPU devices
auto dev1 = gpuDevices[0];
auto dev2 = gpuDevices[1];

// Check if two devices are the same model
std::string dev1_name = dev1.get_info<sycl::info::device::name>();
std::string dev2_name = dev2.get_info<sycl::info::device::name>();
if (dev1_name != dev2_name) {
std::cerr << "Two different devices, skipped." << std::endl;
return 0;
}

sycl::context context1_d1(dev1);
sycl::context context2_d1(dev1);
sycl::context context_d2(dev2);
Expand Down

0 comments on commit f791cd1

Please sign in to comment.