From 44a240367e48688e419314b94b74b46086385f9d Mon Sep 17 00:00:00 2001 From: Grzegorz Wawiorko Date: Mon, 6 Jul 2020 13:05:22 +0200 Subject: [PATCH] Fix code format errors --- test_common/harness/kernelHelpers.cpp | 28 ++-- test_common/harness/testHarness.cpp | 146 ++++++++++++------ test_common/harness/testHarness.h | 6 +- test_conformance/SVM/main.cpp | 4 +- test_conformance/c11_atomics/main.cpp | 4 +- .../conversions/test_conversions.cpp | 6 +- test_conformance/device_execution/main.cpp | 4 +- test_conformance/device_timer/main.cpp | 4 +- .../generic_address_space/main.cpp | 4 +- .../non_uniform_work_group/main.cpp | 4 +- test_conformance/pipes/main.cpp | 4 +- test_conformance/printf/test_printf.cpp | 4 +- test_conformance/spirv_new/main.cpp | 46 ++++-- test_conformance/spirv_new/test_linkage.cpp | 31 ++-- test_conformance/spirv_new/test_op_opaque.cpp | 31 ++-- test_conformance/workgroups/main.cpp | 4 +- 16 files changed, 218 insertions(+), 112 deletions(-) diff --git a/test_common/harness/kernelHelpers.cpp b/test_common/harness/kernelHelpers.cpp index 41e3af55..91ed3950 100644 --- a/test_common/harness/kernelHelpers.cpp +++ b/test_common/harness/kernelHelpers.cpp @@ -665,30 +665,40 @@ static int create_single_kernel_helper_create_program_offline(cl_context context size_t length = modifiedKernelBuf.size(); log_info("offlineCompiler: clCreateProgramWithSource replaced with clCreateProgramWithIL\n"); - if (gCoreILProgram) { - *outProgram = clCreateProgramWithIL(context, &modifiedKernelBuf[0], length, &error); + if (gCoreILProgram) + { + *outProgram = clCreateProgramWithIL(context, &modifiedKernelBuf[0], + length, &error); } - else { + else + { cl_platform_id platform; - error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, NULL); + error = clGetDeviceInfo(device, CL_DEVICE_PLATFORM, + sizeof(cl_platform_id), &platform, NULL); print_error(error, "clGetDeviceInfo for CL_DEVICE_PLATFORM failed"); clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL; - clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn)clGetExtensionFunctionAddressForPlatform(platform, "clCreateProgramWithILKHR"); + clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); if (clCreateProgramWithILKHR == NULL) { - log_error("ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); + log_error( + "ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); return -1; } - *outProgram = clCreateProgramWithILKHR(context, &modifiedKernelBuf[0], length, &error); + *outProgram = clCreateProgramWithILKHR( + context, &modifiedKernelBuf[0], length, &error); } if (*outProgram == NULL || error != CL_SUCCESS) { - if (gCoreILProgram) { + if (gCoreILProgram) + { print_error(error, "clCreateProgramWithIL failed"); } - else { + else + { print_error(error, "clCreateProgramWithILKHR failed"); } return error; diff --git a/test_common/harness/testHarness.cpp b/test_common/harness/testHarness.cpp index bda6f350..fcabda51 100644 --- a/test_common/harness/testHarness.cpp +++ b/test_common/harness/testHarness.cpp @@ -57,7 +57,7 @@ int gIsEmbedded = 0; int gIsOpenCL_C_1_0_Device = 0; int gIsOpenCL_1_0_Device = 0; int gHasLong = 1; -bool gCoreILProgram = true; +bool gCoreILProgram = true; #define DEFAULT_NUM_ELEMENTS 0x4000 @@ -79,9 +79,13 @@ int fail_init_info(int count) { log_info("FAILED %d of %d tests.\n", count, count); return EXIT_FAILURE; } -void version_expected_info(const char * test_name, const char * api_name, const char * expected_version, const char * device_version) { - log_info("%s skipped (requires at least %s version %s, but the device reports %s version %s)\n", - test_name, api_name, expected_version, api_name, device_version); +void version_expected_info(const char *test_name, const char *api_name, + const char *expected_version, + const char *device_version) +{ + log_info("%s skipped (requires at least %s version %s, but the device " + "reports %s version %s)\n", + test_name, api_name, expected_version, api_name, device_version); } int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_definition testList[], int forceNoContextCreation, cl_command_queue_properties queueProps, @@ -433,17 +437,16 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def log_error("Invalid device address bit size returned by device.\n"); return EXIT_FAILURE; } - if (gCompilationMode == kSpir_v) { + if (gCompilationMode == kSpir_v) + { test_status spirv_readiness = check_spirv_compilation_readiness(device); - if (spirv_readiness != TEST_PASS) { + if (spirv_readiness != TEST_PASS) + { switch (spirv_readiness) { - case TEST_PASS: - break; - case TEST_FAIL: - return fail_init_info(testNum); - case TEST_SKIP: - return skip_init_info(testNum); + case TEST_PASS: break; + case TEST_FAIL: return fail_init_info(testNum); + case TEST_SKIP: return skip_init_info(testNum); } } } @@ -699,7 +702,9 @@ test_status callSingleTestFunction( test_definition test, cl_device_id deviceToU const Version device_version = get_device_cl_version(deviceToUse); if (test.min_version > device_version) { - version_expected_info(test.name, "OpenCL", test.min_version.to_string().c_str(), device_version.to_string().c_str()); + version_expected_info(test.name, "OpenCL", + test.min_version.to_string().c_str(), + device_version.to_string().c_str()); return TEST_SKIP; } @@ -905,48 +910,66 @@ Version get_device_cl_version(cl_device_id device) throw std::runtime_error(std::string("Unknown OpenCL version: ") + str.data()); } -bool check_device_spirv_version_reported(cl_device_id device) { +bool check_device_spirv_version_reported(cl_device_id device) +{ size_t str_size; cl_int err; std::vector str; - if (gCoreILProgram) { + if (gCoreILProgram) + { err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, 0, NULL, &str_size); - if (err != CL_SUCCESS) { - log_error("clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION size;"); + if (err != CL_SUCCESS) + { + log_error( + "clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION size;"); return false; } str.resize(str_size); - err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, str_size, str.data(), NULL); - if (err != CL_SUCCESS) { - log_error("clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION value;"); + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, str_size, + str.data(), NULL); + if (err != CL_SUCCESS) + { + log_error( + "clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION value;"); return false; } } - else { - cl_int err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, 0, NULL, &str_size); - if (err != CL_SUCCESS) { - log_error("clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION_KHR size;"); + else + { + cl_int err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, 0, NULL, + &str_size); + if (err != CL_SUCCESS) + { + log_error( + "clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION_KHR size;"); return false; } str.resize(str_size); - err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, str_size, str.data(), NULL); - if (err != CL_SUCCESS) { - log_error("clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION_KHR value;"); + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, str_size, + str.data(), NULL); + if (err != CL_SUCCESS) + { + log_error( + "clGetDeviceInfo: cannot read CL_DEVICE_IL_VERSION_KHR value;"); return false; } } - if (strstr(str.data(), "SPIR-V") == NULL) { + if (strstr(str.data(), "SPIR-V") == NULL) + { log_info("This device does not support SPIR-V offline compilation.\n"); return false; - } else { + } + else + { Version spirv_version = get_device_spirv_il_version(device); - log_info("This device supports SPIR-V offline compilation. SPIR-V version is %s\n", spirv_version.to_string().c_str()); + log_info("This device supports SPIR-V offline compilation. SPIR-V " + "version is %s\n", + spirv_version.to_string().c_str()); } return true; - } Version get_device_spirv_il_version(cl_device_id device) @@ -954,20 +977,25 @@ Version get_device_spirv_il_version(cl_device_id device) size_t str_size; cl_int err; std::vector str; - if (gCoreILProgram) { + if (gCoreILProgram) + { err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, 0, NULL, &str_size); ASSERT_SUCCESS(err, "clGetDeviceInfo"); str.resize(str_size); - err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, str_size, str.data(), NULL); + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION, str_size, + str.data(), NULL); ASSERT_SUCCESS(err, "clGetDeviceInfo"); } - else { - err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, 0, NULL, &str_size); + else + { + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, 0, NULL, + &str_size); ASSERT_SUCCESS(err, "clGetDeviceInfo"); str.resize(str_size); - err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, str_size, str.data(), NULL); + err = clGetDeviceInfo(device, CL_DEVICE_IL_VERSION_KHR, str_size, + str.data(), NULL); ASSERT_SUCCESS(err, "clGetDeviceInfo"); } @@ -984,7 +1012,8 @@ Version get_device_spirv_il_version(cl_device_id device) else if (strstr(str.data(), "SPIR-V_1.5") != NULL) return Version(1, 5); - throw std::runtime_error(std::string("Unknown SPIR-V version: ") + str.data()); + throw std::runtime_error(std::string("Unknown SPIR-V version: ") + + str.data()); } test_status check_spirv_compilation_readiness(cl_device_id device) @@ -992,35 +1021,52 @@ test_status check_spirv_compilation_readiness(cl_device_id device) auto ocl_version = get_device_cl_version(device); auto ocl_expected_min_version = Version(2, 1); - if (ocl_version < ocl_expected_min_version) { - if (is_extension_available(device, "cl_khr_il_program")) { + if (ocl_version < ocl_expected_min_version) + { + if (is_extension_available(device, "cl_khr_il_program")) + { gCoreILProgram = false; bool spirv_supported = check_device_spirv_version_reported(device); - if (spirv_supported == false) { - log_error("SPIR-V intermediate language not supported !!! OpenCL %s requires support.\n", ocl_version.to_string().c_str()); + if (spirv_supported == false) + { + log_error("SPIR-V intermediate language not supported !!! " + "OpenCL %s requires support.\n", + ocl_version.to_string().c_str()); return TEST_FAIL; } - else { + else + { return TEST_PASS; } } - else { - version_expected_info("Test", "OpenCL", ocl_expected_min_version.to_string().c_str(), ocl_version.to_string().c_str()); + else + { + version_expected_info("Test", "OpenCL", + ocl_expected_min_version.to_string().c_str(), + ocl_version.to_string().c_str()); return TEST_SKIP; } } bool spirv_supported = check_device_spirv_version_reported(device); - if (ocl_version >= ocl_expected_min_version && ocl_version <= Version(2, 2)) { - if (spirv_supported == false) { - log_error("SPIR-V intermediate language not supported !!! OpenCL %s requires support.\n", ocl_version.to_string().c_str()); + if (ocl_version >= ocl_expected_min_version && ocl_version <= Version(2, 2)) + { + if (spirv_supported == false) + { + log_error("SPIR-V intermediate language not supported !!! OpenCL " + "%s requires support.\n", + ocl_version.to_string().c_str()); return TEST_FAIL; } } - if (ocl_version > Version(2, 2)) { - if (spirv_supported == false) { - log_info("SPIR-V intermediate language not supported in OpenCL %s. Test skipped.\n", ocl_version.to_string().c_str()); + if (ocl_version > Version(2, 2)) + { + if (spirv_supported == false) + { + log_info("SPIR-V intermediate language not supported in OpenCL %s. " + "Test skipped.\n", + ocl_version.to_string().c_str()); return TEST_SKIP; } } diff --git a/test_common/harness/testHarness.h b/test_common/harness/testHarness.h index 6e1998f6..d01c81ba 100644 --- a/test_common/harness/testHarness.h +++ b/test_common/harness/testHarness.h @@ -137,7 +137,9 @@ extern cl_device_id GetOpposingDevice( cl_device_id device ); Version get_device_spirv_il_version(cl_device_id device); bool check_device_spirv_il_support(cl_device_id device); -void version_expected_info(const char * test_name, const char * api_name, const char * expected_version, const char * device_version); +void version_expected_info(const char *test_name, const char *api_name, + const char *expected_version, + const char *device_version); test_status check_spirv_compilation_readiness(cl_device_id device); @@ -146,7 +148,7 @@ extern int gInfNanSupport; // This is set to 1 if the device suppor extern int gIsEmbedded; // This is set to 1 if the device is an embedded device extern int gHasLong; // This is set to 1 if the device suppots long and ulong types in OpenCL C. extern int gIsOpenCL_C_1_0_Device; // This is set to 1 if the device supports only OpenCL C 1.0. -extern bool gCoreILProgram; +extern bool gCoreILProgram; #if ! defined( __APPLE__ ) void memset_pattern4(void *, const void *, size_t); diff --git a/test_conformance/SVM/main.cpp b/test_conformance/SVM/main.cpp index bf492cea..3e478ecd 100644 --- a/test_conformance/SVM/main.cpp +++ b/test_conformance/SVM/main.cpp @@ -281,7 +281,9 @@ test_status InitCL(cl_device_id device) { auto version = get_device_cl_version(device); auto expected_min_version = Version(2, 0); if (version < expected_min_version) { - version_expected_info("Test", "OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; } diff --git a/test_conformance/c11_atomics/main.cpp b/test_conformance/c11_atomics/main.cpp index 957cce9d..52084732 100644 --- a/test_conformance/c11_atomics/main.cpp +++ b/test_conformance/c11_atomics/main.cpp @@ -110,7 +110,9 @@ test_status InitCL(cl_device_id device) { auto expected_min_version = Version(2, 0); if (version < expected_min_version) { - version_expected_info("Test", "OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; } return TEST_PASS; diff --git a/test_conformance/conversions/test_conversions.cpp b/test_conformance/conversions/test_conversions.cpp index b37fb3b6..b7280b4f 100644 --- a/test_conformance/conversions/test_conversions.cpp +++ b/test_conformance/conversions/test_conversions.cpp @@ -319,10 +319,10 @@ int main (int argc, const char **argv ) int ret = runTestHarnessWithCheck( 1, arg, test_num, test_list, true, 0, InitCL ); free_mtdata( gMTdata ); - if (gQueue) { + if (gQueue) + { error = clFinish(gQueue); - if (error) - vlog_error("clFinish failed: %d\n", error); + if (error) vlog_error("clFinish failed: %d\n", error); } clReleaseMemObject(gInBuffer); diff --git a/test_conformance/device_execution/main.cpp b/test_conformance/device_execution/main.cpp index a86e4a75..65115c9f 100644 --- a/test_conformance/device_execution/main.cpp +++ b/test_conformance/device_execution/main.cpp @@ -32,7 +32,9 @@ test_status InitCL(cl_device_id device) { auto version = get_device_cl_version(device); auto expected_min_version = Version(2, 0); if (version < expected_min_version) { - version_expected_info("Test", "OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; } diff --git a/test_conformance/device_timer/main.cpp b/test_conformance/device_timer/main.cpp index 0d4bd2fa..bb413fc2 100644 --- a/test_conformance/device_timer/main.cpp +++ b/test_conformance/device_timer/main.cpp @@ -39,7 +39,9 @@ test_status InitCL(cl_device_id device) { if (version < expected_min_version) { - version_expected_info("Test", "OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; } diff --git a/test_conformance/generic_address_space/main.cpp b/test_conformance/generic_address_space/main.cpp index e5437260..01147583 100644 --- a/test_conformance/generic_address_space/main.cpp +++ b/test_conformance/generic_address_space/main.cpp @@ -75,7 +75,9 @@ test_status InitCL(cl_device_id device) { if (version < expected_min_version) { - version_expected_info("Test", "OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; } diff --git a/test_conformance/non_uniform_work_group/main.cpp b/test_conformance/non_uniform_work_group/main.cpp index 36e419be..64eff96a 100644 --- a/test_conformance/non_uniform_work_group/main.cpp +++ b/test_conformance/non_uniform_work_group/main.cpp @@ -43,7 +43,9 @@ test_status InitCL(cl_device_id device) { auto expected_min_version = Version(2, 0); if (version < expected_min_version) { - version_expected_info("Test", "OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; } return TEST_PASS; diff --git a/test_conformance/pipes/main.cpp b/test_conformance/pipes/main.cpp index 842eb7c8..b2170732 100644 --- a/test_conformance/pipes/main.cpp +++ b/test_conformance/pipes/main.cpp @@ -24,7 +24,9 @@ test_status InitCL(cl_device_id device) { auto version = get_device_cl_version(device); auto expected_min_version = Version(2, 0); if (version < expected_min_version) { - version_expected_info("Test", "OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; } diff --git a/test_conformance/printf/test_printf.cpp b/test_conformance/printf/test_printf.cpp index c549ccef..075a2767 100644 --- a/test_conformance/printf/test_printf.cpp +++ b/test_conformance/printf/test_printf.cpp @@ -1023,7 +1023,9 @@ test_status InitCL( cl_device_id device ) auto expected_min_version = Version(1, 2); if (version < expected_min_version) { - version_expected_info("Test", "OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; } diff --git a/test_conformance/spirv_new/main.cpp b/test_conformance/spirv_new/main.cpp index 246864d8..afcc310e 100644 --- a/test_conformance/spirv_new/main.cpp +++ b/test_conformance/spirv_new/main.cpp @@ -154,24 +154,33 @@ int get_program_with_il(clProgramWrapper &prog, } unsigned char *buffer = &buffer_vec[0]; - if (gCoreILProgram) { + if (gCoreILProgram) + { prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); - SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL"); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithIL"); } - else { + else + { cl_platform_id platform; - err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, NULL); - SPIRV_CHECK_ERROR(err, "Failed to get platform info with clGetDeviceInfo"); + err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, + sizeof(cl_platform_id), &platform, NULL); + SPIRV_CHECK_ERROR(err, + "Failed to get platform info with clGetDeviceInfo"); clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL; - clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn)clGetExtensionFunctionAddressForPlatform(platform, "clCreateProgramWithILKHR"); + clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); if (clCreateProgramWithILKHR == NULL) { - log_error("ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); + log_error( + "ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); return -1; } prog = clCreateProgramWithILKHR(context, buffer, file_bytes, &err); - SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithILKHR"); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithILKHR"); } err = clBuildProgram(prog, 1, &deviceID, NULL, NULL, NULL); @@ -185,15 +194,18 @@ test_status InitCL(cl_device_id id) test_status spirv_status; bool force = true; spirv_status = check_spirv_compilation_readiness(id); - if (spirv_status != TEST_PASS) { + if (spirv_status != TEST_PASS) + { return spirv_status; } cl_uint address_bits; - cl_uint err = clGetDeviceInfo(id, CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), &address_bits, NULL); - if(err != CL_SUCCESS){ - log_error("clGetDeviceInfo failed to get address bits!"); - return TEST_FAIL; + cl_uint err = clGetDeviceInfo(id, CL_DEVICE_ADDRESS_BITS, sizeof(cl_uint), + &address_bits, NULL); + if (err != CL_SUCCESS) + { + log_error("clGetDeviceInfo failed to get address bits!"); + return TEST_FAIL; } gAddrWidth = address_bits == 32 ? "32" : "64"; @@ -234,8 +246,8 @@ int main(int argc, const char *argv[]) printUsage(); } - return runTestHarnessWithCheck(argc, argv, - spirvTestsRegistry::getInstance().getNumTests(), - spirvTestsRegistry::getInstance().getTestDefinitions(), - false, 0, InitCL); + return runTestHarnessWithCheck( + argc, argv, spirvTestsRegistry::getInstance().getNumTests(), + spirvTestsRegistry::getInstance().getTestDefinitions(), false, 0, + InitCL); } diff --git a/test_conformance/spirv_new/test_linkage.cpp b/test_conformance/spirv_new/test_linkage.cpp index 43e6d6f9..cf518c3e 100644 --- a/test_conformance/spirv_new/test_linkage.cpp +++ b/test_conformance/spirv_new/test_linkage.cpp @@ -33,34 +33,43 @@ static int test_linkage_compile(cl_device_id deviceID, } unsigned char *buffer = &buffer_vec[0]; - if (gCoreILProgram) { + if (gCoreILProgram) + { prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); - SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL"); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithIL"); } - else { + else + { cl_platform_id platform; - err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, NULL); - SPIRV_CHECK_ERROR(err, "Failed to get platform info with clGetDeviceInfo"); + err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, + sizeof(cl_platform_id), &platform, NULL); + SPIRV_CHECK_ERROR(err, + "Failed to get platform info with clGetDeviceInfo"); clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL; - clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn)clGetExtensionFunctionAddressForPlatform(platform, "clCreateProgramWithILKHR"); + clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); if (clCreateProgramWithILKHR == NULL) { - log_error("ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); + log_error( + "ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); return -1; } prog = clCreateProgramWithILKHR(context, buffer, file_bytes, &err); - SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithILKHR"); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithILKHR"); } err = clCompileProgram(prog, 1, &deviceID, NULL, // options - 0, // num headers + 0, // num headers NULL, // input headers NULL, // header include names NULL, // callback - NULL // User data - ); + NULL // User data + ); SPIRV_CHECK_ERROR(err, "Failed to compile spv program"); return 0; } diff --git a/test_conformance/spirv_new/test_op_opaque.cpp b/test_conformance/spirv_new/test_op_opaque.cpp index 2ea04343..067d9e4e 100644 --- a/test_conformance/spirv_new/test_op_opaque.cpp +++ b/test_conformance/spirv_new/test_op_opaque.cpp @@ -30,34 +30,43 @@ TEST_SPIRV_FUNC(op_type_opaque_simple) clProgramWrapper prog; - if (gCoreILProgram) { + if (gCoreILProgram) + { prog = clCreateProgramWithIL(context, buffer, file_bytes, &err); - SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithIL"); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithIL"); } - else { + else + { cl_platform_id platform; - err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, sizeof(cl_platform_id), &platform, NULL); - SPIRV_CHECK_ERROR(err, "Failed to get platform info with clGetDeviceInfo"); + err = clGetDeviceInfo(deviceID, CL_DEVICE_PLATFORM, + sizeof(cl_platform_id), &platform, NULL); + SPIRV_CHECK_ERROR(err, + "Failed to get platform info with clGetDeviceInfo"); clCreateProgramWithILKHR_fn clCreateProgramWithILKHR = NULL; - clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn)clGetExtensionFunctionAddressForPlatform(platform, "clCreateProgramWithILKHR"); + clCreateProgramWithILKHR = (clCreateProgramWithILKHR_fn) + clGetExtensionFunctionAddressForPlatform( + platform, "clCreateProgramWithILKHR"); if (clCreateProgramWithILKHR == NULL) { - log_error("ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); + log_error( + "ERROR: clGetExtensionFunctionAddressForPlatform failed\n"); return -1; } prog = clCreateProgramWithILKHR(context, buffer, file_bytes, &err); - SPIRV_CHECK_ERROR(err, "Failed to create program with clCreateProgramWithILKHR"); + SPIRV_CHECK_ERROR( + err, "Failed to create program with clCreateProgramWithILKHR"); } err = clCompileProgram(prog, 1, &deviceID, NULL, // options - 0, // num headers + 0, // num headers NULL, // input headers NULL, // header include names NULL, // callback - NULL // User data - ); + NULL // User data + ); SPIRV_CHECK_ERROR(err, "Failed to compile spv program"); return 0; } diff --git a/test_conformance/workgroups/main.cpp b/test_conformance/workgroups/main.cpp index 0c5640c8..41ffa741 100644 --- a/test_conformance/workgroups/main.cpp +++ b/test_conformance/workgroups/main.cpp @@ -47,7 +47,9 @@ test_status InitCL(cl_device_id device) { auto expected_min_version = Version(2, 0); if (version < expected_min_version) { - version_expected_info("Test","OpenCL", expected_min_version.to_string().c_str(), version.to_string().c_str()); + version_expected_info("Test", "OpenCL", + expected_min_version.to_string().c_str(), + version.to_string().c_str()); return TEST_SKIP; }