mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
* 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:
committed by
Kévin Petit
parent
841123040e
commit
daafdac555
@@ -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 @@ cl_channel_type gChannelTypeToUse = (cl_channel_type)-1;
|
||||
cl_channel_order gChannelOrderToUse = (cl_channel_order)-1;
|
||||
bool gEnablePitch = false;
|
||||
cl_device_type gDeviceType = CL_DEVICE_TYPE_DEFAULT;
|
||||
bool gDeviceLt20 = false;
|
||||
|
||||
#define MAX_ALLOWED_STD_DEVIATION_IN_MB 8.0
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -25,7 +25,7 @@
|
||||
#define MAX_ERR 0.005f
|
||||
#define MAX_HALF_LINEAR_ERR 0.3f
|
||||
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding;
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gDeviceLt20;
|
||||
extern cl_device_type gDeviceType;
|
||||
extern bool gTestReadWrite;
|
||||
|
||||
@@ -261,7 +261,7 @@ int test_read_image_set_2D( cl_device_id device, cl_context context, cl_command_
|
||||
}
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" );
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" );
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
if ( gTestSmallImages )
|
||||
|
||||
@@ -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
|
||||
@@ -20,6 +20,7 @@ extern cl_channel_type gChannelTypeToUse;
|
||||
extern cl_channel_order gChannelOrderToUse;
|
||||
|
||||
extern bool gDebugTrace;
|
||||
extern bool gDeviceLt20;
|
||||
|
||||
extern bool gTestReadWrite;
|
||||
|
||||
@@ -209,6 +210,15 @@ int test_image_set( cl_device_id device, cl_context context, cl_command_queue qu
|
||||
cl_image_format *formatList;
|
||||
bool *filterFlags;
|
||||
unsigned int numFormats;
|
||||
auto version = get_device_cl_version(device);
|
||||
if (version < Version(2, 0)) {
|
||||
gDeviceLt20 = true;
|
||||
}
|
||||
|
||||
if (gDeviceLt20 && gTestReadWrite) {
|
||||
log_info("TEST skipped, Opencl 2.0 + requried for this test");
|
||||
return ret;
|
||||
}
|
||||
|
||||
// This flag is only for querying the list of supported formats
|
||||
// The flag for creating image will be set explicitly in test functions
|
||||
|
||||
@@ -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
|
||||
@@ -25,7 +25,7 @@
|
||||
#define MAX_ERR 0.005f
|
||||
#define MAX_HALF_LINEAR_ERR 0.3f
|
||||
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding;
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gDeviceLt20;
|
||||
extern cl_device_type gDeviceType;
|
||||
extern bool gTestReadWrite;
|
||||
|
||||
@@ -259,7 +259,7 @@ int test_read_image_set_1D( cl_device_id device, cl_context context, cl_command_
|
||||
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" );
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" );
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
if ( gTestSmallImages )
|
||||
|
||||
@@ -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
|
||||
@@ -25,7 +25,7 @@
|
||||
#define MAX_ERR 0.005f
|
||||
#define MAX_HALF_LINEAR_ERR 0.3f
|
||||
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding;
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gDeviceLt20;
|
||||
extern cl_device_type gDeviceType;
|
||||
extern bool gTestReadWrite;
|
||||
|
||||
@@ -256,7 +256,7 @@ int test_read_image_set_1D_array( cl_device_id device, cl_context context, cl_co
|
||||
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" );
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" );
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
if ( gTestSmallImages )
|
||||
|
||||
@@ -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
|
||||
@@ -25,7 +25,7 @@
|
||||
#define MAX_ERR 0.005f
|
||||
#define MAX_HALF_LINEAR_ERR 0.3f
|
||||
|
||||
extern bool gDebugTrace, gTestSmallImages, gTestMaxImages, gTestRounding;
|
||||
extern bool gDebugTrace, gTestSmallImages, gTestMaxImages, gTestRounding, gDeviceLt20;
|
||||
extern cl_device_type gDeviceType;
|
||||
|
||||
#define MAX_TRIES 1
|
||||
@@ -256,7 +256,7 @@ int test_read_image_set_1D_buffer( cl_device_id device, cl_context context, cl_c
|
||||
readFormat );
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" );
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" );
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
if ( gTestSmallImages )
|
||||
|
||||
@@ -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
|
||||
@@ -19,7 +19,7 @@
|
||||
#define MAX_ERR 0.005f
|
||||
#define MAX_HALF_LINEAR_ERR 0.3f
|
||||
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding;
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gDeviceLt20;
|
||||
extern cl_device_type gDeviceType;
|
||||
extern bool gTestReadWrite;
|
||||
|
||||
@@ -245,7 +245,7 @@ int test_read_image_set_2D_array( cl_device_id device, cl_context context, cl_co
|
||||
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" );
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" );
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -19,7 +19,7 @@
|
||||
#define MAX_ERR 0.005f
|
||||
#define MAX_HALF_LINEAR_ERR 0.3f
|
||||
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding;
|
||||
extern bool gDebugTrace, gTestSmallImages, gEnablePitch, gTestMaxImages, gTestRounding, gDeviceLt20;
|
||||
extern cl_device_type gDeviceType;
|
||||
extern bool gTestReadWrite;
|
||||
|
||||
@@ -248,7 +248,7 @@ int test_read_image_set_3D( cl_device_id device, cl_context context, cl_command_
|
||||
|
||||
|
||||
ptr = programSrc;
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", "-cl-std=CL2.0" );
|
||||
error = create_single_kernel_helper_with_build_options( context, &program, &kernel, 1, &ptr, "sample_kernel", gDeviceLt20 ? "" : "-cl-std=CL2.0" );
|
||||
test_error( error, "Unable to create testing kernel" );
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user