Skip to content

Commit

Permalink
Merge pull request KhronosGroup#285 from kopylovanat/refactor-properties
Browse files Browse the repository at this point in the history
Update compile-time properties tests after spec update
  • Loading branch information
kopylovanat committed Mar 4, 2022
2 parents 1a493ed + 1636e8e commit 339f95e
Show file tree
Hide file tree
Showing 19 changed files with 369 additions and 355 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Expand Up @@ -48,9 +48,9 @@ endif()

# ------------------
# Extensive mode for running extension oneAPI compile-time property list tests
option(SYCL_ENABLE_EXT_ONEAPI_PROPERTY_LIST_TESTS
option(SYCL_EXT_ONEAPI_PROPERTIES
"Enable extension oneAPI compile-time property list tests" OFF)
if(SYCL_ENABLE_EXT_ONEAPI_PROPERTY_LIST_TESTS)
if(SYCL_EXT_ONEAPI_PROPERTIES)
message(STATUS "oneAPI extension compile-time property list tests mode: ON")
endif()
# ------------------
Expand Down
56 changes: 28 additions & 28 deletions intel_test_drivers/case.json
Expand Up @@ -245,11 +245,11 @@
"catch2" : 0,
"folder" : "extension/oneapi_device_global"
},
"property_list_property_value" : {
"source" : "property_list_property_value",
"binary" : "test_oneapi_property_list",
"properties_property_value" : {
"source" : "properties_property_value",
"binary" : "test_oneapi_properties",
"catch2" : 0,
"folder" : "extension/oneapi_property_list"
"folder" : "extension/oneapi_properties"
},
"device_selector_predefined" : {
"source" : "device_selector_predefined",
Expand Down Expand Up @@ -353,11 +353,11 @@
"catch2" : 0,
"folder" : "extension/oneapi_sub_group_mask"
},
"property_list_different_order" : {
"source" : "property_list_different_order",
"binary" : "test_oneapi_property_list",
"properties_different_order" : {
"source" : "properties_different_order",
"binary" : "test_oneapi_properties",
"catch2" : 0,
"folder" : "extension/oneapi_property_list"
"folder" : "extension/oneapi_properties"
},
"accessor_legacy_api_buffer_core" : {
"source" : "accessor_api_buffer_core",
Expand Down Expand Up @@ -833,11 +833,11 @@
"catch2" : 0,
"folder" : "context"
},
"property_list_prop_eq_op" : {
"source" : "property_list_prop_eq_op",
"binary" : "test_oneapi_property_list",
"properties_prop_eq_op" : {
"source" : "properties_prop_eq_op",
"binary" : "test_oneapi_properties",
"catch2" : 0,
"folder" : "extension/oneapi_property_list"
"folder" : "extension/oneapi_properties"
},
"specialization_constants_multiple_via_kb_fp64" : {
"source" : "specialization_constants_multiple_via_kb_fp64",
Expand Down Expand Up @@ -1373,11 +1373,11 @@
"catch2" : 0,
"folder" : "pointers"
},
"property_list_is_property_list" : {
"source" : "property_list_is_property_list",
"binary" : "test_oneapi_property_list",
"properties_is_property_list" : {
"source" : "properties_is_property_list",
"binary" : "test_oneapi_properties",
"catch2" : 0,
"folder" : "extension/oneapi_property_list"
"folder" : "extension/oneapi_properties"
},
"has_kernel_bundle_core_reqd_like_support_work_group_size_ctx_only" : {
"source" : "has_kernel_bundle_core_reqd_like_support_work_group_size_ctx_only",
Expand Down Expand Up @@ -1451,11 +1451,11 @@
"catch2" : 0,
"folder" : "multi_ptr"
},
"property_list_has_property" : {
"source" : "property_list_has_property",
"binary" : "test_oneapi_property_list",
"properties_has_property" : {
"source" : "properties_has_property",
"binary" : "test_oneapi_properties",
"catch2" : 0,
"folder" : "extension/oneapi_property_list"
"folder" : "extension/oneapi_properties"
},
"host_task_invoke_api" : {
"source" : "host_task_invoke_api",
Expand Down Expand Up @@ -1511,11 +1511,11 @@
"catch2" : 0,
"folder" : "specialization_constants"
},
"property_list_is_device_copyable" : {
"source" : "property_list_is_device_copyable",
"binary" : "test_oneapi_property_list",
"properties_is_device_copyable" : {
"source" : "properties_is_device_copyable",
"binary" : "test_oneapi_properties",
"catch2" : 0,
"folder" : "extension/oneapi_property_list"
"folder" : "extension/oneapi_properties"
},
"has_kernel_bundle_zero_device_dev_and_k_id" : {
"source" : "has_kernel_bundle_zero_device_dev_and_k_id",
Expand Down Expand Up @@ -1913,11 +1913,11 @@
"catch2" : 0,
"folder" : "multi_ptr"
},
"property_list_is_property_check" : {
"source" : "property_list_is_property_check",
"binary" : "test_oneapi_property_list",
"properties_is_property_check" : {
"source" : "properties_is_property_check",
"binary" : "test_oneapi_properties",
"catch2" : 0,
"folder" : "extension/oneapi_property_list"
"folder" : "extension/oneapi_properties"
},
"specialization_constants_via_kernel_bundle_fp64" : {
"source" : "specialization_constants_via_kernel_bundle_fp64",
Expand Down
18 changes: 9 additions & 9 deletions intel_test_drivers/sycl_cts.pl
Expand Up @@ -198,10 +198,10 @@ sub remove_unused_category_src {
next if ($category_dir =~ m/CMakeLists\.txt|common/);

my @test_cpps = glob("$category_dir/*.cpp");
# remove cpp if it is not included in the test list
# remove cpp if it is not included in the test list
for my $test_cpp (@test_cpps) {
my $test_cpp_basename = get_base_name_we($test_cpp);
if (!grep(/^$test_cpp_basename$/, @test_names) &&
if (!grep(/^$test_cpp_basename$/, @test_names) &&
grep(/^$test_cpp_basename$/, @target_srcs) &&
!($category_dir =~ m/kernel_bundle/)
) {
Expand Down Expand Up @@ -607,7 +607,7 @@ sub dryrun {

sub prebuild {
my $build_dir = shift;
my $binary_dir = shift;
my $binary_dir = shift;
my $src_dir = shift;
my $test_name_list = shift;

Expand Down Expand Up @@ -641,7 +641,7 @@ sub prebuild {

sub get_cmake_cmd {
my $build_dir = shift;
my $binary_dir = shift;
my $binary_dir = shift;
my $src_dir = shift;
my $compiler_cmd = get_cmplr_cmd("cpp_compiler");
my $compiler = "dpcpp";
Expand Down Expand Up @@ -743,7 +743,7 @@ sub get_cmake_cmd {
$opt_linker_flags .= " -Wl,-no-relax ";

my $sycl_flags = "-fsycl-device-code-split=$split_mode";

# CMPLRTOOLS-24280: work-around for tc output limit.
$sycl_flags .= ";-Wno-deprecated-declarations";

Expand Down Expand Up @@ -777,7 +777,7 @@ sub get_cmake_cmd {
if ($current_test =~ m/device_global/) {
push(@cmake_cmd, "-DSYCL_ENABLE_EXT_ONEAPI_DEVICE_GLOBAL_TESTS=1");
} elsif ($current_test =~ m/property_list/) {
push(@cmake_cmd, "-DSYCL_ENABLE_EXT_ONEAPI_PROPERTY_LIST_TESTS=1");
push(@cmake_cmd, "-DSYCL_EXT_ONEAPI_PROPERTIES=1");
} elsif ($current_test =~ m/sub_group_mask/) {
push(@cmake_cmd, "-DSYCL_ENABLE_EXT_ONEAPI_SUB_GROUP_MASK_TESTS=1");
}
Expand Down Expand Up @@ -809,7 +809,7 @@ sub run_cmd_with_log {
my $tool = (split(' ', $cmd))[0];
$tool = basename($tool);
my $output = "[cmd][$tool] " . $cmd . "\n";

my $start_time = Time::HiRes::gettimeofday();
execute($cmd);
my $stop_time = Time::HiRes::gettimeofday();
Expand Down Expand Up @@ -877,7 +877,7 @@ sub BuildTest {
# Write log to build_*.lf
generate_build_lf($cmake_output);
# Set failure message
generate_current_test_fail_message($COMPFAIL, $cmake_output);
generate_current_test_fail_message($COMPFAIL, $cmake_output);
return $ret;
}
($ret, $ninja_output) = run_cmd_with_log($ninja_cmd);
Expand Down Expand Up @@ -996,7 +996,7 @@ sub RunTest {
} elsif (get_running_device() == RUNNING_DEVICE_NV_GPU) {
$vendor = "NVIDIA";
$platform = "CUDA";
$device = "NVIDIA"; # NVIDIA TITAN RTX
$device = "NVIDIA"; # NVIDIA TITAN RTX
}

my @run_option = ();
Expand Down
22 changes: 11 additions & 11 deletions intel_test_drivers/xml_generator.pl
Expand Up @@ -61,10 +61,10 @@ sub get_generated_src {
if ($cmd =~ /\-o\s*(.+\.cpp)/) {
# print("$1\n");
push(@source_files, $1);
}
}
}
}
}
}
}

sub get_generated_binary {
Expand Down Expand Up @@ -146,7 +146,7 @@ sub get_cts_cases_and_folders {
push(@cmake_cmd, "-Dopencl_device_name=" . $opencl_device);
push(@cmake_cmd, "-DCMAKE_BUILD_TYPE=Release");
push(@cmake_cmd, "-DSYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS=ON");
push(@cmake_cmd, "-DSYCL_ENABLE_EXT_ONEAPI_PROPERTY_LIST_TESTS=1");
push(@cmake_cmd, "-DSYCL_EXT_ONEAPI_PROPERTIES=1");
push(@cmake_cmd, "-DSYCL_ENABLE_EXT_ONEAPI_SUB_GROUP_MASK_TESTS=1");
push(@cmake_cmd, "-DSYCL_ENABLE_EXT_ONEAPI_DEVICE_GLOBAL_TESTS=1");

Expand Down Expand Up @@ -216,7 +216,7 @@ sub check_diff_cases {
for my $element (@eixsting_test_map) { $count{$element}++ }

my (@in_old_only, @in_new_only);
for my $element (@new_cases) {
for my $element (@new_cases) {
if (! exists($count{$element})) {
push(@in_new_only, $element);
next;
Expand Down Expand Up @@ -265,18 +265,18 @@ sub add_tests {
if (! -e "$config_file_path/TEMPLATE_$shorten_folder.xml") {
generate_config_file($case, $folder);
}

($case = $case) =~ s/^#//;
my $new_case = {testName => "$case", splitGroup => $split_group, configFile => "$config_file_path/TEMPLATE_$shorten_folder.xml"};
if (exists($test_preview_rule->{$case})) {
$new_case->{preview} = $test_preview_rule->{$case};
}
push(@new_tests, $new_case);
push(@new_array, $case);
push(@new_tests, $new_case);
push(@new_array, $case);
}
check_diff_cases(\@existing_array, \@new_array);
# sort by splitGroup and testName
@new_tests = sort { $a->{splitGroup} cmp $b->{splitGroup} or
@new_tests = sort { $a->{splitGroup} cmp $b->{splitGroup} or
$a->{configFile} cmp $b->{configFile} or
$a->{testName} cmp $b->{testName}
} @new_tests;
Expand All @@ -294,7 +294,7 @@ sub update_suite_xml {
add_common_path($xml);
# print("@$skip_tests\n");

foreach $case (keys %$cases) {
foreach $case (keys %$cases) {
for $skip (@$skip_tests) {
if ($case =~ m/$skip/) {
delete($cases->{$case});
Expand All @@ -311,7 +311,7 @@ sub update_cts_json {
my $json_name = shift;

my %json;
foreach $case (keys %$records) {
foreach $case (keys %$records) {
my $record = %$records->{$case};
my $source = %$record->{source};
my $folder = %$record->{folder};
Expand All @@ -323,7 +323,7 @@ sub update_cts_json {
$is_catch2 = 1;
}

$source =~ s/\.cpp//; # Remove .cpp suffix
$source =~ s/\.cpp//; # Remove .cpp suffix
my $new_record = {source => $source, folder => $folder, binary => $binary, catch2 => $is_catch2};
$json->{$case} = $new_record
# push(@records, $new_record);
Expand Down
14 changes: 7 additions & 7 deletions sycl_cts.xml
Expand Up @@ -340,13 +340,13 @@
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_device_global.xml" splitGroup="new" testName="device_global_queue_array_copy" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_device_global.xml" splitGroup="new" testName="device_global_queue_copy" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_device_global.xml" splitGroup="new" testName="device_global_queue_memcpy" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_different_order" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_has_property" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_is_device_copyable" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_is_property_check" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_is_property_list" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_prop_eq_op" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_property_value" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" preview="CMPLRLLVM-26971 2022/3/3 2022/3/14 nkopylox" splitGroup="new" testName="properties_different_order" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" preview="CMPLRLLVM-26971 2022/3/3 2022/3/14 nkopylox" splitGroup="new" testName="properties_has_property" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" preview="CMPLRLLVM-26971 2022/3/3 2022/3/14 nkopylox" splitGroup="new" testName="properties_is_device_copyable" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" preview="CMPLRLLVM-26971 2022/3/3 2022/3/14 nkopylox" splitGroup="new" testName="properties_is_property_check" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" preview="CMPLRLLVM-26971 2022/3/3 2022/3/14 nkopylox" splitGroup="new" testName="properties_is_property_list" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" preview="CMPLRLLVM-26971 2022/3/3 2022/3/14 nkopylox" splitGroup="new" testName="properties_prop_eq_op" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" preview="CMPLRLLVM-26971 2022/3/3 2022/3/14 nkopylox" splitGroup="new" testName="properties_property_value" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_sub_group_mask.xml" splitGroup="new" testName="sub_group_mask_all" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_sub_group_mask.xml" splitGroup="new" testName="sub_group_mask_any" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_sub_group_mask.xml" splitGroup="new" testName="sub_group_mask_count" />
Expand Down
14 changes: 7 additions & 7 deletions sycl_cts_light.xml
Expand Up @@ -326,13 +326,13 @@
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_device_global.xml" splitGroup="new" testName="device_global_queue_array_copy" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_device_global.xml" splitGroup="new" testName="device_global_queue_copy" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_device_global.xml" splitGroup="new" testName="device_global_queue_memcpy" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_different_order" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_has_property" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_is_device_copyable" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_is_property_check" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_is_property_list" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_prop_eq_op" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_property_list.xml" splitGroup="new" testName="property_list_property_value" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" splitGroup="new" testName="properties_different_order" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" splitGroup="new" testName="properties_has_property" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" splitGroup="new" testName="properties_is_device_copyable" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" splitGroup="new" testName="properties_is_property_check" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" splitGroup="new" testName="properties_is_property_list" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" splitGroup="new" testName="properties_prop_eq_op" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_properties.xml" splitGroup="new" testName="properties_property_value" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_sub_group_mask.xml" splitGroup="new" testName="sub_group_mask_all" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_sub_group_mask.xml" splitGroup="new" testName="sub_group_mask_any" />
<test configFile="intel_test_drivers/config/TEMPLATE_oneapi_sub_group_mask.xml" splitGroup="new" testName="sub_group_mask_count" />
Expand Down
8 changes: 8 additions & 0 deletions tests/extension/oneapi_properties/CMakeLists.txt
@@ -0,0 +1,8 @@
if(SYCL_EXT_ONEAPI_PROPERTIES)
# Temporarily define for device_global properties
# TODO: remove when device_global fully implemented
add_definitions(-DSYCL_EXT_ONEAPI_DEVICE_GLOBAL)
file(GLOB test_cases_list *.cpp)

add_cts_test(${test_cases_list})
endif()
Expand Up @@ -2,20 +2,20 @@
//
// SYCL 2020 Extension Conformance Test
//
// Provides test for compile-time property_list initialized with different
// Provides test for compile-time properties initialized with different
// order
//
*******************************************************************************/

#include "../../common/common.h"

#define TEST_NAME property_list_different_order
#define TEST_NAME properties_different_order

namespace TEST_NAMESPACE {

using namespace sycl_cts;

/** test compile-time property_list initialized with different order
/** test compile-time properties initialized with different order
*/
class TEST_NAME : public util::test_base {
public:
Expand All @@ -28,15 +28,15 @@ class TEST_NAME : public util::test_base {
/** execute the test
*/
void run(util::logger &log) override {
#if !defined(SYCL_EXT_ONEAPI_PROPERTY_LIST)
WARN("SYCL_EXT_ONEAPI_PROPERTY_LIST is not defined, test is skipped");
#if !defined(SYCL_EXT_ONEAPI_PROPERTIES)
WARN("SYCL_EXT_ONEAPI_PROPERTIES is not defined, test is skipped");
#elif !defined(SYCL_EXT_ONEAPI_DEVICE_GLOBAL)
WARN("SYCL_EXT_ONEAPI_DEVICE_GLOBAL is not defined, test is skipped");
#else
{
using namespace sycl::ext::oneapi;
property_list P1{implement_in_csr_v<true>, device_image_scope_v};
property_list P2{device_image_scope_v, implement_in_csr_v<true>};
using namespace sycl::ext::oneapi::experimental;
properties P1{implement_in_csr<true>, device_image_scope};
properties P2{device_image_scope, implement_in_csr<true>};
if (!std::is_same_v<decltype(P1), decltype(P2)>)
FAIL(log,
"property lists initialized with different order are not the same "
Expand Down

0 comments on commit 339f95e

Please sign in to comment.