mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
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:
@@ -31,47 +31,29 @@ extern "C" {
|
|||||||
#define LOWER_IS_BETTER 0
|
#define LOWER_IS_BETTER 0
|
||||||
#define HIGHER_IS_BETTER 1
|
#define HIGHER_IS_BETTER 1
|
||||||
|
|
||||||
// If USE_ATF is defined, all log_error and log_info calls can be routed to test library
|
#include <stdio.h>
|
||||||
// functions as described below. This is helpful for integration into an automated testing
|
#define test_start()
|
||||||
// system.
|
#define log_info printf
|
||||||
#if USE_ATF
|
#define log_error printf
|
||||||
// export BUILD_WITH_ATF=1
|
#define log_missing_feature printf
|
||||||
#include <ATF/ATF.h>
|
#define log_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \
|
||||||
#define test_start() ATFTestStart()
|
_higherBetter?"higher is better":"lower is better", _number )
|
||||||
#define log_info ATFLogInfo
|
#define vlog_perf(_number, _higherBetter, _numType, _format, ...) printf("Performance Number " _format " (in %s, %s): %g\n",##__VA_ARGS__, _numType, \
|
||||||
#define log_error ATFLogError
|
_higherBetter?"higher is better":"lower is better" , _number)
|
||||||
#define log_missing_feature ATFLogMissingFeature
|
#ifdef _WIN32
|
||||||
#define log_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format, ##__VA_ARGS__)
|
#ifdef __MINGW32__
|
||||||
#define test_finish() ATFTestFinish()
|
// Use __mingw_printf since it supports "%a" format specifier
|
||||||
#define vlog_perf(_number, _higherBetter, _numType, _format, ...) ATFLogPerformanceNumber(_number, _higherBetter, _numType, _format,##__VA_ARGS__)
|
#define vlog __mingw_printf
|
||||||
#define vlog ATFLogInfo
|
#define vlog_error __mingw_printf
|
||||||
#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
|
|
||||||
#else
|
#else
|
||||||
#define vlog_error printf
|
// Use home-baked function that treats "%a" as "%f"
|
||||||
#define vlog printf
|
static int vlog_win32(const char *format, ...);
|
||||||
|
#define vlog vlog_win32
|
||||||
|
#define vlog_error vlog_win32
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
#define vlog_error printf
|
||||||
|
#define vlog printf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define ct_assert(b) ct_assert_i(b, __LINE__)
|
#define ct_assert(b) ct_assert_i(b, __LINE__)
|
||||||
|
|||||||
@@ -139,7 +139,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
|
|||||||
argc = parseCustomParam(argc, argv);
|
argc = parseCustomParam(argc, argv);
|
||||||
if (argc == -1)
|
if (argc == -1)
|
||||||
{
|
{
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
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 );
|
log_info( "\t%s\n", testList[i].name );
|
||||||
}
|
}
|
||||||
test_finish();
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,14 +289,12 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
|
|||||||
err = clGetPlatformIDs(0, NULL, &num_platforms);
|
err = clGetPlatformIDs(0, NULL, &num_platforms);
|
||||||
if (err) {
|
if (err) {
|
||||||
print_error(err, "clGetPlatformIDs failed");
|
print_error(err, "clGetPlatformIDs failed");
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
platforms = (cl_platform_id *) malloc( num_platforms * sizeof( cl_platform_id ) );
|
platforms = (cl_platform_id *) malloc( num_platforms * sizeof( cl_platform_id ) );
|
||||||
if (!platforms || choosen_platform_index >= num_platforms) {
|
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 );
|
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;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
BufferOwningPtr<cl_platform_id> platformsBuf(platforms);
|
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);
|
err = clGetPlatformIDs(num_platforms, platforms, NULL);
|
||||||
if (err) {
|
if (err) {
|
||||||
print_error(err, "clGetPlatformIDs failed");
|
print_error(err, "clGetPlatformIDs failed");
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
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 );
|
err = clGetDeviceIDs(platforms[choosen_platform_index], device_type, 0, NULL, &num_devices );
|
||||||
if (err) {
|
if (err) {
|
||||||
print_error(err, "clGetDeviceIDs failed");
|
print_error(err, "clGetDeviceIDs failed");
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
devices = (cl_device_id *) malloc( num_devices * sizeof( cl_device_id ) );
|
devices = (cl_device_id *) malloc( num_devices * sizeof( cl_device_id ) );
|
||||||
if (!devices || choosen_device_index >= num_devices) {
|
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 );
|
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;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
BufferOwningPtr<cl_device_id> devicesBuf(devices);
|
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 );
|
err = clGetDeviceIDs(platforms[choosen_platform_index], device_type, num_devices, devices, NULL );
|
||||||
if (err) {
|
if (err) {
|
||||||
print_error(err, "clGetDeviceIDs failed");
|
print_error(err, "clGetDeviceIDs failed");
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +331,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
|
|||||||
|
|
||||||
if( printDeviceHeader( device ) != CL_SUCCESS )
|
if( printDeviceHeader( device ) != CL_SUCCESS )
|
||||||
{
|
{
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
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 );
|
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( fpconfig ), &fpconfig, NULL );
|
||||||
if (err) {
|
if (err) {
|
||||||
print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed");
|
print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed");
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -361,7 +351,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
|
|||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" );
|
print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" );
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE");
|
gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE");
|
||||||
@@ -372,7 +361,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
|
|||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed\n");
|
print_error(err, "clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed\n");
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
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 ) ))
|
if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, 0, NULL, &extensionsStringSize ) ))
|
||||||
{
|
{
|
||||||
print_error( err, "Unable to get extensions string size for embedded device" );
|
print_error( err, "Unable to get extensions string size for embedded device" );
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
char *extensions_string = (char*) malloc(extensionsStringSize);
|
char *extensions_string = (char*) malloc(extensionsStringSize);
|
||||||
if( NULL == extensions_string )
|
if( NULL == extensions_string )
|
||||||
{
|
{
|
||||||
print_error( CL_OUT_OF_HOST_MEMORY, "Unable to allocate storage for extensions string for embedded device" );
|
print_error( CL_OUT_OF_HOST_MEMORY, "Unable to allocate storage for extensions string for embedded device" );
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
BufferOwningPtr<char> extensions_stringBuf(extensions_string);
|
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 ) ))
|
if( (err = clGetDeviceInfo( device, CL_DEVICE_EXTENSIONS, extensionsStringSize, extensions_string, NULL ) ))
|
||||||
{
|
{
|
||||||
print_error( err, "Unable to get extensions string for embedded device" );
|
print_error( err, "Unable to get extensions string for embedded device" );
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( extensions_string[extensionsStringSize-1] != '\0' )
|
if( extensions_string[extensionsStringSize-1] != '\0' )
|
||||||
{
|
{
|
||||||
log_error( "FAILURE: extensions string for embedded device is not NUL terminated" );
|
log_error( "FAILURE: extensions string for embedded device is not NUL terminated" );
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
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 )) )
|
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 );
|
log_error( "FAILURE: unable to get CL_DEVICE_OPENCL_C_VERSION on 1.0 device. (%d)\n", err );
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
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 ) ))
|
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" );
|
print_error( err, "Unable to obtain device address bits" );
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
if( device_address_bits )
|
if( device_address_bits )
|
||||||
@@ -452,7 +434,6 @@ int runTestHarnessWithCheck( int argc, const char *argv[], int testNum, test_def
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
log_error("Invalid device address bit size returned by device.\n");
|
log_error("Invalid device address bit size returned by device.\n");
|
||||||
test_finish();
|
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -668,8 +649,6 @@ int parseAndCallCommandLineTests( int argc, const char *argv[], cl_device_id dev
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test_finish();
|
|
||||||
|
|
||||||
free( selectedTestList );
|
free( selectedTestList );
|
||||||
free( resultTestList );
|
free( resultTestList );
|
||||||
|
|
||||||
|
|||||||
@@ -275,7 +275,6 @@ int allocate_size(cl_context context, cl_command_queue *queue, cl_device_id devi
|
|||||||
// Otherwise we succeeded
|
// Otherwise we succeeded
|
||||||
if (result != SUCCEEDED) {
|
if (result != SUCCEEDED) {
|
||||||
log_error("Test logic error.");
|
log_error("Test logic error.");
|
||||||
test_finish();
|
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
amount_allocated += allocation_this_time;
|
amount_allocated += allocation_this_time;
|
||||||
|
|||||||
@@ -277,7 +277,6 @@ int main(int argc, const char *argv[])
|
|||||||
argc = parseCustomParam(argc, argv);
|
argc = parseCustomParam(argc, argv);
|
||||||
if (argc == -1)
|
if (argc == -1)
|
||||||
{
|
{
|
||||||
test_finish();
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 );
|
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL );
|
||||||
if (err) {
|
if (err) {
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//If we only support rtz mode
|
//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 )
|
if( err )
|
||||||
{
|
{
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
|
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
|
||||||
{
|
{
|
||||||
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
|
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 );
|
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL );
|
||||||
if (err) {
|
if (err) {
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//If we only support rtz mode
|
//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 )
|
if( err )
|
||||||
{
|
{
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
|
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
|
||||||
{
|
{
|
||||||
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
|
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 );
|
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL );
|
||||||
if (err) {
|
if (err) {
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//If we only support rtz mode
|
//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 )
|
if( err )
|
||||||
{
|
{
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
|
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
|
||||||
{
|
{
|
||||||
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
|
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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 );
|
err = clGetDeviceInfo( device, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof( num_compute_units ), &num_compute_units, NULL );
|
||||||
if (err) {
|
if (err) {
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_MAX_COMPUTE_UNITS failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_MAX_COMPUTE_UNITS failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
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);
|
cl_command_queue background_queue = clCreateCommandQueueWithProperties(context, device, queue_properties, &err);
|
||||||
if (err) {
|
if (err) {
|
||||||
log_error("clCreateCommandQueueWithPropertiesAPPLE failed: %d", err);
|
log_error("clCreateCommandQueueWithPropertiesAPPLE failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
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 );
|
err = clGetDeviceInfo( device, CL_DEVICE_SINGLE_FP_CONFIG, sizeof( single_config ), &single_config, NULL );
|
||||||
if (err) {
|
if (err) {
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_SINGLE_FP_CONFIG failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
//If we only support rtz mode
|
//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 )
|
if( err )
|
||||||
{
|
{
|
||||||
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
|
log_error("clGetDeviceInfo for CL_DEVICE_PROFILE failed: %d", err);
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
|
if( 0 != strcmp( profile, "EMBEDDED_PROFILE"))
|
||||||
{
|
{
|
||||||
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
|
log_error( "FAILURE: Device doesn't support CL_FP_ROUND_TO_NEAREST and isn't EMBEDDED_PROFILE\n" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,26 +25,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "harness/kernelHelpers.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.
|
// CL error checking.
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ int main(int argc, const char *argv[])
|
|||||||
argc = parseCustomParam(argc, argv);
|
argc = parseCustomParam(argc, argv);
|
||||||
if (argc == -1)
|
if (argc == -1)
|
||||||
{
|
{
|
||||||
test_finish ();
|
|
||||||
return -1;
|
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( "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" );
|
log_info( "Use environment variables to specify desired device.\n" );
|
||||||
|
|
||||||
test_finish();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,11 +226,9 @@ int main(int argc, const char *argv[])
|
|||||||
int supported = glEnv->SupportsCLGLInterop( requestedDeviceType );
|
int supported = glEnv->SupportsCLGLInterop( requestedDeviceType );
|
||||||
if( supported == 0 ) {
|
if( supported == 0 ) {
|
||||||
log_info("Test not run because GL-CL interop is not supported for any devices of the requested type.\n");
|
log_info("Test not run because GL-CL interop is not supported for any devices of the requested type.\n");
|
||||||
test_finish();
|
|
||||||
return 0;
|
return 0;
|
||||||
} else if ( supported == -1 ) {
|
} else if ( supported == -1 ) {
|
||||||
log_error("Unable to setup the test or failed to determine if CL-GL interop is supported.\n");
|
log_error("Unable to setup the test or failed to determine if CL-GL interop is supported.\n");
|
||||||
test_finish();
|
|
||||||
return -1;
|
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.
|
// At least one device supports CL-GL interop, so init the test.
|
||||||
if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) {
|
if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) {
|
||||||
log_error("Failed to initialize the GL environment for this test.\n");
|
log_error("Failed to initialize the GL environment for this test.\n");
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -257,7 +252,6 @@ int main(int argc, const char *argv[])
|
|||||||
if( sCurrentContext == NULL )
|
if( sCurrentContext == NULL )
|
||||||
{
|
{
|
||||||
log_error( "ERROR: Unable to obtain CL context from GL\n" );
|
log_error( "ERROR: Unable to obtain CL context from GL\n" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -268,19 +262,16 @@ int main(int argc, const char *argv[])
|
|||||||
if( error != CL_SUCCESS )
|
if( error != CL_SUCCESS )
|
||||||
{
|
{
|
||||||
print_error( error, "Unable to get device count from context" );
|
print_error( error, "Unable to get device count from context" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
deviceIDs = (cl_device_id *)malloc(numDevices);
|
deviceIDs = (cl_device_id *)malloc(numDevices);
|
||||||
if (deviceIDs == NULL) {
|
if (deviceIDs == NULL) {
|
||||||
print_error( error, "malloc failed" );
|
print_error( error, "malloc failed" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, numDevices, deviceIDs, NULL);
|
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, numDevices, deviceIDs, NULL);
|
||||||
if( error != CL_SUCCESS ) {
|
if( error != CL_SUCCESS ) {
|
||||||
print_error( error, "Unable to get device list from context" );
|
print_error( error, "Unable to get device list from context" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -288,7 +279,6 @@ int main(int argc, const char *argv[])
|
|||||||
|
|
||||||
if (numDevices < 1) {
|
if (numDevices < 1) {
|
||||||
log_error("No devices found.\n");
|
log_error("No devices found.\n");
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -298,7 +288,6 @@ int main(int argc, const char *argv[])
|
|||||||
for( size_t i = 0; i < numDevices; i++ ) {
|
for( size_t i = 0; i < numDevices; i++ ) {
|
||||||
log_info( "\nTesting OpenGL 2.x\n" );
|
log_info( "\nTesting OpenGL 2.x\n" );
|
||||||
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
|
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
|
||||||
test_finish();
|
|
||||||
return -1;
|
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.
|
// At least one device supports CL-GL interop, so init the test.
|
||||||
if( glEnv->Init( &argc, (char **)argv, CL_TRUE ) ) {
|
if( glEnv->Init( &argc, (char **)argv, CL_TRUE ) ) {
|
||||||
log_error("Failed to initialize the GL environment for this test.\n");
|
log_error("Failed to initialize the GL environment for this test.\n");
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,7 +318,6 @@ int main(int argc, const char *argv[])
|
|||||||
sCurrentContext = glEnv->CreateCLContext();
|
sCurrentContext = glEnv->CreateCLContext();
|
||||||
if( sCurrentContext == NULL ) {
|
if( sCurrentContext == NULL ) {
|
||||||
log_error( "ERROR: Unable to obtain CL context from GL\n" );
|
log_error( "ERROR: Unable to obtain CL context from GL\n" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,19 +327,16 @@ int main(int argc, const char *argv[])
|
|||||||
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices);
|
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices);
|
||||||
if( error != CL_SUCCESS ) {
|
if( error != CL_SUCCESS ) {
|
||||||
print_error( error, "Unable to get device count from context" );
|
print_error( error, "Unable to get device count from context" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
deviceIDs = (cl_device_id *)malloc(numDevices);
|
deviceIDs = (cl_device_id *)malloc(numDevices);
|
||||||
if (deviceIDs == NULL) {
|
if (deviceIDs == NULL) {
|
||||||
print_error( error, "malloc failed" );
|
print_error( error, "malloc failed" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, numDevices, deviceIDs, NULL);
|
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, numDevices, deviceIDs, NULL);
|
||||||
if( error != CL_SUCCESS ) {
|
if( error != CL_SUCCESS ) {
|
||||||
print_error( error, "Unable to get device list from context" );
|
print_error( error, "Unable to get device list from context" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -360,7 +344,6 @@ int main(int argc, const char *argv[])
|
|||||||
|
|
||||||
if (numDevices < 1) {
|
if (numDevices < 1) {
|
||||||
log_error("No devices found.\n");
|
log_error("No devices found.\n");
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +354,6 @@ int main(int argc, const char *argv[])
|
|||||||
for( size_t i = 0; i < numDevices; i++ ) {
|
for( size_t i = 0; i < numDevices; i++ ) {
|
||||||
log_info( "\nTesting OpenGL 3.2\n" );
|
log_info( "\nTesting OpenGL 3.2\n" );
|
||||||
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
|
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -669,7 +669,6 @@ int test_fence_sync( cl_device_id device, cl_context context, cl_command_queue q
|
|||||||
if( err != CL_SUCCESS )
|
if( err != CL_SUCCESS )
|
||||||
{
|
{
|
||||||
print_error( err, "Unable to get device count from context" );
|
print_error( err, "Unable to get device count from context" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
vs_count = (GLint)device_cb / sizeof(cl_device_id);
|
vs_count = (GLint)device_cb / sizeof(cl_device_id);
|
||||||
|
|||||||
@@ -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( "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." );
|
log_info( "Use environment variables to specify desired device." );
|
||||||
|
|
||||||
test_finish();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,7 +134,6 @@ int main(int argc, const char *argv[])
|
|||||||
{
|
{
|
||||||
printf("Requested device type is CL_DEVICE_TYPE_CPU\n");
|
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");
|
log_info("Invalid CL device type. GL tests can only run on a GPU device.\n");
|
||||||
test_finish();
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}//for
|
}//for
|
||||||
@@ -157,12 +155,10 @@ int main(int argc, const char *argv[])
|
|||||||
int supported = glEnv->SupportsCLGLInterop( requestedDeviceType );
|
int supported = glEnv->SupportsCLGLInterop( requestedDeviceType );
|
||||||
if( supported == 0 ) {
|
if( supported == 0 ) {
|
||||||
log_info("Test not run because GL-CL interop is not supported for any devices of the requested type.\n");
|
log_info("Test not run because GL-CL interop is not supported for any devices of the requested type.\n");
|
||||||
test_finish();
|
|
||||||
error = 0;
|
error = 0;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else if ( supported == -1 ) {
|
} else if ( supported == -1 ) {
|
||||||
log_error("Failed to determine if CL-GL interop is supported.\n");
|
log_error("Failed to determine if CL-GL interop is supported.\n");
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
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.
|
// At least one device supports CL-GL interop, so init the test.
|
||||||
if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) {
|
if( glEnv->Init( &argc, (char **)argv, CL_FALSE ) ) {
|
||||||
log_error("Failed to initialize the GL environment for this test.\n");
|
log_error("Failed to initialize the GL environment for this test.\n");
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -183,7 +178,6 @@ int main(int argc, const char *argv[])
|
|||||||
if( sCurrentContext == NULL )
|
if( sCurrentContext == NULL )
|
||||||
{
|
{
|
||||||
log_error( "ERROR: Unable to obtain CL context from GL\n" );
|
log_error( "ERROR: Unable to obtain CL context from GL\n" );
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -195,7 +189,6 @@ int main(int argc, const char *argv[])
|
|||||||
if( error != CL_SUCCESS )
|
if( error != CL_SUCCESS )
|
||||||
{
|
{
|
||||||
print_error( error, "Unable to get device count from context" );
|
print_error( error, "Unable to get device count from context" );
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -203,7 +196,6 @@ int main(int argc, const char *argv[])
|
|||||||
|
|
||||||
if (numDevices < 1) {
|
if (numDevices < 1) {
|
||||||
log_error("No devices found.\n");
|
log_error("No devices found.\n");
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -211,7 +203,6 @@ int main(int argc, const char *argv[])
|
|||||||
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL);
|
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL);
|
||||||
if( error != CL_SUCCESS ) {
|
if( error != CL_SUCCESS ) {
|
||||||
print_error( error, "Unable to get device list from context" );
|
print_error( error, "Unable to get device list from context" );
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -222,7 +213,6 @@ int main(int argc, const char *argv[])
|
|||||||
for( size_t i = 0; i < numDevices; i++ ) {
|
for( size_t i = 0; i < numDevices; i++ ) {
|
||||||
log_info( "\nTesting OpenGL 2.x\n" );
|
log_info( "\nTesting OpenGL 2.x\n" );
|
||||||
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
|
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
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.
|
// At least one device supports CL-GL interop, so init the test.
|
||||||
if( glEnv->Init( &argc, (char **)argv, CL_TRUE ) ) {
|
if( glEnv->Init( &argc, (char **)argv, CL_TRUE ) ) {
|
||||||
log_error("Failed to initialize the GL environment for this test.\n");
|
log_error("Failed to initialize the GL environment for this test.\n");
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -295,7 +284,6 @@ int main(int argc, const char *argv[])
|
|||||||
sCurrentContext = glEnv->CreateCLContext();
|
sCurrentContext = glEnv->CreateCLContext();
|
||||||
if( sCurrentContext == NULL ) {
|
if( sCurrentContext == NULL ) {
|
||||||
log_error( "ERROR: Unable to obtain CL context from GL\n" );
|
log_error( "ERROR: Unable to obtain CL context from GL\n" );
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -306,7 +294,6 @@ int main(int argc, const char *argv[])
|
|||||||
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices);
|
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, 0, NULL, &numDevices);
|
||||||
if( error != CL_SUCCESS ) {
|
if( error != CL_SUCCESS ) {
|
||||||
print_error( error, "Unable to get device count from context" );
|
print_error( error, "Unable to get device count from context" );
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -314,7 +301,6 @@ int main(int argc, const char *argv[])
|
|||||||
|
|
||||||
if (numDevices < 1) {
|
if (numDevices < 1) {
|
||||||
log_error("No devices found.\n");
|
log_error("No devices found.\n");
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -322,7 +308,6 @@ int main(int argc, const char *argv[])
|
|||||||
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL);
|
error = clGetContextInfo( sCurrentContext, CL_CONTEXT_DEVICES, sizeof( deviceIDs ), deviceIDs, NULL);
|
||||||
if( error != CL_SUCCESS ) {
|
if( error != CL_SUCCESS ) {
|
||||||
print_error( error, "Unable to get device list from context" );
|
print_error( error, "Unable to get device list from context" );
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
@@ -334,13 +319,11 @@ int main(int argc, const char *argv[])
|
|||||||
for( size_t i = 0; i < numDevices; i++ ) {
|
for( size_t i = 0; i < numDevices; i++ ) {
|
||||||
log_info( "\nTesting OpenGL 3.2\n" );
|
log_info( "\nTesting OpenGL 3.2\n" );
|
||||||
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
|
if( printDeviceHeader( deviceIDs[ i ] ) != CL_SUCCESS ) {
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
#ifdef GL_ES_VERSION_2_0
|
#ifdef GL_ES_VERSION_2_0
|
||||||
log_info("Cannot test OpenGL 3.2! This test was built for OpenGL ES 2.0\n");
|
log_info("Cannot test OpenGL 3.2! This test was built for OpenGL ES 2.0\n");
|
||||||
test_finish();
|
|
||||||
error = -1;
|
error = -1;
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
#else
|
#else
|
||||||
|
|||||||
@@ -95,7 +95,6 @@ int main (int argc, const char **argv )
|
|||||||
argc = parseCustomParam(argc, argv);
|
argc = parseCustomParam(argc, argv);
|
||||||
if (argc == -1)
|
if (argc == -1)
|
||||||
{
|
{
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ int main(int argc, const char *argv[])
|
|||||||
argc = parseCustomParam(argc, argv);
|
argc = parseCustomParam(argc, argv);
|
||||||
if (argc == -1)
|
if (argc == -1)
|
||||||
{
|
{
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -280,7 +280,6 @@ int main(int argc, const char *argv[])
|
|||||||
argc = parseCustomParam(argc, argv);
|
argc = parseCustomParam(argc, argv);
|
||||||
if (argc == -1)
|
if (argc == -1)
|
||||||
{
|
{
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,18 +81,7 @@ extern cl_device_fp_config gDoubleCapabilities;
|
|||||||
#define LOWER_IS_BETTER 0
|
#define LOWER_IS_BETTER 0
|
||||||
#define HIGHER_IS_BETTER 1
|
#define HIGHER_IS_BETTER 1
|
||||||
|
|
||||||
#if USE_ATF
|
#include "harness/errorHelpers.h"
|
||||||
|
|
||||||
#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
|
|
||||||
|
|
||||||
#if defined (_MSC_VER )
|
#if defined (_MSC_VER )
|
||||||
//Deal with missing scalbn on windows
|
//Deal with missing scalbn on windows
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ static void ReleaseCL( void );
|
|||||||
static int InitILogbConstants( void );
|
static int InitILogbConstants( void );
|
||||||
static int IsTininessDetectedBeforeRounding( void );
|
static int IsTininessDetectedBeforeRounding( void );
|
||||||
static int IsInRTZMode( void ); //expensive. Please check gIsInRTZMode global instead.
|
static int IsInRTZMode( void ); //expensive. Please check gIsInRTZMode global instead.
|
||||||
static void TestFinishAtExit(void);
|
|
||||||
|
|
||||||
|
|
||||||
int doTest( const char* name )
|
int doTest( const char* name )
|
||||||
@@ -816,7 +815,6 @@ int main (int argc, const char * argv[])
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
atexit(TestFinishAtExit);
|
|
||||||
|
|
||||||
#if defined( __APPLE__ )
|
#if defined( __APPLE__ )
|
||||||
struct timeval startTime;
|
struct timeval startTime;
|
||||||
@@ -1993,7 +1991,3 @@ cl_uint RoundUpToNextPowerOfTwo( cl_uint x )
|
|||||||
return x+x;
|
return x+x;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestFinishAtExit(void) {
|
|
||||||
test_finish();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -1033,7 +1033,6 @@ test_status InitCL( cl_device_id device )
|
|||||||
err = check_opencl_version(device,1,2);
|
err = check_opencl_version(device,1,2);
|
||||||
if( err != CL_SUCCESS ) {
|
if( err != CL_SUCCESS ) {
|
||||||
print_missing_feature(err,"printf");
|
print_missing_feature(err,"printf");
|
||||||
test_finish();
|
|
||||||
return TEST_FAIL;
|
return TEST_FAIL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,21 +29,6 @@
|
|||||||
#include <CL/cl_platform.h>
|
#include <CL/cl_platform.h>
|
||||||
#endif
|
#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
|
#define ANALYSIS_BUFFER_SIZE 256
|
||||||
|
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
|
|||||||
@@ -58,8 +58,6 @@ static int doTest(cl_command_queue queue, cl_context context,
|
|||||||
|
|
||||||
static void printUsage( void );
|
static void printUsage( void );
|
||||||
|
|
||||||
static void TestFinishAtExit(void);
|
|
||||||
|
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
// Definitions and initializations
|
// Definitions and initializations
|
||||||
//-----------------------------------------
|
//-----------------------------------------
|
||||||
@@ -579,7 +577,6 @@ const int test_num = ARRAY_SIZE( test_list );
|
|||||||
int main(int argc, const char* argv[])
|
int main(int argc, const char* argv[])
|
||||||
{
|
{
|
||||||
test_start();
|
test_start();
|
||||||
atexit(TestFinishAtExit);
|
|
||||||
|
|
||||||
argc = parseCustomParam(argc, argv);
|
argc = parseCustomParam(argc, argv);
|
||||||
if (argc == -1)
|
if (argc == -1)
|
||||||
@@ -666,7 +663,3 @@ static void printUsage( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void TestFinishAtExit(void)
|
|
||||||
{
|
|
||||||
test_finish();
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -27,22 +27,6 @@
|
|||||||
#include <CL/opencl.h>
|
#include <CL/opencl.h>
|
||||||
#endif
|
#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)
|
// Defines the set of types we support (no support for double)
|
||||||
typedef enum {
|
typedef enum {
|
||||||
kuchar = 0,
|
kuchar = 0,
|
||||||
|
|||||||
@@ -14,6 +14,7 @@
|
|||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
#include "harness/compat.h"
|
#include "harness/compat.h"
|
||||||
|
#include "harness/errorHelpers.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "test_select.h"
|
#include "test_select.h"
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ int test_step_internal(cl_device_id deviceID, cl_context context, cl_command_que
|
|||||||
if (err)
|
if (err)
|
||||||
{
|
{
|
||||||
print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" );
|
print_error(err, "clGetDeviceInfo for CL_DEVICE_PROFILE failed\n" );
|
||||||
test_finish();
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE");
|
gIsEmbedded = NULL != strstr(profile, "EMBEDDED_PROFILE");
|
||||||
|
|||||||
Reference in New Issue
Block a user