From 23cac25fb34e7888e0a7c88dbc7a61fb1826cd73 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Mon, 16 Oct 2023 03:08:33 -0700 Subject: [PATCH 1/2] Improve vector tests compilation time Refactored test templates to avoid defining `SYCL_SIMPLE_SWIZZLES` for most of those tests. Even though simple swizzles are not used by those tests, defining a macro still increases amount of input source code a compiler should look through, thus increasing compilation time unnecessary. --- tests/common/vector.template | 1 - .../common/vector_swizzle_assignment.template | 56 +++++++++++++++++++ .../vector_swizzle_assignment/CMakeLists.txt | 2 +- 3 files changed, 57 insertions(+), 2 deletions(-) create mode 100644 tests/common/vector_swizzle_assignment.template diff --git a/tests/common/vector.template b/tests/common/vector.template index 1fd85f097..d44ee1c32 100644 --- a/tests/common/vector.template +++ b/tests/common/vector.template @@ -21,7 +21,6 @@ **************************************************************************/ $IFDEF -#define SYCL_SIMPLE_SWIZZLES #include "../common/common.h" #include "../common/common_vec.h" diff --git a/tests/common/vector_swizzle_assignment.template b/tests/common/vector_swizzle_assignment.template new file mode 100644 index 000000000..6a3fd4855 --- /dev/null +++ b/tests/common/vector_swizzle_assignment.template @@ -0,0 +1,56 @@ +/************************************************************************* +// +// SYCL Conformance Test Suite +// +// +// Copyright (c) 2018-2022 Codeplay Software LTD. All Rights Reserved. +// Copyright (c) 2023 The Khronos Group Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +**************************************************************************/ + +$IFDEF +#define SYCL_SIMPLE_SWIZZLES + +#include "../common/common.h" +#include "../common/common_vec.h" + +#define TEST_NAME vector_$CATEGORY_$TYPE_NAME + +namespace vector_$CATEGORY_$TYPE_NAME__ { +using namespace sycl_cts; + +class TEST_NAME : public util::test_base { + public: + /** return information about this test + */ + void get_info(test_base::info &out) const override { + set_test_info(out, TOSTRING(TEST_NAME), TEST_FILE); + } + + $TEST_FUNCS + + /** execute the test + */ + void run(util::logger &log) override { + + $FUNC_CALLS + + } +}; + +util::test_proxy proxy; + +} /* namespace vector_$CATEGORY_$TYPE_NAME__ */ +$ENDIF diff --git a/tests/vector_swizzle_assignment/CMakeLists.txt b/tests/vector_swizzle_assignment/CMakeLists.txt index 44e3054ab..3929f5a3f 100644 --- a/tests/vector_swizzle_assignment/CMakeLists.txt +++ b/tests/vector_swizzle_assignment/CMakeLists.txt @@ -17,7 +17,7 @@ foreach(TY IN LISTS TYPE_LIST) generate_cts_test(TESTS TEST_CASES_LIST GENERATOR "generate_vector_swizzle_assignment.py" OUTPUT ${OUT_FILE} - INPUT "../common/vector.template" + INPUT "../common/vector_swizzle_assignment.template" EXTRA_ARGS -type "${TY}") endforeach() From c034bdf3c936a5f2f828b75eff2798141b1f33b6 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 3 Nov 2023 03:44:15 -0700 Subject: [PATCH 2/2] Add comments to the new file --- tests/common/vector_swizzle_assignment.template | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/common/vector_swizzle_assignment.template b/tests/common/vector_swizzle_assignment.template index 6a3fd4855..e83974552 100644 --- a/tests/common/vector_swizzle_assignment.template +++ b/tests/common/vector_swizzle_assignment.template @@ -20,6 +20,9 @@ // **************************************************************************/ +// Note: this is essentially a copy of vector.template, but it has extra +// #define SYCL_SIMPLE_SWIZZLES which is required for the swizzles test. + $IFDEF #define SYCL_SIMPLE_SWIZZLES