mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-26 08:49:02 +00:00
Reduce diff with master branch (#399)
A first round of whitespace, formatting and uncontroversial changes. Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
set( CONFORMANCE_SUFFIX "" )
|
||||
|
||||
set(CLConform_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
project(CLConform${CONFORMANCE_SUFFIX})
|
||||
@@ -26,6 +25,7 @@ add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_1_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_1_APIS=1)
|
||||
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_0_APIS=1)
|
||||
|
||||
|
||||
# Support both VS2008 and VS2012.
|
||||
@@ -103,14 +103,11 @@ if(APPLE)
|
||||
list(APPEND CLConform_LIBRARIES ${iokit})
|
||||
endif(APPLE)
|
||||
|
||||
list(APPEND CLConform_INCLUDE_DIR ${OPENCL_INCLUDE_DIR})
|
||||
|
||||
include_directories(SYSTEM ${OPENCL_INCLUDE_DIR})
|
||||
include_directories(${CLConform_SOURCE_DIR}/test_common/harness
|
||||
${CLConform_SOURCE_DIR}/test_common/gles
|
||||
${CLConform_SOURCE_DIR}/test_common/gl
|
||||
${CLConform_INCLUDE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_common/harness
|
||||
)
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/test_common/harness)
|
||||
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "release")
|
||||
set (BUILD_FLAVOR "release")
|
||||
@@ -130,7 +127,7 @@ set (DST_DIR "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/")
|
||||
if (WIN32)
|
||||
set (COPY "echo")
|
||||
add_custom_target(COPY_DLL${CONFORMANCE_SUFFIX} ALL
|
||||
COMMAND ${COPY} \"${DLL_FILES}\" \"${DST_DIR}\"
|
||||
COMMAND ${COPY} "${DLL_FILES}" "${DST_DIR}"
|
||||
COMMENT "Copying dll files.. ")
|
||||
else (WIN32)
|
||||
set (COPY cp)
|
||||
|
||||
@@ -25,11 +25,8 @@ IF NOT EXIST CLConform.sln (
|
||||
echo "Solution file found CLConform.sln "
|
||||
)
|
||||
|
||||
|
||||
|
||||
echo Building CLConform.sln...
|
||||
%VCPATH% CLConform.sln /build
|
||||
|
||||
|
||||
GOTO:EOF
|
||||
|
||||
|
||||
@@ -312,17 +312,17 @@ static int invoke_offline_compiler(cl_context context,
|
||||
const std::string &sourceFilename,
|
||||
const std::string &outputFilename)
|
||||
{
|
||||
std::string scriptToRunString =
|
||||
std::string runString =
|
||||
get_offline_compilation_command(device_address_space_size, compilationMode, bOptions,
|
||||
sourceFilename, outputFilename);
|
||||
|
||||
// execute script
|
||||
log_info("Executing command: %s\n", scriptToRunString.c_str());
|
||||
log_info("Executing command: %s\n", runString.c_str());
|
||||
fflush(stdout);
|
||||
int returnCode = system(scriptToRunString.c_str());
|
||||
int returnCode = system(runString.c_str());
|
||||
if (returnCode != 0)
|
||||
{
|
||||
log_error("Command finished with error: 0x%x\n", returnCode);
|
||||
log_error("ERROR: Command finished with error: 0x%x\n", returnCode);
|
||||
return CL_COMPILE_PROGRAM_FAILURE;
|
||||
}
|
||||
|
||||
@@ -586,12 +586,14 @@ int create_single_kernel_helper(cl_context context, cl_program *outProgram, cl_k
|
||||
// Verify the build status on all devices
|
||||
cl_uint deviceCount = 0;
|
||||
error = clGetProgramInfo(*outProgram, CL_PROGRAM_NUM_DEVICES, sizeof(deviceCount), &deviceCount, NULL);
|
||||
if (error != CL_SUCCESS) {
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
print_error(error, "clGetProgramInfo CL_PROGRAM_NUM_DEVICES failed");
|
||||
return error;
|
||||
}
|
||||
|
||||
if (deviceCount == 0) {
|
||||
if (deviceCount == 0)
|
||||
{
|
||||
log_error("No devices found for program.\n");
|
||||
return -1;
|
||||
}
|
||||
@@ -603,7 +605,8 @@ int create_single_kernel_helper(cl_context context, cl_program *outProgram, cl_k
|
||||
|
||||
memset(devices, 0, deviceCount * sizeof(cl_device_id));
|
||||
error = clGetProgramInfo(*outProgram, CL_PROGRAM_DEVICES, sizeof(cl_device_id) * deviceCount, devices, NULL);
|
||||
if (error != CL_SUCCESS) {
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
print_error(error, "clGetProgramInfo CL_PROGRAM_DEVICES failed");
|
||||
return error;
|
||||
}
|
||||
@@ -614,14 +617,16 @@ int create_single_kernel_helper(cl_context context, cl_program *outProgram, cl_k
|
||||
{
|
||||
char deviceName[4096] = "";
|
||||
error = clGetDeviceInfo(devices[z], CL_DEVICE_NAME, sizeof(deviceName), deviceName, NULL);
|
||||
if (error != CL_SUCCESS || deviceName[0] == '\0') {
|
||||
if (error != CL_SUCCESS || deviceName[0] == '\0')
|
||||
{
|
||||
log_error("Device \"%d\" failed to return a name\n", z);
|
||||
print_error(error, "clGetDeviceInfo CL_DEVICE_NAME failed");
|
||||
}
|
||||
|
||||
cl_build_status buildStatus;
|
||||
error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_STATUS, sizeof(buildStatus), &buildStatus, NULL);
|
||||
if (error != CL_SUCCESS) {
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_STATUS failed");
|
||||
return error;
|
||||
}
|
||||
@@ -632,7 +637,8 @@ int create_single_kernel_helper(cl_context context, cl_program *outProgram, cl_k
|
||||
log_error("clBuildProgram returned an error, but buildStatus is marked as CL_BUILD_SUCCESS.\n");
|
||||
}
|
||||
|
||||
if (buildStatus != CL_BUILD_SUCCESS) {
|
||||
if (buildStatus != CL_BUILD_SUCCESS)
|
||||
{
|
||||
|
||||
char statusString[64] = "";
|
||||
if (buildStatus == (cl_build_status)CL_BUILD_SUCCESS)
|
||||
@@ -646,10 +652,12 @@ int create_single_kernel_helper(cl_context context, cl_program *outProgram, cl_k
|
||||
else
|
||||
sprintf(statusString, "UNKNOWN (%d)", buildStatus);
|
||||
|
||||
if (buildStatus != CL_BUILD_SUCCESS) log_error("Build not successful for device \"%s\", status: %s\n", deviceName, statusString);
|
||||
if (buildStatus != CL_BUILD_SUCCESS)
|
||||
log_error("Build not successful for device \"%s\", status: %s\n", deviceName, statusString);
|
||||
size_t paramSize = 0;
|
||||
error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_LOG, 0, NULL, ¶mSize);
|
||||
if (error != CL_SUCCESS) {
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
|
||||
print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_LOG failed");
|
||||
return error;
|
||||
@@ -658,12 +666,16 @@ int create_single_kernel_helper(cl_context context, cl_program *outProgram, cl_k
|
||||
std::string log;
|
||||
log.resize(paramSize / sizeof(char));
|
||||
error = clGetProgramBuildInfo(*outProgram, devices[z], CL_PROGRAM_BUILD_LOG, paramSize, &log[0], NULL);
|
||||
if (error != CL_SUCCESS || log[0] == '\0'){
|
||||
if (error != CL_SUCCESS || log[0] == '\0')
|
||||
{
|
||||
log_error("Device %d (%s) failed to return a build log\n", z, deviceName);
|
||||
if (error) {
|
||||
if (error)
|
||||
{
|
||||
print_error(error, "clGetProgramBuildInfo CL_PROGRAM_BUILD_LOG failed");
|
||||
return error;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
log_error("clGetProgramBuildInfo returned an empty log.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -61,10 +61,25 @@ extern "C" {
|
||||
const int MAX_LEN_FOR_KERNEL_LIST = 20;
|
||||
|
||||
/* Helper that creates a single program and kernel from a single-kernel program source */
|
||||
extern int create_single_kernel_helper( cl_context context, cl_program *outProgram, cl_kernel *outKernel, unsigned int numKernelLines, const char **kernelProgram, const char *kernelName, const char *buildOptions=NULL );
|
||||
extern int create_single_kernel_helper_with_build_options( cl_context context, cl_program *outProgram, cl_kernel *outKernel, unsigned int numKernelLines,
|
||||
const char **kernelProgram, const char *kernelName, const char *buildOptions );
|
||||
extern int create_single_kernel_helper_create_program(cl_context context, cl_program *outProgram, unsigned int numKernelLines, const char **kernelProgram, const char *buildOptions = NULL);
|
||||
extern int create_single_kernel_helper(cl_context context,
|
||||
cl_program *outProgram,
|
||||
cl_kernel *outKernel,
|
||||
unsigned int numKernelLines,
|
||||
const char **kernelProgram,
|
||||
const char *kernelName,
|
||||
const char *buildOptions = NULL);
|
||||
extern int create_single_kernel_helper_with_build_options(cl_context context,
|
||||
cl_program *outProgram,
|
||||
cl_kernel *outKernel,
|
||||
unsigned int numKernelLines,
|
||||
const char **kernelProgram,
|
||||
const char *kernelName,
|
||||
const char *buildOptions);
|
||||
extern int create_single_kernel_helper_create_program(cl_context context,
|
||||
cl_program *outProgram,
|
||||
unsigned int numKernelLines,
|
||||
const char **kernelProgram,
|
||||
const char *buildOptions = NULL);
|
||||
|
||||
/* Helper to obtain the biggest fit work group size for all the devices in a given group and for the given global thread size */
|
||||
extern int get_max_common_work_group_size( cl_context context, cl_kernel kernel, size_t globalThreadSize, size_t *outSize );
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
set_source_files_properties(
|
||||
COMPILE_FLAGS -msse2)
|
||||
set_source_files_properties(COMPILE_FLAGS -msse2)
|
||||
|
||||
string(TOLOWER ${MODULE_NAME} MODULE_NAME_LOWER)
|
||||
|
||||
|
||||
@@ -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}" )
|
||||
|
||||
add_subdirectory( allocations )
|
||||
|
||||
@@ -67,6 +67,10 @@ Headers (cl.h standalone), headers/test_cl_h
|
||||
Headers (cl_platform.h standalone), headers/test_cl_platform_h
|
||||
Headers (cl_gl.h standalone), headers/test_cl_gl_h
|
||||
Headers (opencl.h standalone), headers/test_opencl_h
|
||||
Headers (cl.h standalone C99), headers/test_cl_h_c99
|
||||
Headers (cl_platform.h standalone C99), headers/test_cl_platform_h_c99
|
||||
Headers (cl_gl.h standalone C99), headers/test_cl_gl_h_c99
|
||||
Headers (opencl.h standalone C99), headers/test_opencl_h_c99
|
||||
|
||||
# #########################################
|
||||
# CPU is required to pass linear and normalized image filtering
|
||||
|
||||
|
Reference in New Issue
Block a user