Skip to content

Commit 6992d0e

Browse files
vasilytricbb-sycl
authored andcommitted
[SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (intel#748)
* [SYCL][ESIMD] Split tests into core and fp_extra
1 parent e1f22e3 commit 6992d0e

22 files changed

+355
-365
lines changed

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,18 @@
1313
//===----------------------------------------------------------------------===//
1414

1515
#pragma once
16+
<<<<<<< HEAD
1617
#define ESIMD_TESTS_DISABLE_DEPRECATED_TEST_DESCRIPTION_FOR_LOGS
1718

1819
#include "common.hpp"
1920

2021
namespace esimd = sycl::ext::intel::esimd;
22+
=======
23+
24+
#include "common.hpp"
25+
26+
namespace esimd = sycl::ext::intel::experimental::esimd;
27+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
2128

2229
namespace esimd_test::api::functional::ctors {
2330

@@ -92,6 +99,7 @@ class const_ref {
9299

93100
// The main test routine.
94101
// Using functor class to be able to iterate over the pre-defined data types.
102+
<<<<<<< HEAD
95103
template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
96104
static constexpr int NumElems = SizeT::value;
97105
using TestDescriptionT = ctors::TestDescription<NumElems, TestCaseT>;
@@ -105,6 +113,15 @@ template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
105113
return true;
106114
}
107115

116+
=======
117+
template <typename DataT, typename DimT, typename TestCaseT> class run_test {
118+
static constexpr int NumElems = DimT::value;
119+
120+
public:
121+
bool operator()(sycl::queue &queue, const std::string &data_type) {
122+
123+
bool passed = true;
124+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
108125
const std::vector<DataT> ref_data = generate_ref_data<DataT, NumElems>();
109126

110127
// If current number of elements is equal to one, then run test with each
@@ -138,7 +155,11 @@ template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
138155
const DataT *const ref = shared_ref_data.data();
139156
DataT *const out = result.data();
140157

158+
<<<<<<< HEAD
141159
cgh.single_task<Kernel<DataT, NumElems, TestCaseT>>(
160+
=======
161+
cgh.single_task<ctors::Kernel<DataT, NumElems, TestCaseT>>(
162+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
142163
[=]() SYCL_ESIMD_KERNEL {
143164
DataT ref_on_dev[NumElems];
144165
for (size_t i = 0; i < NumElems; ++i) {
@@ -152,13 +173,23 @@ template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
152173
queue.wait_and_throw();
153174

154175
for (size_t i = 0; i < result.size(); ++i) {
176+
<<<<<<< HEAD
155177
const auto &expected = ref_data[i];
156178
const auto &retrieved = result[i];
157179

158180
if (!are_bitwise_equal(expected, retrieved)) {
159181
passed = false;
160182
log::fail(TestDescriptionT(data_type), "Unexpected value at index ", i,
161183
", retrieved: ", retrieved, ", expected: ", expected);
184+
=======
185+
if (!are_bitwise_equal(ref_data[i], result[i])) {
186+
passed = false;
187+
188+
const auto description =
189+
ctors::TestDescription<DataT, NumElems, TestCaseT>(
190+
i, result[i], ref_data[i], data_type);
191+
log::fail(description);
192+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
162193
}
163194
}
164195

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
using namespace esimd_test::api::functional;
2828
<<<<<<< HEAD
29+
<<<<<<< HEAD
2930
=======
3031
using namespace sycl::ext::intel::experimental::esimd;
3132

@@ -168,13 +169,16 @@ template <typename DataT, typename DimT, typename TestCaseT> class run_test {
168169
}
169170
};
170171
>>>>>>> 6870ea3ee ([SYCL][ESIMD] Provide the for_all_combinations utility (#721))
172+
=======
173+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
171174

172175
int main(int, char **) {
173176
sycl::queue queue(esimd_test::ESIMDSelector{},
174177
esimd_test::createExceptionHandler());
175178

176179
bool passed = true;
177180

181+
<<<<<<< HEAD
178182
<<<<<<< HEAD
179183
const auto types = get_tested_types<tested_types::core>();
180184
const auto sizes = get_all_sizes();
@@ -195,6 +199,15 @@ int main(int, char **) {
195199

196200
passed &= for_all_combinations<run_test>(types, dims, contexts, queue);
197201
>>>>>>> 6870ea3ee ([SYCL][ESIMD] Provide the for_all_combinations utility (#721))
202+
=======
203+
const auto types = get_tested_types<tested_types::core>();
204+
const auto dims = get_all_dimensions();
205+
const auto contexts =
206+
unnamed_type_pack<ctors::initializer, ctors::var_decl,
207+
ctors::rval_in_expr, ctors::const_ref>::generate();
208+
209+
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
210+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
198211

199212
std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
200213
return passed ? 0 : 1;

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd constructor from an array.
18+
<<<<<<< HEAD
1819
// This test uses extra fp data types, sizes and different simd constructor
1920
// invocation contexts.
21+
=======
22+
// This test uses extra fp data types, dimensionality and different simd
23+
// constructor invocation contexts.
24+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
2025
// The test does the following actions:
2126
// - construct fixed-size array that filled with reference values
2227
// - use std::move() to provide it to simd constructor
@@ -33,13 +38,21 @@ int main(int, char **) {
3338
bool passed = true;
3439

3540
const auto types = get_tested_types<tested_types::fp_extra>();
41+
<<<<<<< HEAD
3642
const auto sizes = get_all_sizes();
43+
=======
44+
const auto dims = get_all_dimensions();
45+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
3746
const auto contexts =
3847
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3948
ctors::rval_in_expr, ctors::const_ref>::generate();
4049

50+
<<<<<<< HEAD
4151
passed &=
4252
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
53+
=======
54+
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
55+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
4356

4457
std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
4558
return passed ? 0 : 1;

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,17 @@
77
//
88
//===----------------------------------------------------------------------===//
99
<<<<<<< HEAD:SYCL/ESIMD/api/functional/ctors/ctor_copy.hpp
10+
<<<<<<< HEAD:SYCL/ESIMD/api/functional/ctors/ctor_copy.hpp
11+
=======
12+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748)):SYCL/ESIMD/api/functional/ctors/ctor_copy.cpp
1013
///
1114
/// \file
1215
/// This file provides functions for tests on simd copy constructor.
1316
///
1417
//===----------------------------------------------------------------------===//
1518

1619
#pragma once
20+
<<<<<<< HEAD:SYCL/ESIMD/api/functional/ctors/ctor_copy.hpp
1721
#define ESIMD_TESTS_DISABLE_DEPRECATED_TEST_DESCRIPTION_FOR_LOGS
1822
=======
1923
// REQUIRES: gpu, level_zero
@@ -31,6 +35,12 @@
3135
#include "common.hpp"
3236

3337
namespace esimd = sycl::ext::intel::esimd;
38+
=======
39+
40+
#include "common.hpp"
41+
42+
namespace esimd = sycl::ext::intel::experimental::esimd;
43+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748)):SYCL/ESIMD/api/functional/ctors/ctor_copy.cpp
3444

3545
namespace esimd_test::api::functional::ctors {
3646

@@ -175,6 +185,7 @@ template <typename DataT, typename DimT, typename TestCaseT> class run_test {
175185
}
176186
};
177187

188+
<<<<<<< HEAD:SYCL/ESIMD/api/functional/ctors/ctor_copy.hpp
178189
<<<<<<< HEAD:SYCL/ESIMD/api/functional/ctors/ctor_copy.hpp
179190
} // namespace esimd_test::api::functional::ctors
180191
=======
@@ -195,3 +206,6 @@ int main(int, char **) {
195206
return passed ? 0 : 1;
196207
}
197208
>>>>>>> 6870ea3ee ([SYCL][ESIMD] Provide the for_all_combinations utility (#721)):SYCL/ESIMD/api/functional/ctors/ctor_copy.cpp
209+
=======
210+
} // namespace esimd_test::api::functional::ctors
211+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748)):SYCL/ESIMD/api/functional/ctors/ctor_copy.cpp

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd copy constructor.
18+
<<<<<<< HEAD
1819
// This test uses different data types, sizes and different simd constructor
1920
// invocation contexts.
21+
=======
22+
// This test uses different data types, dimensionality and different simd
23+
// constructor invocation contexts.
24+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
2025
// The test do the following actions:
2126
// - construct simd object with golden values calls copy constructor from
2227
// constructed simd object
@@ -33,13 +38,21 @@ int main(int, char **) {
3338
bool passed = true;
3439

3540
const auto types = get_tested_types<tested_types::core>();
41+
<<<<<<< HEAD
3642
const auto sizes = get_all_sizes();
43+
=======
44+
const auto dims = get_all_dimensions();
45+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
3746
const auto contexts =
3847
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3948
ctors::rval_in_expr, ctors::const_ref>::generate();
4049

50+
<<<<<<< HEAD
4151
passed &=
4252
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
53+
=======
54+
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
55+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
4356

4457
std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
4558
return passed ? 0 : 1;

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd copy constructor.
18+
<<<<<<< HEAD
1819
// This test uses different data types, sizes and different simd constructor
1920
// invocation contexts.
21+
=======
22+
// This test uses extra fp data types, dimensionality and different simd
23+
// constructor invocation contexts.
24+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
2025
// The test do the following actions:
2126
// - construct simd object with golden values calls copy constructor from
2227
// constructed simd object
@@ -33,13 +38,21 @@ int main(int, char **) {
3338
bool passed = true;
3439

3540
const auto types = get_tested_types<tested_types::fp_extra>();
41+
<<<<<<< HEAD
3642
const auto sizes = get_all_sizes();
43+
=======
44+
const auto dims = get_all_dimensions();
45+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
3746
const auto contexts =
3847
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3948
ctors::rval_in_expr, ctors::const_ref>::generate();
4049

50+
<<<<<<< HEAD
4151
passed &=
4252
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
53+
=======
54+
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
55+
>>>>>>> c1366f1d7 ([SYCL][ESIMD] Split tests on simd constructors into core and fp_extra (#748))
4356

4457
std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
4558
return passed ? 0 : 1;

0 commit comments

Comments
 (0)