Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit e37c075

Browse files
authored
[SYCL][ESIMD] Replace "dim", "dimensions" with "size", "sizes", etc. (#803)
1 parent fcbb20a commit e37c075

22 files changed

+108
-93
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ class const_ref {
9191

9292
// The main test routine.
9393
// Using functor class to be able to iterate over the pre-defined data types.
94-
template <typename DataT, typename DimT, typename TestCaseT> class run_test {
95-
static constexpr int NumElems = DimT::value;
94+
template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
95+
static constexpr int NumElems = SizeT::value;
9696

9797
public:
9898
bool operator()(sycl::queue &queue, const std::string &data_type) {

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd constructor from an array.
18-
// This test uses different data types, dimensionality and different simd
19-
// constructor invocation contexts.
18+
// This test uses different data types, sizes and different simd constructor
19+
// invocation contexts.
2020
// The test does the following actions:
2121
// - construct fixed-size array that filled with reference values
2222
// - use std::move() to provide it to simd constructor
@@ -33,12 +33,13 @@ int main(int, char **) {
3333
bool passed = true;
3434

3535
const auto types = get_tested_types<tested_types::core>();
36-
const auto dims = get_all_dimensions();
36+
const auto sizes = get_all_sizes();
3737
const auto contexts =
3838
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3939
ctors::rval_in_expr, ctors::const_ref>::generate();
4040

41-
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
41+
passed &=
42+
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
4243

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

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd constructor from an array.
18-
// This test uses extra fp data types, dimensionality and different simd
19-
// constructor invocation contexts.
18+
// This test uses extra fp data types, sizes and different simd constructor
19+
// invocation contexts.
2020
// The test does the following actions:
2121
// - construct fixed-size array that filled with reference values
2222
// - use std::move() to provide it to simd constructor
@@ -33,12 +33,13 @@ int main(int, char **) {
3333
bool passed = true;
3434

3535
const auto types = get_tested_types<tested_types::fp_extra>();
36-
const auto dims = get_all_dimensions();
36+
const auto sizes = get_all_sizes();
3737
const auto contexts =
3838
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3939
ctors::rval_in_expr, ctors::const_ref>::generate();
4040

41-
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
41+
passed &=
42+
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
4243

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@ class const_ref {
8888

8989
// The main test routine.
9090
// Using functor class to be able to iterate over the pre-defined data types.
91-
template <typename DataT, typename DimT, typename TestCaseT> class run_test {
92-
static constexpr int NumElems = DimT::value;
91+
template <typename DataT, typename SizeT, typename TestCaseT> class run_test {
92+
static constexpr int NumElems = SizeT::value;
9393

9494
public:
9595
bool operator()(sycl::queue &queue, const std::string &data_type) {

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd copy constructor.
18-
// This test uses different data types, dimensionality and different simd
19-
// constructor invocation contexts.
18+
// This test uses different data types, sizes and different simd constructor
19+
// invocation contexts.
2020
// The test do the following actions:
2121
// - construct simd object with golden values calls copy constructor from
2222
// constructed simd object
@@ -33,12 +33,13 @@ int main(int, char **) {
3333
bool passed = true;
3434

3535
const auto types = get_tested_types<tested_types::core>();
36-
const auto dims = get_all_dimensions();
36+
const auto sizes = get_all_sizes();
3737
const auto contexts =
3838
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3939
ctors::rval_in_expr, ctors::const_ref>::generate();
4040

41-
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
41+
passed &=
42+
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
4243

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

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd copy constructor.
18-
// This test uses extra fp data types, dimensionality and different simd
19-
// constructor invocation contexts.
18+
// This test uses different data types, sizes and different simd constructor
19+
// invocation contexts.
2020
// The test do the following actions:
2121
// - construct simd object with golden values calls copy constructor from
2222
// constructed simd object
@@ -33,12 +33,13 @@ int main(int, char **) {
3333
bool passed = true;
3434

3535
const auto types = get_tested_types<tested_types::fp_extra>();
36-
const auto dims = get_all_dimensions();
36+
const auto sizes = get_all_sizes();
3737
const auto contexts =
3838
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3939
ctors::rval_in_expr, ctors::const_ref>::generate();
4040

41-
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
41+
passed &=
42+
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
4243

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ struct const_ref {
7676
};
7777

7878
// Struct that calls simd in provided context and then verifies obtained result.
79-
template <typename DataT, typename DimT, typename TestCaseT> struct run_test {
80-
static constexpr int NumElems = DimT::value;
79+
template <typename DataT, typename SizeT, typename TestCaseT> struct run_test {
80+
static constexpr int NumElems = SizeT::value;
8181

8282
bool operator()(sycl::queue &queue, const std::string &data_type) {
8383
bool passed = true;

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd default constructor.
18-
// This test uses different data types, dimensionality and different simd
19-
// constructor invocation contexts.
18+
// This test uses different data types, sizes and different simd constructor
19+
// invocation contexts.
2020
// The test do the following actions:
2121
// - call simd default constructor
2222
// - verify that values from simd is equal to default value of provided
@@ -33,12 +33,13 @@ int main(int, char **) {
3333
bool passed = true;
3434

3535
const auto types = get_tested_types<tested_types::core>();
36-
const auto dims = get_all_dimensions();
36+
const auto sizes = get_all_sizes();
3737
const auto contexts =
3838
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3939
ctors::rval_in_expr, ctors::const_ref>::generate();
4040

41-
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
41+
passed &=
42+
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
4243

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

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd default constructor.
18-
// This test uses extra fp data types, dimensionality and different simd
19-
// constructor invocation contexts.
18+
// This test uses different data types, sizes and different simd constructor
19+
// invocation contexts.
2020
// The test do the following actions:
2121
// - call simd default constructor
2222
// - verify that values from simd is equal to default value of provided
@@ -33,12 +33,13 @@ int main(int, char **) {
3333
bool passed = true;
3434

3535
const auto types = get_tested_types<tested_types::fp_extra>();
36-
const auto dims = get_all_dimensions();
36+
const auto sizes = get_all_sizes();
3737
const auto contexts =
3838
unnamed_type_pack<ctors::initializer, ctors::var_decl,
3939
ctors::rval_in_expr, ctors::const_ref>::generate();
4040

41-
passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
41+
passed &=
42+
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);
4243

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,10 @@ template <init_val... Values> auto get_init_values_pack() {
195195
return value_pack<init_val, Values...>::generate_unnamed();
196196
}
197197

198-
template <typename DataT, typename DimT, typename TestCaseT, typename BaseValT,
198+
template <typename DataT, typename SizeT, typename TestCaseT, typename BaseValT,
199199
typename StepT>
200200
class run_test {
201-
static constexpr int NumElems = DimT::value;
201+
static constexpr int NumElems = SizeT::value;
202202
static constexpr init_val BaseVal = BaseValT::value;
203203
static constexpr init_val Step = StepT::value;
204204
using KernelT = kernel_for_fill<DataT, NumElems, TestCaseT, BaseVal, Step>;

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ int main(int, char **) {
3535

3636
bool passed = true;
3737

38-
// Using single dimension and context to verify the accuracy of operations
38+
// Using single size and context to verify the accuracy of operations
3939
// with floating point data types
4040
const auto types = get_tested_types<tested_types::fp>();
41-
const auto single_dim = get_dimensions<8>();
41+
const auto single_size = get_sizes<8>();
4242
const auto context = unnamed_type_pack<ctors::var_decl>::generate();
4343

4444
// Run for specific combinations of types, base and step values and vector
@@ -48,7 +48,7 @@ int main(int, char **) {
4848
const auto base_values = ctors::get_init_values_pack<init_val::denorm>();
4949
const auto step_values = ctors::get_init_values_pack<init_val::ulp>();
5050
passed &= for_all_combinations<ctors::run_test>(
51-
types, single_dim, context, base_values, step_values, queue);
51+
types, single_size, context, base_values, step_values, queue);
5252
}
5353
#endif
5454
{
@@ -57,7 +57,7 @@ int main(int, char **) {
5757
const auto step_values =
5858
ctors::get_init_values_pack<init_val::ulp, init_val::ulp_half>();
5959
passed &= for_all_combinations<ctors::run_test>(
60-
types, single_dim, context, base_values, step_values, queue);
60+
types, single_size, context, base_values, step_values, queue);
6161
}
6262

6363
std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int main(int, char **) {
3535
bool passed = true;
3636

3737
const auto types = get_tested_types<tested_types::fp_extra>();
38-
const auto single_dim = get_dimensions<8>();
38+
const auto single_size = get_sizes<8>();
3939
const auto context = unnamed_type_pack<ctors::var_decl>::generate();
4040
// Run for specific combinations of types, base and step values and vector
4141
// length.
@@ -48,7 +48,7 @@ int main(int, char **) {
4848
const auto step_values =
4949
ctors::get_init_values_pack<ctors::init_val::ulp>();
5050
passed &= for_all_combinations<ctors::run_test>(
51-
types, single_dim, context, base_values, step_values, queue);
51+
types, single_size, context, base_values, step_values, queue);
5252
}
5353
#endif
5454
{
@@ -59,7 +59,7 @@ int main(int, char **) {
5959
ctors::get_init_values_pack<ctors::init_val::ulp,
6060
ctors::init_val::ulp_half>();
6161
passed &= for_all_combinations<ctors::run_test>(
62-
types, single_dim, context, base_values, step_values, queue);
62+
types, single_size, context, base_values, step_values, queue);
6363
}
6464

6565
std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// RUN: %GPU_RUN_PLACEHOLDER %t.out
1616
//
1717
// Test for simd fill constructor for core types.
18-
// This test uses different data types, dimensionality, base and step values and
18+
// This test uses different data types, sizes, base and step values and
1919
// different simd constructor invocation contexts. The test do the following
2020
// actions:
2121
// - construct simd with pre-defined base and step value
@@ -38,7 +38,7 @@ int main(int, char **) {
3838
{
3939
// Validate basic functionality works for every invocation context
4040
const auto types = named_type_pack<char, int>::generate("char", "int");
41-
const auto dims = get_dimensions<1, 8>();
41+
const auto sizes = get_sizes<1, 8>();
4242
const auto contexts =
4343
unnamed_type_pack<ctors::initializer, ctors::var_decl,
4444
ctors::rval_in_expr, ctors::const_ref>::generate();
@@ -47,41 +47,41 @@ int main(int, char **) {
4747
ctors::get_init_values_pack<init_val::min_half>();
4848
const auto step_values = ctors::get_init_values_pack<init_val::zero>();
4949
passed &= for_all_combinations<ctors::run_test>(
50-
types, dims, contexts, base_values, step_values, queue);
50+
types, sizes, contexts, base_values, step_values, queue);
5151
}
5252
{
5353
const auto base_values =
5454
ctors::get_init_values_pack<init_val::min_half, init_val::zero>();
5555
const auto step_values =
5656
ctors::get_init_values_pack<init_val::positive>();
5757
passed &= for_all_combinations<ctors::run_test>(
58-
types, dims, contexts, base_values, step_values, queue);
58+
types, sizes, contexts, base_values, step_values, queue);
5959
}
6060
}
6161
{
6262
// Validate basic functionality works for every type
6363
const auto types = get_tested_types<tested_types::core>();
64-
const auto dims = get_all_dimensions();
64+
const auto sizes = get_all_sizes();
6565
const auto contexts = unnamed_type_pack<ctors::var_decl>::generate();
6666
{
6767
const auto base_values =
6868
ctors::get_init_values_pack<init_val::min, init_val::max_half>();
6969
const auto step_values = ctors::get_init_values_pack<init_val::zero>();
7070
passed &= for_all_combinations<ctors::run_test>(
71-
types, dims, contexts, base_values, step_values, queue);
71+
types, sizes, contexts, base_values, step_values, queue);
7272
}
7373
{
7474
const auto base_values =
7575
ctors::get_init_values_pack<init_val::zero, init_val::max_half>();
7676
const auto step_values =
7777
ctors::get_init_values_pack<init_val::positive, init_val::negative>();
7878
passed &= for_all_combinations<ctors::run_test>(
79-
types, dims, contexts, base_values, step_values, queue);
79+
types, sizes, contexts, base_values, step_values, queue);
8080
}
8181
}
8282
{
8383
// Verify specific cases for different type groups
84-
const auto dims = get_dimensions<8>();
84+
const auto sizes = get_sizes<8>();
8585
const auto contexts = unnamed_type_pack<ctors::var_decl>::generate();
8686
{
8787
const auto types = get_tested_types<tested_types::uint>();
@@ -92,7 +92,7 @@ int main(int, char **) {
9292
ctors::get_init_values_pack<init_val::positive,
9393
init_val::negative>();
9494
passed &= for_all_combinations<ctors::run_test>(
95-
types, dims, contexts, base_values, step_values, queue);
95+
types, sizes, contexts, base_values, step_values, queue);
9696
}
9797
}
9898
{
@@ -102,14 +102,14 @@ int main(int, char **) {
102102
const auto step_values =
103103
ctors::get_init_values_pack<init_val::positive>();
104104
passed &= for_all_combinations<ctors::run_test>(
105-
types, dims, contexts, base_values, step_values, queue);
105+
types, sizes, contexts, base_values, step_values, queue);
106106
}
107107
{
108108
const auto base_values = ctors::get_init_values_pack<init_val::max>();
109109
const auto step_values =
110110
ctors::get_init_values_pack<init_val::negative>();
111111
passed &= for_all_combinations<ctors::run_test>(
112-
types, dims, contexts, base_values, step_values, queue);
112+
types, sizes, contexts, base_values, step_values, queue);
113113
}
114114
}
115115
{
@@ -119,28 +119,28 @@ int main(int, char **) {
119119
ctors::get_init_values_pack<init_val::neg_inf>();
120120
const auto step_values = ctors::get_init_values_pack<init_val::max>();
121121
passed &= for_all_combinations<ctors::run_test>(
122-
types, dims, contexts, base_values, step_values, queue);
122+
types, sizes, contexts, base_values, step_values, queue);
123123
}
124124
{
125125
const auto base_values = ctors::get_init_values_pack<init_val::max>();
126126
const auto step_values =
127127
ctors::get_init_values_pack<init_val::neg_inf>();
128128
passed &= for_all_combinations<ctors::run_test>(
129-
types, dims, contexts, base_values, step_values, queue);
129+
types, sizes, contexts, base_values, step_values, queue);
130130
}
131131
{
132132
const auto base_values = ctors::get_init_values_pack<init_val::nan>();
133133
const auto step_values =
134134
ctors::get_init_values_pack<init_val::negative>();
135135
passed &= for_all_combinations<ctors::run_test>(
136-
types, dims, contexts, base_values, step_values, queue);
136+
types, sizes, contexts, base_values, step_values, queue);
137137
}
138138
{
139139
const auto base_values =
140140
ctors::get_init_values_pack<init_val::negative>();
141141
const auto step_values = ctors::get_init_values_pack<init_val::nan>();
142142
passed &= for_all_combinations<ctors::run_test>(
143-
types, dims, contexts, base_values, step_values, queue);
143+
types, sizes, contexts, base_values, step_values, queue);
144144
}
145145
}
146146
}

0 commit comments

Comments
 (0)