Fixes issue #497 - Image tests from master branch on OCL 1.2 device (#501)

* Fixes issue #497 - Image tests from master branch on OCL 1.2 device

* Fixes issue #497 - use get_device_cl_version
This commit is contained in:
Grzegorz Wawiorko
2019-12-20 12:30:03 +01:00
committed by Kévin Petit
parent 841123040e
commit daafdac555
27 changed files with 109 additions and 69 deletions

View File

@@ -1,6 +1,6 @@
//
// Copyright (c) 2017 The Khronos Group Inc.
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -44,6 +44,7 @@ bool gTestMaxImages;
bool gTestRounding;
bool gTestImage2DFromBuffer;
bool gTestMipmaps;
bool gDeviceLt20 = false;
cl_filter_mode gFilterModeToUse = (cl_filter_mode)-1;
// Default is CL_MEM_USE_HOST_PTR for the test
cl_mem_flags gMemFlagsToUse = CL_MEM_USE_HOST_PTR;
@@ -118,6 +119,10 @@ static int doTest( cl_device_id device, cl_context context, cl_command_queue que
bool tDisableOffsets = false;
bool tNormalizedModeToUse = false;
cl_filter_mode tFilterModeToUse = (cl_filter_mode)-1;
auto version = get_device_cl_version(device);
if (version < Version(2, 0)) {
gDeviceLt20 = true;
}
if( testTypesToRun & kReadTests )
{
@@ -174,6 +179,13 @@ static int doTest( cl_device_id device, cl_context context, cl_command_queue que
}
}
if (testTypesToRun & kReadWriteTests) {
if (gDeviceLt20) {
log_info("TEST skipped, Opencl 2.0 + requried for this test");
return ret;
}
}
if( ( testTypesToRun & kReadWriteTests ) && !gTestMipmaps )
{
gtestTypesToRun = kReadWriteTests;