mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Accept OpenCL 3.0 in version parsing code and use where appropriate (#752)
* Accept OpenCL 3.0 in version parsing code and use where appropriate There were a number of tests against 2.2 that are clearer against 3.0. Fixes #751 Signed-off-by: Kévin Petit <kpet@free.fr> * Remove CL_EXPERIMENTAL guards Signed-off-by: Kévin Petit <kpet@free.fr> * formatting * Configure the headers for OpenCL 3.0 * more format fixes
This commit is contained in:
@@ -16,7 +16,7 @@ else(CMAKE_BUILD_TYPE STREQUAL "release")
|
||||
set (BUILD_FLAVOR "debug")
|
||||
endif(CMAKE_BUILD_TYPE STREQUAL "release")
|
||||
|
||||
add_definitions(-DCL_TARGET_OPENCL_VERSION=220)
|
||||
add_definitions(-DCL_TARGET_OPENCL_VERSION=300)
|
||||
add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_1_APIS=1)
|
||||
add_definitions(-DCL_USE_DEPRECATED_OPENCL_2_0_APIS=1)
|
||||
add_definitions(-DCL_USE_DEPRECATED_OPENCL_1_2_APIS=1)
|
||||
|
||||
@@ -885,6 +885,8 @@ Version get_device_cl_version(cl_device_id device)
|
||||
return Version(2, 1);
|
||||
else if (strstr(str.data(), "OpenCL 2.2") != NULL)
|
||||
return Version(2, 2);
|
||||
else if (strstr(str.data(), "OpenCL 3.0") != NULL)
|
||||
return Version(3, 0);
|
||||
|
||||
throw std::runtime_error(std::string("Unknown OpenCL version: ") + str.data());
|
||||
}
|
||||
|
||||
@@ -294,7 +294,8 @@ test_status InitCL(cl_device_id device) {
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
if ((svm_caps == 0) && (version > Version(2,2))) {
|
||||
if ((svm_caps == 0) && (version >= Version(3, 0)))
|
||||
{
|
||||
return TEST_SKIP;
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ test_status InitCL(cl_device_id device) {
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
if ((max_queues_size == 0) && (version > Version(2,2))) {
|
||||
if ((max_queues_size == 0) && (version >= Version(3, 0)))
|
||||
{
|
||||
return TEST_SKIP;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ test_status InitCL(cl_device_id device) {
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
if ((timer_res == 0) && (version > Version(2,2)))
|
||||
if ((timer_res == 0) && (version >= Version(3, 0)))
|
||||
{
|
||||
return TEST_SKIP;
|
||||
}
|
||||
|
||||
@@ -958,7 +958,8 @@ int test_generic_ptr_to_host_mem_svm(cl_device_id deviceID, cl_context context,
|
||||
cl_int error = clGetDeviceInfo(deviceID, CL_DEVICE_SVM_CAPABILITIES, sizeof(caps), &caps, NULL);
|
||||
test_error(error, "clGetDeviceInfo(CL_DEVICE_SVM_CAPABILITIES) failed");
|
||||
|
||||
if ((version < expected_min_version) || (version > Version(2,2) && caps == 0))
|
||||
if ((version < expected_min_version)
|
||||
|| (version >= Version(3, 0) && caps == 0))
|
||||
return TEST_SKIPPED_ITSELF;
|
||||
|
||||
if (caps & CL_DEVICE_SVM_COARSE_GRAIN_BUFFER) {
|
||||
|
||||
@@ -79,8 +79,7 @@ test_status InitCL(cl_device_id device) {
|
||||
return TEST_SKIP;
|
||||
}
|
||||
|
||||
#ifdef CL_EXPERIMENTAL
|
||||
if (version > Version(2,2))
|
||||
if (version >= Version(3, 0))
|
||||
{
|
||||
cl_int error;
|
||||
cl_bool support_generic;
|
||||
@@ -98,7 +97,6 @@ test_status InitCL(cl_device_id device) {
|
||||
return TEST_SKIP;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,8 @@ test_status InitCL(cl_device_id device) {
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
if ((max_packet_size == 0) && (version > Version(2,2))) {
|
||||
if ((max_packet_size == 0) && (version >= Version(3, 0)))
|
||||
{
|
||||
return TEST_SKIP;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,8 @@ static test_status InitCL(cl_device_id device) {
|
||||
|
||||
auto version = get_device_cl_version(device);
|
||||
test_status ret = TEST_PASS;
|
||||
if (version > Version(2, 2)) {
|
||||
if (version >= Version(3, 0))
|
||||
{
|
||||
cl_uint max_sub_groups;
|
||||
int error;
|
||||
|
||||
@@ -76,7 +77,9 @@ static test_status InitCL(cl_device_id device) {
|
||||
if (max_sub_groups == 0) {
|
||||
ret = TEST_SKIP;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = checkSubGroupsExtension(device);
|
||||
}
|
||||
return ret;
|
||||
|
||||
@@ -50,24 +50,27 @@ test_status InitCL(cl_device_id device) {
|
||||
version_expected_info("Test", expected_min_version.to_string().c_str(), version.to_string().c_str());
|
||||
return TEST_SKIP;
|
||||
}
|
||||
#ifdef CL_EXPERIMENTAL
|
||||
|
||||
if(version > Version(2,2)) {
|
||||
if (version >= Version(3, 0))
|
||||
{
|
||||
int error;
|
||||
cl_bool isSupported;
|
||||
error = clGetDeviceInfo(device,
|
||||
CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT,
|
||||
error = clGetDeviceInfo(
|
||||
device, CL_DEVICE_WORK_GROUP_COLLECTIVE_FUNCTIONS_SUPPORT,
|
||||
sizeof(isSupported), &isSupported, NULL);
|
||||
if (error != CL_SUCCESS) {
|
||||
print_error(error, "Unable to query support for collective functions");
|
||||
if (error != CL_SUCCESS)
|
||||
{
|
||||
print_error(error,
|
||||
"Unable to query support for collective functions");
|
||||
return TEST_FAIL;
|
||||
}
|
||||
|
||||
if (isSupported == CL_FALSE) {
|
||||
if (isSupported == CL_FALSE)
|
||||
{
|
||||
return TEST_SKIP;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user