Skip to content
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
1 change: 0 additions & 1 deletion conformance_filters/codeplay.csv
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ vector_constructors
vector_operators
vector_swizzle_assignment
vector_swizzles
vector_swizzles_opencl
1 change: 0 additions & 1 deletion conformance_filters/core.csv
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,4 @@ vector_load_store
vector_operators
vector_swizzle_assignment
vector_swizzles
vector_swizzles_opencl
usm
30 changes: 2 additions & 28 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,32 +52,6 @@ function(get_std_type OUT_LIST)
set(${OUT_LIST} ${${OUT_LIST}} ${STD_TYPE_LIST} PARENT_SCOPE)
endfunction()

function(get_opencl_type OUT_LIST)
set(OPENCL_TYPE_LIST "")
list(APPEND OPENCL_TYPE_LIST
cl::sycl::cl_char
cl::sycl::cl_uchar)

list(APPEND OPENCL_TYPE_LIST
cl::sycl::cl_short
cl::sycl::cl_ushort)

list(APPEND OPENCL_TYPE_LIST
cl::sycl::cl_int
cl::sycl::cl_uint)

list(APPEND OPENCL_TYPE_LIST
cl::sycl::cl_long
cl::sycl::cl_ulong)

list(APPEND OPENCL_TYPE_LIST
cl::sycl::cl_float
cl::sycl::cl_double
cl::sycl::cl_half)

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

function(get_no_vec_alias_type OUT_LIST)
set(NO_VEC_ALIAS_LIST "")
list(APPEND NO_VEC_ALIAS_LIST cl::sycl::byte)
Expand All @@ -101,11 +75,11 @@ endfunction()

macro(half_double_filter list)
if(NOT SYCL_CTS_ENABLE_DOUBLE_TESTS)
list(REMOVE_ITEM ${list} double cl::sycl::cl_double)
list(REMOVE_ITEM ${list} double)
endif()

if(NOT SYCL_CTS_ENABLE_HALF_TESTS)
list(REMOVE_ITEM ${list} cl::sycl::half cl::sycl::cl_half)
list(REMOVE_ITEM ${list} cl::sycl::half)
endif()

endmacro()
Expand Down
101 changes: 13 additions & 88 deletions tests/common/common_python_vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,37 +59,6 @@ class Data:
('std::int64_t'): 'INT32_MAX'
}

opencl_types = [
'cl::sycl::cl_char', 'cl::sycl::cl_short', 'cl::sycl::cl_int',
'cl::sycl::cl_long', 'cl::sycl::cl_float', 'cl::sycl::cl_double',
'cl::sycl::cl_half'
]
opencl_type_dict = {
(False, 'cl::sycl::cl_char'): 'cl::sycl::cl_uchar',
(True, 'cl::sycl::cl_char'): 'cl::sycl::cl_char',
(False, 'cl::sycl::cl_short'): 'cl::sycl::cl_ushort',
(True, 'cl::sycl::cl_short'): 'cl::sycl::cl_short',
(False, 'cl::sycl::cl_int'): 'cl::sycl::cl_uint',
(True, 'cl::sycl::cl_int'): 'cl::sycl::cl_int',
(False, 'cl::sycl::cl_long'): 'cl::sycl::cl_ulong',
(True, 'cl::sycl::cl_long'): 'cl::sycl::cl_long',
(True, 'cl::sycl::cl_float'): 'cl::sycl::cl_float',
(True, 'cl::sycl::cl_double'): 'cl::sycl::cl_double',
(True, 'cl::sycl::cl_half'): 'cl::sycl::cl_half'
}
opencl_sized_return_type_dict = {
'cl::sycl::cl_char': 'cl::sycl::cl_char',
'cl::sycl::cl_uchar': 'cl::sycl::cl_char',
'cl::sycl::cl_short': 'cl::sycl::cl_short',
'cl::sycl::cl_ushort': 'cl::sycl::cl_short',
'cl::sycl::cl_half': 'cl::sycl::cl_short',
'cl::sycl::cl_int': 'cl::sycl::cl_int',
'cl::sycl::cl_uint': 'cl::sycl::cl_int',
'cl::sycl::cl_float': 'cl::sycl::cl_int',
'cl::sycl::cl_long': 'cl::sycl::cl_long',
'cl::sycl::cl_ulong': 'cl::sycl::cl_long',
'cl::sycl::cl_double': 'cl::sycl::cl_long'
}
alias_dict = {
'char': 'cl::sycl::char',
'signed char': 'cl::sycl::schar',
Expand All @@ -104,26 +73,12 @@ class Data:
'unsigned long long': 'cl::sycl::ulonglong',
'float': 'cl::sycl::float',
'double': 'cl::sycl::double',
'cl::sycl::half': 'cl::sycl::half',
'cl::sycl::cl_char': 'cl::sycl::cl_char',
'cl::sycl::cl_uchar': 'cl::sycl::cl_uchar',
'cl::sycl::cl_short': 'cl::sycl::cl_short',
'cl::sycl::cl_ushort': 'cl::sycl::cl_ushort',
'cl::sycl::cl_int': 'cl::sycl::cl_int',
'cl::sycl::cl_uint': 'cl::sycl::cl_uint',
'cl::sycl::cl_long': 'cl::sycl::cl_long',
'cl::sycl::cl_ulong': 'cl::sycl::cl_ulong',
'cl::sycl::cl_float': 'cl::sycl::cl_float',
'cl::sycl::cl_double': 'cl::sycl::cl_double',
'cl::sycl::cl_half': 'cl::sycl::cl_half'
'cl::sycl::half': 'cl::sycl::half'
}
value_default_dict = defaultdict(lambda: '0', {
'float': '0.0f',
'double': '0.0',
'cl::sycl::half': '0.0f',
'cl::sycl::cl_float': '0.0f',
'cl::sycl::cl_double': '0.0',
'cl::sycl::cl_half': '0.0f'
'cl::sycl::half': '0.0f'
})
vec_name_dict = {
1: 'One',
Expand Down Expand Up @@ -194,7 +149,6 @@ class Data:

class ReverseData:
rev_standard_type_dict = { Data.standard_type_dict[k] : k for k in list(Data.standard_type_dict.keys()) }
rev_opencl_type_dict = { Data.opencl_type_dict[k] : k for k in list(Data.opencl_type_dict.keys()) }
rev_fixed_width_type_dict = { Data.fixed_width_type_dict[k] : k for k in list(Data.fixed_width_type_dict.keys()) }


Expand Down Expand Up @@ -308,11 +262,10 @@ def append_fp_postfix(type_str, input_val_list):
to each value in the list if type_str is 'float', 'double' or 'cl::sycl::half'"""
result_val_list = []
for val in input_val_list:
if (type_str == 'float' or type_str == 'cl::sycl::cl_float'
or type_str == 'cl::sycl::half'
or type_str == 'cl::sycl::cl_half'):
if (type_str == 'float'
or type_str == 'cl::sycl::half'):
result_val_list.append(val + '.0f')
elif type_str == 'double' or type_str == 'cl::sycl::cl_double':
elif type_str == 'double':
result_val_list.append(val + '.0')
else:
result_val_list.append(val)
Expand Down Expand Up @@ -401,7 +354,7 @@ def write_source_file(test_str, func_calls, test_name, input_file, output_file,
with open(output_file, 'w+') as output:
output.write(source)

def get_standard_and_fixed_width_types():
def get_types():
types = ['char', 'cl::sycl::byte']
for base_type in Data.standard_types:
for sign in Data.signs:
Expand All @@ -415,24 +368,6 @@ def get_standard_and_fixed_width_types():
types.append(Data.fixed_width_type_dict[(sign, base_type)])
return types

def get_opencl_types():
types = list()
for base_type in Data.opencl_types:
for sign in Data.signs:
if (base_type == 'cl::sycl::cl_float'
or base_type == 'cl::sycl::cl_double'
or base_type == 'cl::sycl::cl_half') and sign is False:
continue
types.append(Data.opencl_type_dict[(sign, base_type)])
return types

def get_types():
types = list()
types += get_standard_and_fixed_width_types()
types += get_opencl_types()

return types

class SwizzleData:
swizzle_template = Template(
""" cl::sycl::vec<${type}, ${size}> ${name}DimTestVec = cl::sycl::vec<${type}, ${size}>(${testVecValues});
Expand All @@ -450,7 +385,7 @@ class SwizzleData:
if (!check_vector_values<${type}, ${size}>(swizzledVec, in_order_vals)) {
resAcc[0] = false;
}
if (!check_vector_get_count_get_size<${type}>(swizzledVec)) {
if (!check_vector_get_count_get_size<${type}, ${size}>(swizzledVec)) {
resAcc[0] = false;
}
#ifdef SYCL_CTS_EXTENSIVE_MODE
Expand Down Expand Up @@ -498,7 +433,7 @@ class SwizzleData:
if (!check_vector_values<${type}, ${size}>(inOrderSwizzleFunctionVec, in_order_vals)) {
resAcc[0] = false;
}
if (!check_vector_get_count_get_size<${type}>(inOrderSwizzleFunctionVec)) {
if (!check_vector_get_count_get_size<${type}, ${size}>(inOrderSwizzleFunctionVec)) {
resAcc[0] = false;
}
#ifdef SYCL_CTS_EXTENSIVE_MODE
Expand All @@ -518,7 +453,7 @@ class SwizzleData:
if (!check_vector_values<${type}, ${size}>(reverseOrderSwizzleFunctionVec, reversed_vals)) {
resAcc[0] = false;
}
if (!check_vector_get_count_get_size<${type}>(reverseOrderSwizzleFunctionVec)) {
if (!check_vector_get_count_get_size<${type}, ${size}>(reverseOrderSwizzleFunctionVec)) {
resAcc[0] = false;
}
#ifdef SYCL_CTS_EXTENSIVE_MODE
Expand All @@ -538,7 +473,7 @@ class SwizzleData:
if (!check_vector_values<${type}, ${size}>(inOrderReversedPairSwizzleFunctionVec, in_order_reversed_pair_vals)) {
resAcc[0] = false;
}
if (!check_vector_get_count_get_size<${type}>(inOrderReversedPairSwizzleFunctionVec)) {
if (!check_vector_get_count_get_size<${type}, ${size}>(inOrderReversedPairSwizzleFunctionVec)) {
resAcc[0] = false;
}
#ifdef SYCL_CTS_EXTENSIVE_MODE
Expand All @@ -558,7 +493,7 @@ class SwizzleData:
if (!check_vector_values<${type}, ${size}>(reverseOrderReversedPairSwizzleFunctionVec, reverse_order_reversed_pair_vals)) {
resAcc[0] = false;
}
if (!check_vector_get_count_get_size<${type}>(reverseOrderReversedPairSwizzleFunctionVec)) {
if (!check_vector_get_count_get_size<${type}, ${size}>(reverseOrderReversedPairSwizzleFunctionVec)) {
resAcc[0] = false;
}
#ifdef SYCL_CTS_EXTENSIVE_MODE
Expand Down Expand Up @@ -674,15 +609,9 @@ def write_swizzle_source_file(swizzles, input_file, output_file, type_str):
with open(input_file, 'r') as source_file:
source = source_file.read()

is_opencl_type = type_str in ReverseData.rev_opencl_type_dict

source = replace_string_in_source_string(source,
remove_namespaces_whitespaces(type_str),
'$TYPE_NAME')
if is_opencl_type:
source = source.replace('$OPENCL', 'opencl_')
else:
source = source.replace('$OPENCL', '')

source = replace_string_in_source_string(source, swizzles[0],
'$1D_SWIZZLES')
Expand All @@ -709,12 +638,8 @@ def get_reverse_type(type_str):
type_dict = Data.standard_type_dict
rev_type_dict = ReverseData.rev_standard_type_dict
else:
if type_str in ReverseData.rev_opencl_type_dict:
type_dict = Data.opencl_type_dict
rev_type_dict = ReverseData.rev_opencl_type_dict
else:
type_dict = Data.fixed_width_type_dict
rev_type_dict = ReverseData.rev_fixed_width_type_dict
type_dict = Data.fixed_width_type_dict
rev_type_dict = ReverseData.rev_fixed_width_type_dict
(sign, base_type) = rev_type_dict[type_str]
if (not sign, base_type) in type_dict:
reverse_type_str = type_dict[(not sign, base_type)]
Expand Down
Loading