Skip to content

Commit 88a4dd3

Browse files
committed
Minor improvements to tests and add cuda node mask test
1 parent 0f313a1 commit 88a4dd3

File tree

3 files changed

+41
-3
lines changed

3 files changed

+41
-3
lines changed

sycl/test-e2e/Adapters/level_zero/node_mask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// REQUIRES: aspect-ext_intel_device_info_luid
1+
// REQUIRES: aspect-ext_intel_device_info_node_mask
22
// REQUIRES: gpu, level_zero, level_zero_dev_kit, windows
33

44
// RUN: %{build} %level_zero_options -o %t.out

sycl/test-e2e/Adapters/luid-cuda.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// REQUIRES: aspect-ext_intel_device_info_luid
2-
// REQUIRES: gpu, cuda, cuda_dev_kit, windows
2+
// REQUIRES: gpu, target-nvidia, cuda_dev_kit, windows
33

44
// RUN: %{build} %cuda_options -o %t.out
55
// RUN: %{run} %t.out
66

7-
// Test that the LUID is read correctly from Level Zero.
7+
// Test that the LUID is read correctly from CUDA.
88

99
#include <iomanip>
1010
#include <iostream>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
// REQUIRES: aspect-ext_intel_device_info_node_mask
2+
// REQUIRES: gpu, target-nvidia, cuda_dev_kit, windows
3+
4+
// RUN: %{build} %cuda_options -o %t.out
5+
// RUN: %{run} %t.out
6+
7+
// Test that the node mask is read correctly from CUDA.
8+
9+
#include <iomanip>
10+
#include <iostream>
11+
#include <sstream>
12+
#define SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL 1
13+
#include <cuda.h>
14+
#include <sycl/backend.hpp>
15+
#include <sycl/detail/core.hpp>
16+
17+
int main() {
18+
sycl::device dev;
19+
auto nodeMaskSYCL = dev.get_info<sycl::ext::intel::info::device::node_mask>();
20+
21+
std::cout << "SYCL: " << nodeMaskSYCL << std::endl;
22+
23+
CUdevice cudaDevice = sycl::get_native<sycl::backend::ext_oneapi_cuda>(dev);
24+
25+
uint32_t *nodeMaskCuda = nullptr;
26+
27+
cuDeviceGetLuid(nullptr, nodeMaskCuda, cudaDevice);
28+
29+
std::cout << "CUDA : " << *nodeMaskCuda << std::endl;
30+
31+
if (nodeMaskSYCL != *nodeMaskCuda) {
32+
std::cout << "FAILED" << std::endl;
33+
return -1;
34+
}
35+
36+
std::cout << "PASSED" << std::endl;
37+
return 0;
38+
}

0 commit comments

Comments
 (0)