1
1
// REQUIRES: aspect-ext_oneapi_bindless_images
2
2
3
- // UNSUPPORTED: level_zero
4
- // UNSUPPORTED-INTENDED: The feature is not implemented in the Level Zero stack.
3
+ // These features are only partly implemented in the Level Zero stack.
4
+ // Only max_image_linear_width and max_image_linear_height are supported in the
5
+ // Level Zero stack.
5
6
// https://github.com/intel/llvm/issues/17663
6
7
7
8
// RUN: %{build} -o %t.out
@@ -26,20 +27,40 @@ int main() {
26
27
// These can be different depending on the device so we cannot test that the
27
28
// values are correct
28
29
// But we should at least see that the query itself works
29
- auto pitchAlign = dev.get_info <
30
- sycl::ext::oneapi::experimental::info::device::image_row_pitch_align>();
31
- auto maxPitch = dev.get_info <sycl::ext::oneapi::experimental::info::device::
32
- max_image_linear_row_pitch>();
33
- auto maxWidth = dev.get_info <sycl::ext::oneapi::experimental::info::device::
34
- max_image_linear_width>();
35
- auto maxheight = dev.get_info <sycl::ext::oneapi::experimental::info::
36
- device::max_image_linear_height>();
30
+
31
+ sycl::backend backend = dev.get_backend ();
32
+
33
+ size_t pitchAlign = 0 ;
34
+ size_t maxPitch = 0 ;
35
+ size_t maxWidth = 0 ;
36
+ size_t maxheight = 0 ;
37
+
38
+ // Level Zero does not currently support these queries. Only CUDA does.
39
+ if (backend == sycl::backend::ext_oneapi_cuda) {
40
+ pitchAlign = dev.get_info <sycl::ext::oneapi::experimental::info::device::
41
+ image_row_pitch_align>();
42
+ maxPitch = dev.get_info <sycl::ext::oneapi::experimental::info::device::
43
+ max_image_linear_row_pitch>();
44
+ }
45
+
46
+ if (backend == sycl::backend::ext_oneapi_cuda ||
47
+ backend == sycl::backend::ext_oneapi_level_zero) {
48
+ maxWidth = dev.get_info <sycl::ext::oneapi::experimental::info::device::
49
+ max_image_linear_width>();
50
+ maxheight = dev.get_info <sycl::ext::oneapi::experimental::info::device::
51
+ max_image_linear_height>();
52
+ }
37
53
38
54
#ifdef VERBOSE_PRINT
39
- std::cout << " image_row_pitch_align: " << pitchAlign
40
- << " \n max_image_linear_row_pitch: " << maxPitch
41
- << " \n max_image_linear_width: " << maxWidth
42
- << " \n max_image_linear_height: " << maxheight << " \n " ;
55
+ if (backend == sycl::backend::ext_oneapi_cuda) {
56
+ std::cout << " image_row_pitch_align: " << pitchAlign
57
+ << " \n max_image_linear_row_pitch: " << maxPitch
58
+ << " \n max_image_linear_width: " << maxWidth
59
+ << " \n max_image_linear_height: " << maxheight << " \n " ;
60
+ } else if (backend == sycl::backend::ext_oneapi_level_zero) {
61
+ std::cout << " \n max_image_linear_width: " << maxWidth
62
+ << " \n max_image_linear_height: " << maxheight << " \n " ;
63
+ }
43
64
#endif
44
65
45
66
} catch (sycl::exception e) {
0 commit comments