Get rid of test_finish macro and related ATF cruft (#633)

Closes #431

Signed-off-by: Kevin Petit <kevin.petit@arm.com>
This commit is contained in:
Kévin Petit
2020-03-02 15:06:44 +00:00
committed by GitHub
parent 7c82f6a9b8
commit b2eba77d42
23 changed files with 23 additions and 193 deletions

View File

@@ -31,47 +31,29 @@ extern "C" {
#define LOWER_IS_BETTER 0
#define HIGHER_IS_BETTER 1
// If USE_ATF is defined, all log_error and log_info calls can be routed to test library
// functions as described below. This is helpful for integration into an automated testing
// system.
#if USE_ATF
// export BUILD_WITH_ATF=1
#include <ATF/ATF.h>
#define test_start() ATFTestStart()
#define log_info ATFLogInfo
#define log_error ATFLogError
#define log_missing_feature ATFLogMissingFeature
#define log_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format, ##__VA_ARGS__)
#define test_finish() ATFTestFinish()
#define vlog_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format,##__VA_ARGS__)
#define vlog ATFLogInfo
#define vlog_error ATFLogError
#else
#include <stdio.h>
#define test_start()
#define log_info printf
#define log_error printf
#define log_missing_feature printf
#define log_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \
_higherBetter?"higher is better":"lower is better", _number )
#define test_finish()
#define vlog_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \
_higherBetter?"higher is better":"lower is better" , _number)
#ifdef _WIN32
#ifdef __MINGW32__
// Use __mingw_printf since it supports "%a" format specifier
#define vlog __mingw_printf
#define vlog_error __mingw_printf
#else
// Use home-baked function that treats "%a" as "%f"
static int vlog_win32(const char *format, ...);
#define vlog vlog_win32
#define vlog_error vlog_win32
#endif
#include <stdio.h>
#define test_start()
#define log_info printf
#define log_error printf
#define log_missing_feature printf
#define log_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \
_higherBetter?"higher is better":"lower is better", _number )
#define vlog_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \
_higherBetter?"higher is better":"lower is better" , _number)
#ifdef _WIN32
#ifdef __MINGW32__
// Use __mingw_printf since it supports "%a" format specifier
#define vlog __mingw_printf
#define vlog_error __mingw_printf
#else
#define vlog_error printf
#define vlog printf
// Use home-baked function that treats "%a" as "%f"
static int vlog_win32(const char *format, ...);
#define vlog vlog_win32
#define vlog_error vlog_win32
#endif
#else
#define vlog_error printf
#define vlog printf
#endif
#define ct_assert(b) ct_assert_i(b, __LINE__)

View File

@@ -139,7 +139,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
argc = parseCustomParam(argc, argv);
if (argc == -1)
{
test_finish();
return EXIT_FAILURE;
}
@@ -164,7 +163,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
{
log_info( "\t%s\n", testList[i].name );
}
test_finish();
return EXIT_SUCCESS;
}
@@ -291,14 +289,12 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
err = clGetPlatformIDs(0, NULL, &num_platforms);
if (err) {
print_error(err, "clGetPlatformIDs failed");
test_finish();
return EXIT_FAILURE;
}
platforms = (cl_platform_id *) malloc( num_platforms * sizeof( cl_platform_id ) );
if (!platforms || choosen_platform_index >= num_platforms) {
log_error( "platform index out of range -- choosen_platform_index (%d) >= num_platforms (%d)\n", choosen_platform_index, num_platforms );
test_finish();
return EXIT_FAILURE;
}
BufferOwningPtr<cl_platform_id> platformsBuf(platforms);
@@ -306,7 +302,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
err = clGetPlatformIDs(num_platforms, platforms, NULL);
if (err) {
print_error(err, "clGetPlatformIDs failed");
test_finish();
return EXIT_FAILURE;
}
@@ -314,14 +309,12 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
err = clGetDeviceIDs(platforms[choosen_platform_index], device_type, 0, NULL, &num_devices );
if (err) {
print_error(err, "clGetDeviceIDs failed");
test_finish();
return EXIT_FAILURE;
}
devices = (cl_device_id *) malloc( num_devices * sizeof( cl_device_id ) );
if (!devices || choosen_device_index >= num_devices) {
log_error( "device index out of range -- choosen_device_index (%d) >= num_devices (%d)\n", choosen_device_index, num_devices );
test_finish();
return EXIT_FAILURE;
}
BufferOwningPtr<cl_device_id> devicesBuf(devices);
@@ -331,7 +324,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
err = clGetDeviceIDs(platforms[choosen_platform_index], device_type, num_devices, devices, NULL );
if (err) {
print_error(err, "clGetDeviceIDs failed");
test_finish();
return EXIT_FAILURE;
}
@@ -339,7 +331,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
if( printDeviceHeader( device ) != CL_SUCCESS )
{
test_finish();
return EXIT_FAILURE;
}
@@ -347,7 +338,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( fpconfig ), &fpconfig, NULL );
if (err) {
print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed");
test_finish();
return EXIT_FAILURE;
}
@@ -361,7 +351,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
if (err)
{
print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" );
test_finish();
return EXIT_FAILURE;
}
gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE");
@@ -372,7 +361,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
if (err)
{
print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed\n");
test_finish();
return EXIT_FAILURE;
}
@@ -388,14 +376,12 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extensionsStringSize ) ))
{
print_error( err, "Unable to get extensions string size for embedded device" );
test_finish();
return EXIT_FAILURE;
}
char *extensions_string = (char*) malloc(extensionsStringSize);
if( NULL == extensions_string )
{
print_error( CL_OUT_OF_HOST_MEMORY, "Unable to allocate storage for extensions string for embedded device" );
test_finish();
return EXIT_FAILURE;
}
BufferOwningPtr<char> extensions_stringBuf(extensions_string);
@@ -403,14 +389,12 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extensionsStringSize, extensions_string, NULL ) ))
{
print_error( err, "Unable to get extensions string for embedded device" );
test_finish();
return EXIT_FAILURE;
}
if( extensions_string[extensionsStringSize-1] != '\0' )
{
log_error( "FAILURE: extensions string for embedded device is not NUL terminated" );
test_finish();
return EXIT_FAILURE;
}
@@ -427,7 +411,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
if( (err = clGetDeviceInfo( device, CL_DEVICE_OPENCL_C_VERSION, sizeof(c_version), c_version, NULL )) )
{
log_error( "FAILURE: unable to get CL_DEVICE_OPENCL_C_VERSION on 1.0 device. (%d)\n", err );
test_finish();
return EXIT_FAILURE;
}
@@ -444,7 +427,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
if( (err = clGetDeviceInfo( device, CL_DEVICE_ADDRESS_BITS, sizeof( device_address_bits ), &device_address_bits, NULL ) ))
{
print_error( err, "Unable to obtain device address bits" );
test_finish();
return EXIT_FAILURE;
}
if( device_address_bits )
@@ -452,7 +434,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
else
{
log_error("Invalid device address bit size returned by device.\n");
test_finish();
return EXIT_FAILURE;
}
@@ -668,8 +649,6 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
}
}
test_finish();
free( selectedTestList );
free( resultTestList );

View File

@@ -275,7 +275,6 @@ int allocate_size(cl_context context, cl_command_queue *queue, cl_device_id devi
// Otherwise we succeeded
if (result != SUCCEEDED) {
log_error("Test logic error.");
test_finish();
exit(-1);
}
amount_allocated += allocation_this_time;

View File

@@ -277,7 +277,6 @@ int main(int argc, const char *argv[])
argc = parseCustomParam(argc, argv);
if (argc == -1)
{
test_finish();
return 1;
}

View File

@@ -132,7 +132,6 @@ test_fpmath_float(cl_device_id device, cl_context context, cl_command_queue queu
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL );
if (err) {
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
test_finish();
return -1;
}
//If we only support rtz mode
@@ -144,13 +143,11 @@ test_fpmath_float(cl_device_id device, cl_context context, cl_command_queue queu
if( err )
{
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
test_finish();
return -1;
}
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
{
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
test_finish();
return -1;
}

View File

@@ -132,7 +132,6 @@ test_fpmath_float2(cl_device_id device, cl_context context, cl_command_queue que
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL );
if (err) {
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
test_finish();
return -1;
}
//If we only support rtz mode
@@ -144,13 +143,11 @@ test_fpmath_float2(cl_device_id device, cl_context context, cl_command_queue que
if( err )
{
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
test_finish();
return -1;
}
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
{
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
test_finish();
return -1;
}

View File

@@ -132,7 +132,6 @@ test_fpmath_float4(cl_device_id device, cl_context context, cl_command_queue que
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL );
if (err) {
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
test_finish();
return -1;
}
//If we only support rtz mode
@@ -144,13 +143,11 @@ test_fpmath_float4(cl_device_id device, cl_context context, cl_command_queue que
if( err )
{
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
test_finish();
return -1;
}
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
{
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
test_finish();
return -1;
}

View File

@@ -176,7 +176,6 @@ int test_queue_priority(cl_device_id device, cl_context context, cl_command_queu
err = clGetDeviceInfo( device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof( num_compute_units ), &num_compute_units, NULL );
if (err) {
log_error("clGetDeviceInfo for CL_DEVICE_MAX_COMPUTE_UNITS failed: %d", err);
test_finish();
return -1;
}
@@ -191,7 +190,6 @@ int test_queue_priority(cl_device_id device, cl_context context, cl_command_queu
cl_command_queue background_queue = clCreateCommandQueueWithProperties(context, device, queue_properties, &err);
if (err) {
log_error("clCreateCommandQueueWithPropertiesAPPLE failed: %d", err);
test_finish();
return -1;
}
@@ -214,7 +212,6 @@ int test_queue_priority(cl_device_id device, cl_context context, cl_command_queu
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL );
if (err) {
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
test_finish();
return -1;
}
//If we only support rtz mode
@@ -226,13 +223,11 @@ int test_queue_priority(cl_device_id device, cl_context context, cl_command_queu
if( err )
{
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
test_finish();
return -1;
}
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
{
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
test_finish();
return -1;
}

View File

@@ -25,26 +25,6 @@
#include <string.h>
#include "harness/kernelHelpers.h"
///////////////////////////////////////////////////////////////////////////////
// ATF performance framework.
#if USE_ATF
#include <ATF/ATF.h>
#define test_start() ATFTestStart()
#define log_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format,##__VA_ARGS__)
#define log_info ATFLogInfo
#define log_error ATFLogError
#define log_no_atf
#define test_finish() ATFTestFinish()
#else
#define test_start()
#define log_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, _higherBetter?"higher is better":"lower is better" , _number)
#define log_info(...) fprintf(stdout, ## __VA_ARGS__ )
#define log_error(...) fprintf(stderr, ## __VA_ARGS__ )
#define log_info_no_atf(...) log_info(## __VA_ARGS__ )
#define test_finish()
#endif
///////////////////////////////////////////////////////////////////////////////
// CL error checking.

View File

@@ -163,7 +163,6 @@ int main(int argc, const char *argv[])
argc = parseCustomParam(argc, argv);
if (argc == -1)
{
test_finish ();
return -1;
}
@@ -207,7 +206,6 @@ int main(int argc, const char *argv[])
log_info( "Note: Any 3.2 test names must follow 2.1 test names on the command line.\n" );
log_info( "Use environment variables to specify desired device.\n" );
test_finish();
return 0;
}
@@ -228,11 +226,9 @@ int main(int argc, const char *argv[])
int supported = glEnv->SupportsCLGLInterop( requestedDeviceType );
if( supported == 0 ) {
log_info("Test not run because GL-CL interop is not supported for any devices of the requested type.\n");
test_finish();
return 0;
} else if ( supported == -1 ) {
log_error("Unable to setup the test or failed to determine if CL-GL interop is supported.\n");
test_finish();
return -1;
}
@@ -248,7 +244,6 @@ int main(int argc, const char *argv[])
// At least one device supports CL-GL interop, so init the test.
if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) {
log_error("Failed to initialize the GL environment for this test.\n");
test_finish();
return -1;
}
@@ -257,7 +252,6 @@ int main(int argc, const char *argv[])
if( sCurrentContext == NULL )
{
log_error( "ERROR: Unable to obtain CL context from GL\n" );
test_finish();
return -1;
}
@@ -268,19 +262,16 @@ int main(int argc, const char *argv[])
if( error != CL_SUCCESS )
{
print_error( error, "Unable to get device count from context" );
test_finish();
return -1;
}
deviceIDs = (cl_device_id *)malloc(numDevices);
if (deviceIDs == NULL) {
print_error( error, "malloc failed" );
test_finish();
return -1;
}
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, numDevices, deviceIDs, NULL);
if( error != CL_SUCCESS ) {
print_error( error, "Unable to get device list from context" );
test_finish();
return -1;
}
@@ -288,7 +279,6 @@ int main(int argc, const char *argv[])
if (numDevices < 1) {
log_error("No devices found.\n");
test_finish();
return -1;
}
@@ -298,7 +288,6 @@ int main(int argc, const char *argv[])
for( size_t i = 0; i < numDevices; i++ ) {
log_info( "\nTesting OpenGL 2.x\n" );
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
test_finish();
return -1;
}
@@ -322,7 +311,6 @@ int main(int argc, const char *argv[])
// At least one device supports CL-GL interop, so init the test.
if( glEnv->Init( &argc, (char **)argv, CL_TRUE ) ) {
log_error("Failed to initialize the GL environment for this test.\n");
test_finish();
return -1;
}
@@ -330,7 +318,6 @@ int main(int argc, const char *argv[])
sCurrentContext = glEnv->CreateCLContext();
if( sCurrentContext == NULL ) {
log_error( "ERROR: Unable to obtain CL context from GL\n" );
test_finish();
return -1;
}
@@ -340,19 +327,16 @@ int main(int argc, const char *argv[])
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices);
if( error != CL_SUCCESS ) {
print_error( error, "Unable to get device count from context" );
test_finish();
return -1;
}
deviceIDs = (cl_device_id *)malloc(numDevices);
if (deviceIDs == NULL) {
print_error( error, "malloc failed" );
test_finish();
return -1;
}
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, numDevices, deviceIDs, NULL);
if( error != CL_SUCCESS ) {
print_error( error, "Unable to get device list from context" );
test_finish();
return -1;
}
@@ -360,7 +344,6 @@ int main(int argc, const char *argv[])
if (numDevices < 1) {
log_error("No devices found.\n");
test_finish();
return -1;
}
@@ -371,7 +354,6 @@ int main(int argc, const char *argv[])
for( size_t i = 0; i < numDevices; i++ ) {
log_info( "\nTesting OpenGL 3.2\n" );
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
test_finish();
return -1;
}

View File

@@ -669,7 +669,6 @@ int test_fence_sync( cl_device_id device, cl_context context, cl_command_queue q
if( err != CL_SUCCESS )
{
print_error( err, "Unable to get device count from context" );
test_finish();
return -1;
}
vs_count = (GLint)device_cb / sizeof(cl_device_id);

View File

@@ -120,7 +120,6 @@ int main(int argc, const char *argv[])
log_info( "Note: Any 3.2 test names must follow 2.1 test names on the command line." );
log_info( "Use environment variables to specify desired device." );
test_finish();
return 0;
}
@@ -135,7 +134,6 @@ int main(int argc, const char *argv[])
{
printf("Requested device type is CL_DEVICE_TYPE_CPU\n");
log_info("Invalid CL device type. GL tests can only run on a GPU device.\n");
test_finish();
return 0;
}
}//for
@@ -157,12 +155,10 @@ int main(int argc, const char *argv[])
int supported = glEnv->SupportsCLGLInterop( requestedDeviceType );
if( supported == 0 ) {
log_info("Test not run because GL-CL interop is not supported for any devices of the requested type.\n");
test_finish();
error = 0;
goto cleanup;
} else if ( supported == -1 ) {
log_error("Failed to determine if CL-GL interop is supported.\n");
test_finish();
error = -1;
goto cleanup;
}
@@ -173,7 +169,6 @@ int main(int argc, const char *argv[])
// At least one device supports CL-GL interop, so init the test.
if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) {
log_error("Failed to initialize the GL environment for this test.\n");
test_finish();
error = -1;
goto cleanup;
}
@@ -183,7 +178,6 @@ int main(int argc, const char *argv[])
if( sCurrentContext == NULL )
{
log_error( "ERROR: Unable to obtain CL context from GL\n" );
test_finish();
error = -1;
goto cleanup;
}
@@ -195,7 +189,6 @@ int main(int argc, const char *argv[])
if( error != CL_SUCCESS )
{
print_error( error, "Unable to get device count from context" );
test_finish();
error = -1;
goto cleanup;
}
@@ -203,7 +196,6 @@ int main(int argc, const char *argv[])
if (numDevices < 1) {
log_error("No devices found.\n");
test_finish();
error = -1;
goto cleanup;
}
@@ -211,7 +203,6 @@ int main(int argc, const char *argv[])
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL);
if( error != CL_SUCCESS ) {
print_error( error, "Unable to get device list from context" );
test_finish();
error = -1;
goto cleanup;
}
@@ -222,7 +213,6 @@ int main(int argc, const char *argv[])
for( size_t i = 0; i < numDevices; i++ ) {
log_info( "\nTesting OpenGL 2.x\n" );
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
test_finish();
error = -1;
goto cleanup;
}
@@ -286,7 +276,6 @@ int main(int argc, const char *argv[])
// At least one device supports CL-GL interop, so init the test.
if( glEnv->Init( &argc, (char **)argv, CL_TRUE ) ) {
log_error("Failed to initialize the GL environment for this test.\n");
test_finish();
error = -1;
goto cleanup;
}
@@ -295,7 +284,6 @@ int main(int argc, const char *argv[])
sCurrentContext = glEnv->CreateCLContext();
if( sCurrentContext == NULL ) {
log_error( "ERROR: Unable to obtain CL context from GL\n" );
test_finish();
error = -1;
goto cleanup;
}
@@ -306,7 +294,6 @@ int main(int argc, const char *argv[])
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices);
if( error != CL_SUCCESS ) {
print_error( error, "Unable to get device count from context" );
test_finish();
error = -1;
goto cleanup;
}
@@ -314,7 +301,6 @@ int main(int argc, const char *argv[])
if (numDevices < 1) {
log_error("No devices found.\n");
test_finish();
error = -1;
goto cleanup;
}
@@ -322,7 +308,6 @@ int main(int argc, const char *argv[])
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL);
if( error != CL_SUCCESS ) {
print_error( error, "Unable to get device list from context" );
test_finish();
error = -1;
goto cleanup;
}
@@ -334,13 +319,11 @@ int main(int argc, const char *argv[])
for( size_t i = 0; i < numDevices; i++ ) {
log_info( "\nTesting OpenGL 3.2\n" );
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
test_finish();
error = -1;
goto cleanup;
}
#ifdef GL_ES_VERSION_2_0
log_info("Cannot test OpenGL 3.2! This test was built for OpenGL ES 2.0\n");
test_finish();
error = -1;
goto cleanup;
#else

View File

@@ -95,7 +95,6 @@ int main (int argc, const char **argv )
argc = parseCustomParam(argc, argv);
if (argc == -1)
{
test_finish();
return -1;
}

View File

@@ -78,7 +78,6 @@ int main(int argc, const char *argv[])
argc = parseCustomParam(argc, argv);
if (argc == -1)
{
test_finish();
return -1;
}

View File

@@ -280,7 +280,6 @@ int main(int argc, const char *argv[])
argc = parseCustomParam(argc, argv);
if (argc == -1)
{
test_finish();
return -1;
}

View File

@@ -81,18 +81,7 @@ extern cl_device_fp_config gDoubleCapabilities;
#define LOWER_IS_BETTER 0
#define HIGHER_IS_BETTER 1
#if USE_ATF
#include <ATF/ATF.h>
#define test_start() ATFTestStart()
#define test_finish() ATFTestFinish()
#define vlog( ... ) ATFLogInfo(__VA_ARGS__)
#define vlog_error( ... ) ATFLogError(__VA_ARGS__)
#define vlog_perf( _number, _higherIsBetter, _units, _nameFmt, ... ) ATFLogPerformanceNumber(_number, _higherIsBetter, _units, _nameFmt, __VA_ARGS__ )
#else
#include "harness/errorHelpers.h"
#endif
#include "harness/errorHelpers.h"
#if defined (_MSC_VER )
//Deal with missing scalbn on windows

View File

@@ -133,7 +133,6 @@ static void ReleaseCL( void );
static int InitILogbConstants( void );
static int IsTininessDetectedBeforeRounding( void );
static int IsInRTZMode( void ); //expensive. Please check gIsInRTZMode global instead.
static void TestFinishAtExit(void);
int doTest( const char* name )
@@ -816,7 +815,6 @@ int main (int argc, const char * argv[])
{
return -1;
}
atexit(TestFinishAtExit);
#if defined( __APPLE__ )
struct timeval startTime;
@@ -1993,7 +1991,3 @@ cl_uint RoundUpToNextPowerOfTwo( cl_uint x )
return x+x;
}
void TestFinishAtExit(void) {
test_finish();
}

View File

@@ -1033,7 +1033,6 @@ test_status InitCL( cl_device_id device )
err = check_opencl_version(device,1,2);
if( err != CL_SUCCESS ) {
print_missing_feature(err,"printf");
test_finish();
return TEST_FAIL;
}

View File

@@ -29,21 +29,6 @@
#include <CL/cl_platform.h>
#endif
// Enable the test to be used with ATF
#if USE_ATF
// export BUILD_WITH_ATF=1
#include <ATF/ATF.h>
#define test_start() ATFTestStart()
#define log_info ATFLogInfo
#define log_error ATFLogError
#define test_finish() ATFTestFinish()
#else
#define test_start()
#define log_info printf
#define log_error printf
#define test_finish()
#endif // USE_ATF
#define ANALYSIS_BUFFER_SIZE 256
//-----------------------------------------

View File

@@ -58,8 +58,6 @@ static int doTest(cl_command_queue queue, cl_context context,
static void printUsage( void );
static void TestFinishAtExit(void);
//-----------------------------------------
// Definitions and initializations
//-----------------------------------------
@@ -579,7 +577,6 @@ const int test_num = ARRAY_SIZE( test_list );
int main(int argc, const char* argv[])
{
test_start();
atexit(TestFinishAtExit);
argc = parseCustomParam(argc, argv);
if (argc == -1)
@@ -666,7 +663,3 @@ static void printUsage( void )
}
}
static void TestFinishAtExit(void)
{
test_finish();
}

View File

@@ -27,22 +27,6 @@
#include <CL/opencl.h>
#endif
// Enable the test to be used with ATF
#if USE_ATF
// export BUILD_WITH_ATF=1
#include <ATF/ATF.h>
#define test_start() ATFTestStart()
#define log_info ATFLogInfo
#define log_error ATFLogError
#define test_finish() ATFTestFinish()
#else
#define test_start()
#define log_info printf
#define log_error printf
#define test_finish()
#endif // USE_ATF
// Defines the set of types we support (no support for double)
typedef enum {
kuchar = 0,

View File

@@ -14,6 +14,7 @@
// limitations under the License.
//
#include "harness/compat.h"
#include "harness/errorHelpers.h"
#include <stdio.h>
#include "test_select.h"

View File

@@ -59,7 +59,6 @@ int test_step_internal(cl_device_id deviceID, cl_context context, cl_command_que
if (err)
{
print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" );
test_finish();
return -1;
}
gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE");