Reduce diff with master

Whitespace, typos and simple build system/script changes.

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
Kevin Petit
2019-07-31 11:32:39 +01:00
committed by Kévin Petit
parent be2ca84c42
commit e535e0aa21
4 changed files with 42 additions and 49 deletions

View File

@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
set( CONFORMANCE_SUFFIX "" ) set( CONFORMANCE_SUFFIX "" )
set(CLConform_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(CLConform_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
project(CLConform${CONFORMANCE_SUFFIX}) project(CLConform${CONFORMANCE_SUFFIX})
@@ -25,6 +24,7 @@ add_definitions(-DCL_TARGET_OPENCL_VERSION=200)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_0_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_0_APIS=1)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS=1)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS=1) add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_1_APIS=1)
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_0_APIS=1)
# Support both VS2008 and VS2012. # Support both VS2008 and VS2012.
@@ -67,22 +67,17 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang"
# to falsely fail. -ffloat-store also works, but WG suggested # to falsely fail. -ffloat-store also works, but WG suggested
# that sse would be better. # that sse would be better.
if(CMAKE_ARM_COMPILER OR ANDROID) if(CMAKE_ARM_COMPILER OR ANDROID)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=gnu99") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=gnu99 -Wno-narrowing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=gnu++11 -Wno-narrowing")
else(CMAKE_ARM_COMPILER OR ANDROID) else(CMAKE_ARM_COMPILER OR ANDROID)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=gnu99 -msse -mfpmath=sse") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -std=gnu99 -msse -mfpmath=sse -Wno-narrowing")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -msse -mfpmath=sse") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -msse -mfpmath=sse -std=gnu++11 -Wno-narrowing")
endif(CMAKE_ARM_COMPILER OR ANDROID) endif(CMAKE_ARM_COMPILER OR ANDROID)
else() else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D__SSE__") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D__SSE__")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D__SSE__") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D__SSE__")
endif() endif()
# Clang gives C++11 narrowing warnings so suppress these for now
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-narrowing")
endif()
if( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" ) if( WIN32 AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "Intel" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qlong-double -Qpc80 /DWIN32 /D_WINDOWS /W3 /GR /EHsc -nologo -Od -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS -EHsc -Wall -Qdiag-disable:68,111,177,186,161,869,1028,2259,2553,181,239,265,1188 -fp:strict -fp:source")
@@ -91,6 +86,8 @@ endif()
list(APPEND CLConform_LIBRARIES ${OPENCL_LIBRARIES}) list(APPEND CLConform_LIBRARIES ${OPENCL_LIBRARIES})
if(ANDROID) if(ANDROID)
list(APPEND CLConform_LIBRARIES m) list(APPEND CLConform_LIBRARIES m)
elseif(NOT WIN32)
list(APPEND CLConform_LIBRARIES pthread)
endif(ANDROID) endif(ANDROID)
if(APPLE) if(APPLE)
@@ -100,14 +97,11 @@ if(APPLE)
list(APPEND CLConform_LIBRARIES ${iokit}) list(APPEND CLConform_LIBRARIES ${iokit})
endif(APPLE) endif(APPLE)
list(APPEND CLConform_INCLUDE_DIR ${OPENCL_INCLUDE_DIR}) include_directories(SYSTEM ${OPENCL_INCLUDE_DIR})
include_directories(${CLConform_SOURCE_DIR}/test_common/harness
include_directories (${CLConform_SOURCE_DIR}/test_common/harness ${CLConform_SOURCE_DIR}/test_common/gles
${CLConform_SOURCE_DIR}/test_common/gles ${CLConform_SOURCE_DIR}/test_common/gl
${CLConform_SOURCE_DIR}/test_common/gl ${CMAKE_CURRENT_SOURCE_DIR}/test_common/harness)
${CLConform_INCLUDE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/test_common/harness
)
if(CMAKE_BUILD_TYPE STREQUAL "release") if(CMAKE_BUILD_TYPE STREQUAL "release")
set (BUILD_FLAVOR "release") set (BUILD_FLAVOR "release")
@@ -125,13 +119,13 @@ set (DLL_FILES "${VS_BUILD_DIR}/Debug/*.dll")
set (DST_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/") set (DST_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/")
if (WIN32) if (WIN32)
set (COPY "echo") set (COPY "echo")
add_custom_target( COPY_DLL${CONFORMANCE_SUFFIX} ALL add_custom_target(COPY_DLL${CONFORMANCE_SUFFIX} ALL
COMMAND ${COPY} \"${DLL_FILES}\" \"${DST_DIR}\" COMMAND ${COPY} "${DLL_FILES}" "${DST_DIR}"
COMMENT "Copying dll files.. ") COMMENT "Copying dll files.. ")
else (WIN32) else (WIN32)
set (COPY cp) set (COPY cp)
add_custom_target( COPY_DLL${CONFORMANCE_SUFFIX} ) add_custom_target(COPY_DLL${CONFORMANCE_SUFFIX})
endif(WIN32) endif(WIN32)
set_property(TARGET COPY_DLL${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") set_property(TARGET COPY_DLL${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}")
@@ -160,4 +154,4 @@ if(MSVC)
endif(MSVC) endif(MSVC)
set_property(TARGET COPY_FILES${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}") set_property(TARGET COPY_FILES${CONFORMANCE_SUFFIX} PROPERTY FOLDER "CONFORMANCE${CONFORMANCE_SUFFIX}")
add_subdirectory( "test_extensions" ) add_subdirectory( "test_extensions" )

View File

@@ -1,5 +1,4 @@
set_source_files_properties( set_source_files_properties(COMPILE_FLAGS -msse2)
COMPILE_FLAGS -msse2)
string(TOLOWER ${MODULE_NAME} MODULE_NAME_LOWER) string(TOLOWER ${MODULE_NAME} MODULE_NAME_LOWER)

View File

@@ -1,4 +1,4 @@
# Remember curren source directory (`test_conformance'). # Remember current source directory (`test_conformance').
set( CLConf_Install_Base_Dir "${CMAKE_CURRENT_SOURCE_DIR}" ) set( CLConf_Install_Base_Dir "${CMAKE_CURRENT_SOURCE_DIR}" )
add_subdirectory( allocations ) add_subdirectory( allocations )
@@ -48,7 +48,7 @@ add_subdirectory( SVM )
add_subdirectory( generic_address_space ) add_subdirectory( generic_address_space )
add_subdirectory( subgroups ) add_subdirectory( subgroups )
add_subdirectory( workgroups ) add_subdirectory( workgroups )
add_subdirectory( pipes ) add_subdirectory( pipes )
add_subdirectory( spir ) add_subdirectory( spir )
install_files( install_files(

View File

@@ -3,7 +3,7 @@
#/****************************************************************** #/******************************************************************
#// #//
#// OpenCL Conformance Tests #// OpenCL Conformance Tests
#// #//
#// Copyright: (c) 2008-2009 by Apple Inc. All Rights Reserved. #// Copyright: (c) 2008-2009 by Apple Inc. All Rights Reserved.
#// #//
#******************************************************************/ #******************************************************************/
@@ -24,15 +24,15 @@ def write_help_info() :
print("run_conformance.py test_list [CL_DEVICE_TYPE(s) to test] [partial-test-names, ...] [log=path/to/log/file/]") print("run_conformance.py test_list [CL_DEVICE_TYPE(s) to test] [partial-test-names, ...] [log=path/to/log/file/]")
print(" test_list - the .csv file containing the test names and commands to run the tests.") print(" test_list - the .csv file containing the test names and commands to run the tests.")
print(" [partial-test-names, ...] - optional partial strings to select a subset of the tests to run.") print(" [partial-test-names, ...] - optional partial strings to select a subset of the tests to run.")
print(" [CL_DEVICE_TYPE(s) to test] - list of CL device types to test, default is CL_DEVICE_TYPE_DEFAULT.") print(" [CL_DEVICE_TYPE(s) to test] - list of CL device types to test, default is CL_DEVICE_TYPE_DEFAULT.")
print(" [log=path/to/log/file/] - provide a path for the test log file, default is in the current directory.") print(" [log=path/to/log/file/] - provide a path for the test log file, default is in the current directory.")
print(" (Note: spaces are not allowed in the log file path.") print(" (Note: spaces are not allowed in the log file path.")
# Get the time formatted nicely # Get the time formatted nicely
def get_time() : def get_time() :
return time.strftime("%d-%b %H:%M:%S", time.localtime()) return time.strftime("%d-%b %H:%M:%S", time.localtime())
# Write text to the screen and the log file # Write text to the screen and the log file
def write_screen_log(text) : def write_screen_log(text) :
global log_file global log_file
@@ -52,7 +52,7 @@ def get_tests(filename, devices_to_test):
comment = re.search("^#.*", line) comment = re.search("^#.*", line)
if (comment): if (comment):
continue continue
device_specific_match = re.search("^\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*", line) device_specific_match = re.search("^\s*(.+?)\s*,\s*(.+?)\s*,\s*(.+?)\s*$", line)
if (device_specific_match): if (device_specific_match):
if (device_specific_match.group(1) in devices_to_test): if (device_specific_match.group(1) in devices_to_test):
test_path = string.replace(device_specific_match.group(3), '/', os.sep) test_path = string.replace(device_specific_match.group(3), '/', os.sep)
@@ -61,8 +61,8 @@ def get_tests(filename, devices_to_test):
else: else:
print("Skipping " + device_specific_match.group(2) + " because " + device_specific_match.group(1) + " is not in the list of devices to test.") print("Skipping " + device_specific_match.group(2) + " because " + device_specific_match.group(1) + " is not in the list of devices to test.")
continue continue
match = re.search("^\s*(.+)\s*,\s*(.+)\s*", line) match = re.search("^\s*(.+?)\s*,\s*(.+?)\s*$", line)
if (match): if (match):
test_path = string.replace(match.group(2), '/', os.sep) test_path = string.replace(match.group(2), '/', os.sep)
test_name = string.replace(match.group(1), '/', os.sep) test_name = string.replace(match.group(1), '/', os.sep)
tests.append((test_name, test_path)) tests.append((test_name, test_path))
@@ -107,7 +107,7 @@ def run_test_checking_output(current_directory, test_dir, log_file):
pointer = 0 pointer = 0
pointer_at_last_user_update = 0 pointer_at_last_user_update = 0
output_this_run = False output_this_run = False
try: try:
read_output = open(output_name, 'r') read_output = open(output_name, 'r')
except IOError: except IOError:
write_screen_log("\n ==> ERROR: could not open output file from test.") write_screen_log("\n ==> ERROR: could not open output file from test.")
@@ -131,7 +131,7 @@ def run_test_checking_output(current_directory, test_dir, log_file):
p.poll() p.poll()
if (not done and p.returncode != None): if (not done and p.returncode != None):
if (p.returncode < 0): if (p.returncode < 0):
if (not output_this_run): if (not output_this_run):
print "" print ""
output_this_run = True output_this_run = True
write_screen_log(" ==> ERROR: test killed/crashed: " + str(p.returncode)+ ".") write_screen_log(" ==> ERROR: test killed/crashed: " + str(p.returncode)+ ".")
@@ -148,8 +148,8 @@ def run_test_checking_output(current_directory, test_dir, log_file):
# Look for failures and report them as such # Look for failures and report them as such
match = re.search(".*(FAILED|ERROR).*", line) match = re.search(".*(FAILED|ERROR).*", line)
if (match): if (match):
if (not output_this_run): if (not output_this_run):
print "" print ""
output_this_run = True output_this_run = True
print(" ==> " + line.replace('\n','')) print(" ==> " + line.replace('\n',''))
match = re.search(".*FAILED.*", line) match = re.search(".*FAILED.*", line)
@@ -157,8 +157,8 @@ def run_test_checking_output(current_directory, test_dir, log_file):
failures_this_run = failures_this_run + 1 failures_this_run = failures_this_run + 1
match = re.search(".*(PASSED).*", line) match = re.search(".*(PASSED).*", line)
if (match): if (match):
if (not output_this_run): if (not output_this_run):
print "" print ""
output_this_run = True output_this_run = True
print(" " + line.replace('\n','')) print(" " + line.replace('\n',''))
# Write it to the log # Write it to the log
@@ -171,7 +171,7 @@ def run_test_checking_output(current_directory, test_dir, log_file):
more_to_read = False more_to_read = False
read_output.close() read_output.close()
time.sleep(1) time.sleep(1)
try: try:
os.fsync(output_fd) os.fsync(output_fd)
read_output = open(output_name, 'r') read_output = open(output_name, 'r')
# See if there is more to read. This happens if the process ends and we have data left. # See if there is more to read. This happens if the process ends and we have data left.
@@ -221,7 +221,7 @@ def run_tests(tests) :
log_file.write(" ----------------------------------------------------------------------------------------\n") log_file.write(" ----------------------------------------------------------------------------------------\n")
log_file.flush() log_file.flush()
sys.stdout.flush() sys.stdout.flush()
# Run the test # Run the test
result = 0 result = 0
start_time = time.time() start_time = time.time()
@@ -236,12 +236,12 @@ def run_tests(tests) :
if (answer.find("y") != -1): if (answer.find("y") != -1):
write_screen_log("\nUser chose to abort all tests.") write_screen_log("\nUser chose to abort all tests.")
log_file.close() log_file.close()
sys.exit(-1) sys.exit(-1)
else: else:
write_screen_log("\nUser chose to continue with other tests. Reporting this test as failed.") write_screen_log("\nUser chose to continue with other tests. Reporting this test as failed.")
result = 1 result = 1
run_time = (time.time() - start_time) run_time = (time.time() - start_time)
# Move print the finish status # Move print the finish status
if (result == 0): if (result == 0):
print("("+get_time()+") PASSED " + test_name.ljust(40) +": (" + str(int(run_time)).rjust(3) + "s, test " + str(test_number).rjust(3) + os.sep + str(len(tests)) +")"), print("("+get_time()+") PASSED " + test_name.ljust(40) +": (" + str(int(run_time)).rjust(3) + "s, test " + str(test_number).rjust(3) + os.sep + str(len(tests)) +")"),
@@ -251,7 +251,7 @@ def run_tests(tests) :
test_number = test_number + 1 test_number = test_number + 1
log_file.write(" ----------------------------------------------------------------------------------------\n") log_file.write(" ----------------------------------------------------------------------------------------\n")
log_file.flush() log_file.flush()
print("") print("")
if (result != 0): if (result != 0):
log_file.write(" *******************************************************************************************\n") log_file.write(" *******************************************************************************************\n")
@@ -260,7 +260,7 @@ def run_tests(tests) :
failures = failures + 1 failures = failures + 1
else: else:
log_file.write(" ("+get_time()+") Test " + test_name +" passed in " + str(run_time) + "s\n") log_file.write(" ("+get_time()+") Test " + test_name +" passed in " + str(run_time) + "s\n")
log_file.write(" ----------------------------------------------------------------------------------------\n") log_file.write(" ----------------------------------------------------------------------------------------\n")
log_file.write("\n") log_file.write("\n")
return failures return failures