Skip to content

Commit

Permalink
Merge branch 'SYCL-2020' into steffen/split_math_builtin_tests
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenlarsen committed Sep 11, 2024
2 parents e12d9de + db26da8 commit a7a6765
Show file tree
Hide file tree
Showing 54 changed files with 513 additions and 967 deletions.
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ Finally, start the compilation:
`cmake --build ./build`

After the compilation has finished, test executables for each category will be
placed in the `build/bin` directory. The `test_all` executable contains tests
for all categories.
placed in the `build/bin` directory.

### CMake Configuration Options

Expand Down Expand Up @@ -98,7 +97,7 @@ Additionally, the following SYCL implementation-specific options can be used:

Each of the executables produced in the `build/bin` directory acts as a
standalone test runner that can be used to launch tests for a particular test
category (or all tests in the case of `build/bin/test_all`).
category.

The ``--device`` argument is used to specify which device to run the tests on.
Selection is based on substring matching of the device name. ECMAScript regular
Expand Down
2 changes: 1 addition & 1 deletion ci/generate_exclude_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def query_cmake_targets(build_dir: str):
cmake_targets = []
for rt in raw_targets:
m = target_pattern.match(rt)
if m and m.group(1) != 'test_all':
if m:
cmake_targets.append(m.group(1))

return cmake_targets
Expand Down
8 changes: 6 additions & 2 deletions ci/hipsycl.filter
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ item
kernel
kernel_args
kernel_bundle
marray
marray_basic
marray_bitwise
marray_pre_post
marray_relational
marray_arithmetic_assignment
marray_arithmetic_binary
math_builtin_api
marray
multi_ptr
nd_item
nd_range
Expand Down
2 changes: 1 addition & 1 deletion docs/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ This adds a test case with the description `"a simple test case"` and the _tag_
Both can later be used to narrow down the set of test cases that will be executed during runtime.

When configuring CMake, the new test category will automatically be detected and a target with the name `test_simple` is added.
You can run the test case by either executing `./bin/test_simple` directly, or alternatively as part of `./bin/test_all`.
You can run the test case by executing `./bin/test_simple`.

IMPORTANT: For historic reasons, the CTS currently contains many test cases that are written in a different style.
Please see <<New-style vs Legacy Test Cases>> for more information.
Expand Down
13 changes: 10 additions & 3 deletions run_conformance_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ def handle_args(argv):
help='Skip build step and perform only testing for already compiled tests.',
required=False,
action='store_true')
parser.add_argument('--commit-hash',
help='Original SYCL-CTS commit hash used for the run',
type=str,
required=False)
args = parser.parse_args(argv)

commit_hash = args.commit_hash if args.commit_hash else 'Not specified'
full_conformance = 'OFF' if args.fast else 'ON'
test_deprecated_features = 'OFF' if args.disable_deprecated_features else 'ON'
full_feature_set = 'OFF' if args.reduced_feature_set else 'ON'
Expand All @@ -103,7 +108,7 @@ def handle_args(argv):
full_conformance, test_deprecated_features, args.exclude_categories,
args.implementation_name, args.additional_cmake_args, args.device,
args.additional_ctest_args, args.build_only, args.run_only,
full_feature_set)
commit_hash, full_feature_set)


def split_additional_args(additional_args):
Expand Down Expand Up @@ -247,7 +252,7 @@ def get_xml_test_results():
def update_xml_attribs(info_json, implementation_name, test_xml_root,
full_conformance, cmake_call, build_system_name,
build_system_call, ctest_call, test_deprecated_features,
full_feature_set):
commit_hash, full_feature_set):
"""
Adds attributes to the root of the xml trees json required by the
conformance report.
Expand All @@ -274,6 +279,7 @@ def update_xml_attribs(info_json, implementation_name, test_xml_root,
test_xml_root.attrib["DeviceFP64"] = info_json['device-fp64']

# Set Build Information attribs
test_xml_root.attrib["CommitHash"] = commit_hash
test_xml_root.attrib["FullConformanceMode"] = full_conformance
test_xml_root.attrib["CMakeInput"] = ' '.join(cmake_call)
test_xml_root.attrib["BuildSystemGenerator"] = build_system_name
Expand All @@ -291,7 +297,7 @@ def main(argv=sys.argv[1:]):
(cmake_exe, build_system_name, build_system_call, full_conformance,
test_deprecated_features, exclude_categories, implementation_name,
additional_cmake_args, device, additional_ctest_args,
build_only, run_only, full_feature_set) = handle_args(argv)
build_only, run_only, commit_hash, full_feature_set) = handle_args(argv)

# Generate a cmake call in a form accepted by subprocess.call()
cmake_call = generate_cmake_call(cmake_exe, build_system_name,
Expand Down Expand Up @@ -326,6 +332,7 @@ def main(argv=sys.argv[1:]):
cmake_call, build_system_name,
build_system_call, ctest_call,
test_deprecated_features,
commit_hash,
full_feature_set)

# Get the xml report stylesheet and add it to the results.
Expand Down
26 changes: 20 additions & 6 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ function(get_std_type OUT_LIST)
set(${OUT_LIST} ${${OUT_LIST}} ${STD_TYPE_LIST} PARENT_SCOPE)
endfunction()

function(get_marray_elem_type OUT_LIST)
set(TYPE_LIST "")
get_std_type(TYPE_LIST)

list(APPEND TYPE_LIST "custom_int")

if(SYCL_CTS_ENABLE_FULL_CONFORMANCE)
list(APPEND TYPE_LIST
"std::uint8_t"
"std::int16_t"
"std::uint16_t"
"std::uint32_t"
"std::int64_t"
"std::uint64_t"
)
endif()

set(${OUT_LIST} ${${OUT_LIST}} ${TYPE_LIST} PARENT_SCOPE)
endfunction()

function(get_no_vec_alias_type OUT_LIST)
set(NO_VEC_ALIAS_LIST "")
list(APPEND NO_VEC_ALIAS_LIST sycl::byte)
Expand Down Expand Up @@ -248,8 +268,6 @@ function(add_cts_test_helper)
set_property(TARGET ${test_exe_name}_objects
PROPERTY FOLDER "Tests/${test_exe_name}")

target_sources(test_all PRIVATE $<TARGET_OBJECTS:${test_exe_name}_objects>)

add_dependencies(test_conformance ${test_exe_name})
endfunction()

Expand Down Expand Up @@ -294,7 +312,3 @@ foreach(dir ${test_category_dirs})
add_subdirectory(${dir})
endif()
endforeach()

target_link_libraries(test_all PRIVATE CTS::util CTS::main_function oclmath)
target_link_libraries(test_all PRIVATE Catch2::Catch2 Threads::Threads)
add_sycl_to_target(TARGET test_all)
3 changes: 0 additions & 3 deletions tests/marray/CMakeLists.txt

This file was deleted.

45 changes: 0 additions & 45 deletions tests/marray/marray_alignment_fp16.cpp

This file was deleted.

45 changes: 0 additions & 45 deletions tests/marray/marray_alignment_fp64.cpp

This file was deleted.

45 changes: 0 additions & 45 deletions tests/marray/marray_constructor_fp16.cpp

This file was deleted.

45 changes: 0 additions & 45 deletions tests/marray/marray_constructor_fp64.cpp

This file was deleted.

45 changes: 0 additions & 45 deletions tests/marray/marray_members_fp16.cpp

This file was deleted.

Loading

0 comments on commit a7a6765

Please sign in to comment.