Skip to content

Commit e005c0c

Browse files
vasilytricbb-sycl
authored andcommitted
[SYCL][ESIMD] Decrease type coverage for core tests (intel#832)
* [SYCL][ESIMD] Decrease type coverage for core tests Because of the fact that these tests take too much time in CI. Full coverage can be re-enabled with the ESIMD_TESTS_FULL_COVERAGE preprocessor macro.
1 parent f1624ec commit e005c0c

File tree

6 files changed

+44
-2
lines changed

6 files changed

+44
-2
lines changed

SYCL/ESIMD/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,10 @@ This directory contains ESIMD tests which are run on Intel GPU device only.
33
Some of them can run on host device too, but in general it is not always
44
possible as some of ESIMD APIs (e.g. memory access via accessors) is not
55
implemented for the host device.
6+
7+
Tests within this directory has additional preprocessor definitions available.
8+
9+
`ESIMD_TESTS_FULL_COVERAGE` (default: not defined)\
10+
Enable extended coverage and testing logic with significantly increased
11+
compilation and execution time. Extensive tests could be run manually if needed,
12+
but do not affect CI performance for the basic functionality.

SYCL/ESIMD/api/functional/ctors/ctor_fill_core.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ int main(int, char **) {
6666
// Validate basic functionality works for every type
6767
<<<<<<< HEAD
6868
<<<<<<< HEAD
69+
<<<<<<< HEAD
70+
=======
71+
72+
>>>>>>> d43bc4e32 ([SYCL][ESIMD] Decrease type coverage for core tests (#832))
6973
const auto types = get_tested_types<tested_types::core>();
7074
<<<<<<< HEAD
7175
=======

SYCL/ESIMD/api/functional/ctors/ctor_load_core.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ int main(int, char **) {
3232
bool passed = true;
3333
<<<<<<< HEAD
3434
<<<<<<< HEAD
35+
<<<<<<< HEAD
36+
=======
37+
38+
>>>>>>> d43bc4e32 ([SYCL][ESIMD] Decrease type coverage for core tests (#832))
3539
const auto types = get_tested_types<tested_types::core>();
3640
<<<<<<< HEAD
3741
=======

SYCL/ESIMD/api/functional/ctors/ctor_move_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ using namespace esimd_test::api::functional;
3636

3737
int main(int, char **) {
3838
bool passed = true;
39-
const auto types = get_tested_types<tested_types::fp_extra>();
39+
const auto types = get_tested_types<tested_types::core>();
4040
const auto sizes = get_all_sizes();
4141
const auto contexts =
4242
unnamed_type_pack<ctors::initializer, ctors::var_decl,

SYCL/ESIMD/api/functional/type_coverage.hpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ template <tested_types required> auto get_tested_types() {
252252
<<<<<<< HEAD
253253
<<<<<<< HEAD
254254
if constexpr (required == tested_types::core) {
255+
#ifdef ESIMD_TESTS_FULL_COVERAGE
255256
return named_type_pack<
256257
char, unsigned char, signed char, short, unsigned short, int,
257258
unsigned int, long, unsigned long, float, long long,
@@ -261,6 +262,10 @@ template <tested_types required> auto get_tested_types() {
261262
"unsigned int", "long", "unsigned long",
262263
"float", "long long",
263264
"unsigned long long");
265+
#else
266+
return named_type_pack<float, int, unsigned int, signed char>::generate(
267+
"float", "int", "unsigned int", "signed char");
268+
#endif
264269
} else if constexpr (required == tested_types::fp) {
265270
return named_type_pack<float>::generate("float");
266271
} else if constexpr (required == tested_types::fp_extra) {
@@ -293,6 +298,7 @@ template <tested_types required> auto get_tested_types() {
293298
"double");
294299
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
295300
} else if constexpr (required == tested_types::uint) {
301+
#ifdef ESIMD_TESTS_FULL_COVERAGE
296302
if constexpr (!std::is_signed_v<char>) {
297303
return named_type_pack<unsigned char, unsigned short, unsigned int,
298304
unsigned long, unsigned long long,
@@ -306,7 +312,11 @@ template <tested_types required> auto get_tested_types() {
306312
"unsigned int", "unsigned long",
307313
"unsigned long long");
308314
}
315+
#else
316+
return named_type_pack<unsigned int>::generate("unsigned int");
317+
#endif
309318
} else if constexpr (required == tested_types::sint) {
319+
#ifdef ESIMD_TESTS_FULL_COVERAGE
310320
if constexpr (std::is_signed_v<char>) {
311321
return named_type_pack<signed char, short, int, long, long long,
312322
char>::generate("signed char", "short", "int",
@@ -316,6 +326,9 @@ template <tested_types required> auto get_tested_types() {
316326
long long>::generate("signed char", "short", "int",
317327
"long", "long long");
318328
}
329+
#else
330+
return named_type_pack<int, signed char>::generate("int", "signed char");
331+
#endif
319332
} else {
320333
static_assert(required != required, "Unexpected tested type");
321334
}
@@ -328,7 +341,13 @@ template <int... Values> auto inline get_sizes() {
328341

329342
// Factory method to retrieve pre-defined values_pack, to have the same
330343
// default sizes over the tests
331-
auto inline get_all_sizes() { return get_sizes<1, 8, 16, 32>(); }
344+
auto inline get_all_sizes() {
345+
#ifdef ESIMD_TESTS_FULL_COVERAGE
346+
return get_sizes<1, 8, 16, 32>();
347+
#else
348+
return get_sizes<1, 8>();
349+
#endif
350+
}
332351

333352
// It's a deprecated function and it exists only for backward compatibility and
334353
// it should be deleted in the future. Use get_all_sizes() instead.

SYCL/ESIMD/api/simd_copy_to_from.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ int main(void) {
233233

234234
bool Pass = true;
235235

236+
#ifdef ESIMD_TESTS_FULL_COVERAGE
236237
Pass &= testUSM<int8_t>(Q);
237238
Pass &= testUSM<uint16_t>(Q);
238239
Pass &= testUSM<int32_t>(Q);
@@ -248,6 +249,13 @@ int main(void) {
248249
Pass &= testAcc<float>(Q);
249250
Pass &= testAcc<double>(Q);
250251
Pass &= testAcc<half>(Q);
252+
#else
253+
Pass &= testUSM<uint16_t>(Q);
254+
Pass &= testUSM<float>(Q);
255+
256+
Pass &= testAcc<int16_t>(Q);
257+
Pass &= testAcc<float>(Q);
258+
#endif
251259

252260
std::cout << (Pass ? "Test Passed\n" : "Test FAILED\n");
253261
return Pass ? 0 : 1;

0 commit comments

Comments
 (0)