Skip to content

Commit

Permalink
Merge pull request #816 from AlexeySachkov/private/asachkov/minimize-…
Browse files Browse the repository at this point in the history
…usage-of-simple-swizzles-macro

Improve vector tests compilation time
  • Loading branch information
bader authored Nov 4, 2023
2 parents a6c389b + c034bdf commit 9236123
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 2 deletions.
1 change: 0 additions & 1 deletion tests/common/vector.template
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
**************************************************************************/

$IFDEF
#define SYCL_SIMPLE_SWIZZLES

#include "../common/common.h"
#include "../common/common_vec.h"
Expand Down
59 changes: 59 additions & 0 deletions tests/common/vector_swizzle_assignment.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*************************************************************************
//
// 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.
//
**************************************************************************/

// 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

#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<TEST_NAME> proxy;

} /* namespace vector_$CATEGORY_$TYPE_NAME__ */
$ENDIF
2 changes: 1 addition & 1 deletion tests/vector_swizzle_assignment/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit 9236123

Please sign in to comment.