Skip to content

Commit f791cd1

Browse files
authored
[DeviceASAN][test] Update shadow-virtual-mem.cpp (#16917)
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).
1 parent 1e3940b commit f791cd1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

sycl/test-e2e/AddressSanitizer/dependency/shadow-virtual-mem.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,22 @@ int main() {
5454

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

6161
// Create contexts for the first two GPU devices
6262
auto dev1 = gpuDevices[0];
6363
auto dev2 = gpuDevices[1];
64+
65+
// Check if two devices are the same model
66+
std::string dev1_name = dev1.get_info<sycl::info::device::name>();
67+
std::string dev2_name = dev2.get_info<sycl::info::device::name>();
68+
if (dev1_name != dev2_name) {
69+
std::cerr << "Two different devices, skipped." << std::endl;
70+
return 0;
71+
}
72+
6473
sycl::context context1_d1(dev1);
6574
sycl::context context2_d1(dev1);
6675
sycl::context context_d2(dev2);

0 commit comments

Comments
 (0)