cl20: Add minimal required version functionality (#269)

This adds functionality to define minimal required version through the
ADD_TEST* macros. Tests that don't meet the version requirement will
be skipped.

By default the minimal required version is set to 1.0, subsequent
patches will set the appropriate version for each of the tests.

Signed-off-by: Radek Szymanski <radek.szymanski@arm.com>
This commit is contained in:
Radek Szymanski
2019-05-22 18:31:53 +01:00
committed by Kévin Petit
parent 27e666eb88
commit 0fce6d5d62
6 changed files with 152 additions and 9 deletions

View File

@@ -16,6 +16,8 @@
#ifndef _errorHelpers_h
#define _errorHelpers_h
#include <sstream>
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
@@ -93,6 +95,19 @@ extern "C" {
#define test_failure_warning_ret(errCode, expectedErrCode, msg, retValue) { if( errCode != expectedErrCode ) { print_failure_warning( errCode, expectedErrCode, msg ); warnings++ ; } }
#define print_failure_warning(errCode, expectedErrCode, msg) log_error( "WARNING: %s! (Got %s, expected %s from %s:%d)\n", msg, IGetErrorString( errCode ), IGetErrorString( expectedErrCode ), __FILE__, __LINE__ );
#define ASSERT_SUCCESS(expr, msg) \
do \
{ \
cl_int _temp_retval = (expr); \
if (_temp_retval != CL_SUCCESS) \
{ \
std::stringstream ss; \
ss << "ERROR: " << msg << "=" << IGetErrorString(_temp_retval) \
<< " at " << __FILE__ << ":" << __LINE__ << "\n"; \
throw std::runtime_error(ss.str()); \
} \
} while (0)
extern const char *IGetErrorString( int clErrorCode );
extern float Ulp_Error_Half( cl_ushort test, float reference );