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

[SYCL][ESIMD] Replace "dim", "dimensions" with "size", "sizes", etc. #803

Merged
merged 3 commits into from
Feb 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions SYCL/ESIMD/api/functional/ctors/ctor_array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class const_ref {

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

public:
bool operator()(sycl::queue &queue, const std::string &data_type) {
Expand Down
9 changes: 5 additions & 4 deletions SYCL/ESIMD/api/functional/ctors/ctor_array_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out
//
// Test for simd constructor from an array.
// This test uses different data types, dimensionality and different simd
// constructor invocation contexts.
// This test uses different data types, sizes and different simd constructor
// invocation contexts.
// The test does the following actions:
// - construct fixed-size array that filled with reference values
// - use std::move() to provide it to simd constructor
Expand All @@ -33,12 +33,13 @@ int main(int, char **) {
bool passed = true;

const auto types = get_tested_types<tested_types::core>();
const auto dims = get_all_dimensions();
const auto sizes = get_all_sizes();
const auto contexts =
unnamed_type_pack<ctors::initializer, ctors::var_decl,
ctors::rval_in_expr, ctors::const_ref>::generate();

passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
passed &=
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);

std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
return passed ? 0 : 1;
Expand Down
9 changes: 5 additions & 4 deletions SYCL/ESIMD/api/functional/ctors/ctor_array_fp_extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out
//
// Test for simd constructor from an array.
// This test uses extra fp data types, dimensionality and different simd
// constructor invocation contexts.
// This test uses extra fp data types, sizes and different simd constructor
// invocation contexts.
// The test does the following actions:
// - construct fixed-size array that filled with reference values
// - use std::move() to provide it to simd constructor
Expand All @@ -33,12 +33,13 @@ int main(int, char **) {
bool passed = true;

const auto types = get_tested_types<tested_types::fp_extra>();
const auto dims = get_all_dimensions();
const auto sizes = get_all_sizes();
const auto contexts =
unnamed_type_pack<ctors::initializer, ctors::var_decl,
ctors::rval_in_expr, ctors::const_ref>::generate();

passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
passed &=
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);

std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
return passed ? 0 : 1;
Expand Down
4 changes: 2 additions & 2 deletions SYCL/ESIMD/api/functional/ctors/ctor_copy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class const_ref {

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

public:
bool operator()(sycl::queue &queue, const std::string &data_type) {
Expand Down
9 changes: 5 additions & 4 deletions SYCL/ESIMD/api/functional/ctors/ctor_copy_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out
//
// Test for simd copy constructor.
// This test uses different data types, dimensionality and different simd
// constructor invocation contexts.
// This test uses different data types, sizes and different simd constructor
// invocation contexts.
// The test do the following actions:
// - construct simd object with golden values calls copy constructor from
// constructed simd object
Expand All @@ -33,12 +33,13 @@ int main(int, char **) {
bool passed = true;

const auto types = get_tested_types<tested_types::core>();
const auto dims = get_all_dimensions();
const auto sizes = get_all_sizes();
const auto contexts =
unnamed_type_pack<ctors::initializer, ctors::var_decl,
ctors::rval_in_expr, ctors::const_ref>::generate();

passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
passed &=
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);

std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
return passed ? 0 : 1;
Expand Down
9 changes: 5 additions & 4 deletions SYCL/ESIMD/api/functional/ctors/ctor_copy_fp_extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out
//
// Test for simd copy constructor.
// This test uses extra fp data types, dimensionality and different simd
// constructor invocation contexts.
// This test uses different data types, sizes and different simd constructor
// invocation contexts.
// The test do the following actions:
// - construct simd object with golden values calls copy constructor from
// constructed simd object
Expand All @@ -33,12 +33,13 @@ int main(int, char **) {
bool passed = true;

const auto types = get_tested_types<tested_types::fp_extra>();
const auto dims = get_all_dimensions();
const auto sizes = get_all_sizes();
const auto contexts =
unnamed_type_pack<ctors::initializer, ctors::var_decl,
ctors::rval_in_expr, ctors::const_ref>::generate();

passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
passed &=
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);

std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
return passed ? 0 : 1;
Expand Down
4 changes: 2 additions & 2 deletions SYCL/ESIMD/api/functional/ctors/ctor_default.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ struct const_ref {
};

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

bool operator()(sycl::queue &queue, const std::string &data_type) {
bool passed = true;
Expand Down
9 changes: 5 additions & 4 deletions SYCL/ESIMD/api/functional/ctors/ctor_default_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out
//
// Test for simd default constructor.
// This test uses different data types, dimensionality and different simd
// constructor invocation contexts.
// This test uses different data types, sizes and different simd constructor
// invocation contexts.
// The test do the following actions:
// - call simd default constructor
// - verify that values from simd is equal to default value of provided
Expand All @@ -33,12 +33,13 @@ int main(int, char **) {
bool passed = true;

const auto types = get_tested_types<tested_types::core>();
const auto dims = get_all_dimensions();
const auto sizes = get_all_sizes();
const auto contexts =
unnamed_type_pack<ctors::initializer, ctors::var_decl,
ctors::rval_in_expr, ctors::const_ref>::generate();

passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
passed &=
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);

std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
return passed ? 0 : 1;
Expand Down
9 changes: 5 additions & 4 deletions SYCL/ESIMD/api/functional/ctors/ctor_default_fp_extra.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out
//
// Test for simd default constructor.
// This test uses extra fp data types, dimensionality and different simd
// constructor invocation contexts.
// This test uses different data types, sizes and different simd constructor
// invocation contexts.
// The test do the following actions:
// - call simd default constructor
// - verify that values from simd is equal to default value of provided
Expand All @@ -33,12 +33,13 @@ int main(int, char **) {
bool passed = true;

const auto types = get_tested_types<tested_types::fp_extra>();
const auto dims = get_all_dimensions();
const auto sizes = get_all_sizes();
const auto contexts =
unnamed_type_pack<ctors::initializer, ctors::var_decl,
ctors::rval_in_expr, ctors::const_ref>::generate();

passed &= for_all_combinations<ctors::run_test>(types, dims, contexts, queue);
passed &=
for_all_combinations<ctors::run_test>(types, sizes, contexts, queue);

std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
return passed ? 0 : 1;
Expand Down
4 changes: 2 additions & 2 deletions SYCL/ESIMD/api/functional/ctors/ctor_fill.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ template <init_val... Values> auto get_init_values_pack() {
return value_pack<init_val, Values...>::generate_unnamed();
}

template <typename DataT, typename DimT, typename TestCaseT, typename BaseValT,
template <typename DataT, typename SizeT, typename TestCaseT, typename BaseValT,
typename StepT>
class run_test {
static constexpr int NumElems = DimT::value;
static constexpr int NumElems = SizeT::value;
static constexpr init_val BaseVal = BaseValT::value;
static constexpr init_val Step = StepT::value;
using KernelT = kernel_for_fill<DataT, NumElems, TestCaseT, BaseVal, Step>;
Expand Down
8 changes: 4 additions & 4 deletions SYCL/ESIMD/api/functional/ctors/ctor_fill_accuracy_fp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ int main(int, char **) {

bool passed = true;

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

// Run for specific combinations of types, base and step values and vector
Expand All @@ -48,7 +48,7 @@ int main(int, char **) {
const auto base_values = ctors::get_init_values_pack<init_val::denorm>();
const auto step_values = ctors::get_init_values_pack<init_val::ulp>();
passed &= for_all_combinations<ctors::run_test>(
types, single_dim, context, base_values, step_values, queue);
types, single_size, context, base_values, step_values, queue);
}
#endif
{
Expand All @@ -57,7 +57,7 @@ int main(int, char **) {
const auto step_values =
ctors::get_init_values_pack<init_val::ulp, init_val::ulp_half>();
passed &= for_all_combinations<ctors::run_test>(
types, single_dim, context, base_values, step_values, queue);
types, single_size, context, base_values, step_values, queue);
}

std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int, char **) {
bool passed = true;

const auto types = get_tested_types<tested_types::fp_extra>();
const auto single_dim = get_dimensions<8>();
const auto single_size = get_sizes<8>();
const auto context = unnamed_type_pack<ctors::var_decl>::generate();
// Run for specific combinations of types, base and step values and vector
// length.
Expand All @@ -48,7 +48,7 @@ int main(int, char **) {
const auto step_values =
ctors::get_init_values_pack<ctors::init_val::ulp>();
passed &= for_all_combinations<ctors::run_test>(
types, single_dim, context, base_values, step_values, queue);
types, single_size, context, base_values, step_values, queue);
}
#endif
{
Expand All @@ -59,7 +59,7 @@ int main(int, char **) {
ctors::get_init_values_pack<ctors::init_val::ulp,
ctors::init_val::ulp_half>();
passed &= for_all_combinations<ctors::run_test>(
types, single_dim, context, base_values, step_values, queue);
types, single_size, context, base_values, step_values, queue);
}

std::cout << (passed ? "=== Test passed\n" : "=== Test FAILED\n");
Expand Down
30 changes: 15 additions & 15 deletions SYCL/ESIMD/api/functional/ctors/ctor_fill_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// RUN: %GPU_RUN_PLACEHOLDER %t.out
//
// Test for simd fill constructor for core types.
// This test uses different data types, dimensionality, base and step values and
// This test uses different data types, sizes, base and step values and
// different simd constructor invocation contexts. The test do the following
// actions:
// - construct simd with pre-defined base and step value
Expand All @@ -38,7 +38,7 @@ int main(int, char **) {
{
// Validate basic functionality works for every invocation context
const auto types = named_type_pack<char, int>::generate("char", "int");
const auto dims = get_dimensions<1, 8>();
const auto sizes = get_sizes<1, 8>();
const auto contexts =
unnamed_type_pack<ctors::initializer, ctors::var_decl,
ctors::rval_in_expr, ctors::const_ref>::generate();
Expand All @@ -47,41 +47,41 @@ int main(int, char **) {
ctors::get_init_values_pack<init_val::min_half>();
const auto step_values = ctors::get_init_values_pack<init_val::zero>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
{
const auto base_values =
ctors::get_init_values_pack<init_val::min_half, init_val::zero>();
const auto step_values =
ctors::get_init_values_pack<init_val::positive>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
}
{
// Validate basic functionality works for every type
const auto types = get_tested_types<tested_types::core>();
const auto dims = get_all_dimensions();
const auto sizes = get_all_sizes();
const auto contexts = unnamed_type_pack<ctors::var_decl>::generate();
{
const auto base_values =
ctors::get_init_values_pack<init_val::min, init_val::max_half>();
const auto step_values = ctors::get_init_values_pack<init_val::zero>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
{
const auto base_values =
ctors::get_init_values_pack<init_val::zero, init_val::max_half>();
const auto step_values =
ctors::get_init_values_pack<init_val::positive, init_val::negative>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
}
{
// Verify specific cases for different type groups
const auto dims = get_dimensions<8>();
const auto sizes = get_sizes<8>();
const auto contexts = unnamed_type_pack<ctors::var_decl>::generate();
{
const auto types = get_tested_types<tested_types::uint>();
Expand All @@ -92,7 +92,7 @@ int main(int, char **) {
ctors::get_init_values_pack<init_val::positive,
init_val::negative>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
}
{
Expand All @@ -102,14 +102,14 @@ int main(int, char **) {
const auto step_values =
ctors::get_init_values_pack<init_val::positive>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
{
const auto base_values = ctors::get_init_values_pack<init_val::max>();
const auto step_values =
ctors::get_init_values_pack<init_val::negative>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
}
{
Expand All @@ -119,28 +119,28 @@ int main(int, char **) {
ctors::get_init_values_pack<init_val::neg_inf>();
const auto step_values = ctors::get_init_values_pack<init_val::max>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
{
const auto base_values = ctors::get_init_values_pack<init_val::max>();
const auto step_values =
ctors::get_init_values_pack<init_val::neg_inf>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
{
const auto base_values = ctors::get_init_values_pack<init_val::nan>();
const auto step_values =
ctors::get_init_values_pack<init_val::negative>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
{
const auto base_values =
ctors::get_init_values_pack<init_val::negative>();
const auto step_values = ctors::get_init_values_pack<init_val::nan>();
passed &= for_all_combinations<ctors::run_test>(
types, dims, contexts, base_values, step_values, queue);
types, sizes, contexts, base_values, step_values, queue);
}
}
}
Expand Down
Loading