API Feature Consistency Test, Part 2 (#912)

* added pipes test
clang-format fixes

* simplify diffs

* added pipes test
clang-format fixes

* simplify diffs

* add Program Scope Global Variables consistency test

* switched other checks to test_assert_error

* add non-uniform work group consistency test

* added read-write images consistency test

* add Creating 2D Images from Buffers consistency test

* add Device and Host Timer Synchronization consistency test

* add Intermediate Language Programs consistency test

* add Subgroups consistency test

* add Program Initialization and Clean-Up Kernels consistency test

* add 3D Image Writes consistency test

* clang-format fixes

* switch the check for 3D image writes extension for clarity

* add Depth Images consistency test

* update test for CL_QUEUE_SIZE, must return CL_INVALID_COMMAND_QUEUE

* formatting fixes

* fix copy-paste typo

* change expected error codes to CL_INVALID_OPERATION

* address review comments

* fix formatting

* address review feedback

Since pipes are cl_mems, We can spec and test that clGetPipeInfo
returns CL_INVALID_OPERATION when pipes are not supported by
passing a non-pipe memory object to the function.

* use the CTS framework to choose the OpenCL C version

* address review feedback
This commit is contained in:
Ben Ashbaugh
2020-09-08 09:24:09 -07:00
committed by GitHub
parent 6b1e61f9de
commit 75ce4c5b0e
7 changed files with 821 additions and 114 deletions

View File

@@ -45,7 +45,8 @@ static std::string get_device_info_string(cl_device_id device,
throw std::runtime_error("clGetDeviceInfo failed\n");
}
return std::string(info.begin(), info.end());
/* The returned string does not include the null terminator. */
return std::string(info.data(), size - 1);
}
/* Determines if an extension is supported by a device. */

View File

@@ -85,7 +85,13 @@ const char *IGetErrorString( int clErrorCode )
case CL_INVALID_IMAGE_DESCRIPTOR: return "CL_INVALID_IMAGE_DESCRIPTOR";
case CL_INVALID_COMPILER_OPTIONS: return "CL_INVALID_COMPILER_OPTIONS";
case CL_INVALID_LINKER_OPTIONS: return "CL_INVALID_LINKER_OPTIONS";
case CL_INVALID_DEVICE_PARTITION_COUNT: return "CL_INVALID_DEVICE_PARTITION_COUNT";
case CL_INVALID_DEVICE_PARTITION_COUNT:
return "CL_INVALID_DEVICE_PARTITION_COUNT";
case CL_INVALID_PIPE_SIZE: return "CL_INVALID_PIPE_SIZE";
case CL_INVALID_DEVICE_QUEUE: return "CL_INVALID_DEVICE_QUEUE";
case CL_INVALID_SPEC_ID: return "CL_INVALID_SPEC_ID";
case CL_MAX_SIZE_RESTRICTION_EXCEEDED:
return "CL_MAX_SIZE_RESTRICTION_EXCEEDED";
default: return "(unknown)";
}
}

View File

@@ -82,6 +82,21 @@
#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__ );
// generate an error when an assertion is false (not error code related)
#define test_assert_error(condition, msg) \
test_assert_error_ret(condition, msg, TEST_FAIL)
#define test_assert_error_ret(condition, msg, retValue) \
{ \
if (!(condition)) \
{ \
print_assertion_error(condition, msg); \
return retValue; \
} \
}
#define print_assertion_error(condition, msg) \
log_error("ERROR: %s! (!(%s) from %s:%d)\n", msg, #condition, __FILE__, \
__LINE__);
#define ASSERT_SUCCESS(expr, msg) \
do \
{ \