Skip to content

Commit 4c1cd03

Browse files
vasilytricbb-sycl
authored andcommitted
[SYCL][ESIMD] Add checks that device has fp16/fp64 aspects (intel#839)
* [SYCL][ESIMD] Add verifications that device has necessary aspects
1 parent 1bbadf1 commit 4c1cd03

File tree

8 files changed

+37
-0
lines changed

8 files changed

+37
-0
lines changed

SYCL/ESIMD/api/functional/common.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,23 @@ template <typename T>
6969
inline bool should_skip_test_with(const sycl::device &device) {
7070
if constexpr (std::is_same_v<T, sycl::half>) {
7171
if (!device.has(sycl::aspect::fp16)) {
72+
<<<<<<< HEAD
7273
// TODO: Use TestDescription after removal of the macro
7374
// ESIMD_TESTS_DISABLE_DEPRECATED_TEST_DESCRIPTION_FOR_LOGS
7475
log::print_line(
76+
=======
77+
log::note(
78+
>>>>>>> dacacdff7 ([SYCL][ESIMD] Add checks that device has fp16/fp64 aspects (#839))
7579
"Device does not support half precision floating point operations");
7680
return true;
7781
}
7882
} else if constexpr (std::is_same_v<T, double>) {
7983
if (!device.has(sycl::aspect::fp64)) {
84+
<<<<<<< HEAD
8085
log::print_line(
86+
=======
87+
log::note(
88+
>>>>>>> dacacdff7 ([SYCL][ESIMD] Add checks that device has fp16/fp64 aspects (#839))
8189
"Device does not support double precision floating point operations");
8290
return true;
8391
}

SYCL/ESIMD/api/functional/ctors/ctor_array.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
124124

125125
public:
126126
bool operator()(sycl::queue &queue, const std::string &data_type) {
127+
if (should_skip_test_with<DataT>(queue.get_device())) {
128+
return true;
129+
}
127130

128131
bool passed = true;
129132
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))

SYCL/ESIMD/api/functional/ctors/ctor_copy.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
128128

129129
public:
130130
bool operator()(sycl::queue &queue, const std::string &data_type) {
131+
if (should_skip_test_with<DataT>(queue.get_device())) {
132+
return true;
133+
}
134+
131135
bool passed = true;
132136
log::trace<TestDescriptionT>(data_type);
133137

SYCL/ESIMD/api/functional/ctors/ctor_default.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ template <typename DataT, typename SizeT, typename TestCaseT> struct run_test {
126126
>>>>>>> e37c07509 ([SYCL][ESIMD] Replace "dim", "dimensions" with "size", "sizes", etc. (#803))
127127

128128
bool operator()(sycl::queue &queue, const std::string &data_type) {
129+
if (should_skip_test_with<DataT>(queue.get_device())) {
130+
return true;
131+
}
132+
129133
bool passed = true;
130134

131135
// We use it to avoid empty functions being optimized out by compiler

SYCL/ESIMD/api/functional/ctors/ctor_fill.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,17 @@ class run_test {
242242

243243
public:
244244
bool operator()(sycl::queue &queue, const std::string &data_type) {
245+
<<<<<<< HEAD
245246
bool passed = true;
246247
log::trace<TestDescriptionT>(data_type, BaseVal, Step);
247248

249+
=======
250+
>>>>>>> dacacdff7 ([SYCL][ESIMD] Add checks that device has fp16/fp64 aspects (#839))
248251
if (should_skip_test_with<DataT>(queue.get_device())) {
249252
return true;
250253
}
251254

255+
<<<<<<< HEAD
252256
=======
253257
template <typename DataT, typename DimT, typename TestCaseT, typename BaseValT,
254258
=======
@@ -264,6 +268,8 @@ class run_test {
264268
public:
265269
bool operator()(sycl::queue &queue, const std::string &data_type) {
266270
>>>>>>> 6870ea3ee ([SYCL][ESIMD] Provide the for_all_combinations utility (#721))
271+
=======
272+
>>>>>>> dacacdff7 ([SYCL][ESIMD] Add checks that device has fp16/fp64 aspects (#839))
267273
shared_vector<DataT> result(NumElems, shared_allocator<DataT>(queue));
268274

269275
const auto base_value = get_value<DataT, BaseVal>();

SYCL/ESIMD/api/functional/ctors/ctor_move.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
113113

114114
public:
115115
bool operator()(sycl::queue &queue, const std::string &data_type) {
116+
if (should_skip_test_with<DataT>(queue.get_device())) {
117+
return true;
118+
}
119+
116120
bool passed = true;
117121
bool was_moved = false;
118122
<<<<<<< HEAD

SYCL/ESIMD/api/functional/ctors/ctor_vector.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
107107

108108
public:
109109
bool operator()(sycl::queue &queue, const std::string &data_type) {
110+
if (should_skip_test_with<DataT>(queue.get_device())) {
111+
return true;
112+
}
113+
110114
bool passed = true;
111115
<<<<<<< HEAD
112116
log::trace<TestDescriptionT>(data_type);

SYCL/ESIMD/api/functional/operators/operator_assignment.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
4444

4545
public:
4646
bool operator()(sycl::queue &queue, const std::string &data_type) {
47+
if (should_skip_test_with<DataT>(queue.get_device())) {
48+
return true;
49+
}
50+
4751
bool passed = true;
4852
<<<<<<< HEAD
4953
log::trace<TestDescriptionT>(data_type);

0 commit comments

Comments
 (0)