mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-26 00:39:03 +00:00
Make it possible to run kernel_read_write on a 1.x implementation (#615)
Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
@@ -2,6 +2,7 @@ set(MODULE_NAME IMAGE_STREAMS)
|
|||||||
|
|
||||||
set(${MODULE_NAME}_SOURCES
|
set(${MODULE_NAME}_SOURCES
|
||||||
main.cpp
|
main.cpp
|
||||||
|
test_common.cpp
|
||||||
test_iterations.cpp
|
test_iterations.cpp
|
||||||
test_loops.cpp
|
test_loops.cpp
|
||||||
test_read_1D.cpp
|
test_read_1D.cpp
|
||||||
|
|||||||
19
test_conformance/images/kernel_read_write/test_common.cpp
Normal file
19
test_conformance/images/kernel_read_write/test_common.cpp
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
|
||||||
|
#include "test_common.h"
|
||||||
|
|
||||||
|
cl_sampler create_sampler(cl_context context, image_sampler_data *sdata, bool test_mipmaps, cl_int *error) {
|
||||||
|
cl_sampler sampler = nullptr;
|
||||||
|
if (test_mipmaps) {
|
||||||
|
cl_sampler_properties properties[] = {
|
||||||
|
CL_SAMPLER_NORMALIZED_COORDS, sdata->normalized_coords,
|
||||||
|
CL_SAMPLER_ADDRESSING_MODE, sdata->addressing_mode,
|
||||||
|
CL_SAMPLER_FILTER_MODE, sdata->filter_mode,
|
||||||
|
CL_SAMPLER_MIP_FILTER_MODE, sdata->filter_mode,
|
||||||
|
0};
|
||||||
|
sampler = clCreateSamplerWithProperties(context, properties, error);
|
||||||
|
} else {
|
||||||
|
sampler = clCreateSampler(context, sdata->normalized_coords, sdata->addressing_mode, sdata->filter_mode, error);
|
||||||
|
}
|
||||||
|
return sampler;
|
||||||
|
}
|
||||||
|
|
||||||
5
test_conformance/images/kernel_read_write/test_common.h
Normal file
5
test_conformance/images/kernel_read_write/test_common.h
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
#include "../testBase.h"
|
||||||
|
|
||||||
|
extern cl_sampler create_sampler(cl_context context, image_sampler_data *sdata, bool test_mipmaps, cl_int *error);
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
#include "../testBase.h"
|
#include "test_common.h"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
#if defined( __APPLE__ )
|
#if defined( __APPLE__ )
|
||||||
@@ -1407,16 +1407,7 @@ int test_read_image_2D( cl_context context, cl_command_queue queue, cl_kernel ke
|
|||||||
test_error( error, "Unable to create result buffer" );
|
test_error( error, "Unable to create result buffer" );
|
||||||
|
|
||||||
// Create sampler to use
|
// Create sampler to use
|
||||||
cl_sampler_properties properties[] = {
|
actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error);
|
||||||
CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords,
|
|
||||||
CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode,
|
|
||||||
CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode,
|
|
||||||
0, 0, 0 };
|
|
||||||
if (gTestMipmaps) {
|
|
||||||
properties[6] = CL_SAMPLER_MIP_FILTER_MODE;
|
|
||||||
properties[7] = imageSampler->filter_mode;
|
|
||||||
}
|
|
||||||
actualSampler = clCreateSamplerWithProperties(context, properties, &error );
|
|
||||||
test_error(error, "Unable to create image sampler");
|
test_error(error, "Unable to create image sampler");
|
||||||
|
|
||||||
// Set arguments
|
// Set arguments
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
#include "../testBase.h"
|
|
||||||
|
#include "test_common.h"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
#if defined( __APPLE__ )
|
#if defined( __APPLE__ )
|
||||||
@@ -401,16 +402,7 @@ int test_read_image_1D( cl_context context, cl_command_queue queue, cl_kernel ke
|
|||||||
test_error( error, "Unable to create result buffer" );
|
test_error( error, "Unable to create result buffer" );
|
||||||
|
|
||||||
// Create sampler to use
|
// Create sampler to use
|
||||||
cl_sampler_properties properties[] = {
|
actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error);
|
||||||
CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords,
|
|
||||||
CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode,
|
|
||||||
CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode,
|
|
||||||
0, 0, 0 };
|
|
||||||
if (gTestMipmaps) {
|
|
||||||
properties[6] = CL_SAMPLER_MIP_FILTER_MODE;
|
|
||||||
properties[7] = imageSampler->filter_mode;
|
|
||||||
}
|
|
||||||
actualSampler = clCreateSamplerWithProperties(context, properties, &error );
|
|
||||||
test_error(error, "Unable to create image sampler");
|
test_error(error, "Unable to create image sampler");
|
||||||
|
|
||||||
// Set arguments
|
// Set arguments
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
#include "../testBase.h"
|
#include "test_common.h"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
#if defined( __APPLE__ )
|
#if defined( __APPLE__ )
|
||||||
@@ -483,16 +483,7 @@ int test_read_image_1D_array( cl_context context, cl_command_queue queue, cl_ker
|
|||||||
test_error( error, "Unable to create result buffer" );
|
test_error( error, "Unable to create result buffer" );
|
||||||
|
|
||||||
// Create sampler to use
|
// Create sampler to use
|
||||||
cl_sampler_properties properties[] = {
|
actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error);
|
||||||
CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords,
|
|
||||||
CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode,
|
|
||||||
CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode,
|
|
||||||
0, 0, 0 };
|
|
||||||
if (gTestMipmaps) {
|
|
||||||
properties[6] = CL_SAMPLER_MIP_FILTER_MODE;
|
|
||||||
properties[7] = imageSampler->filter_mode;
|
|
||||||
}
|
|
||||||
actualSampler = clCreateSamplerWithProperties(context, properties, &error );
|
|
||||||
test_error(error, "Unable to create image sampler");
|
test_error(error, "Unable to create image sampler");
|
||||||
|
|
||||||
// Set arguments
|
// Set arguments
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
#include "../testBase.h"
|
#include "test_common.h"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
#define MAX_ERR 0.005f
|
#define MAX_ERR 0.005f
|
||||||
@@ -490,16 +490,7 @@ int test_read_image_2D_array( cl_context context, cl_command_queue queue, cl_ker
|
|||||||
test_error( error, "Unable to create result buffer" );
|
test_error( error, "Unable to create result buffer" );
|
||||||
|
|
||||||
// Create sampler to use
|
// Create sampler to use
|
||||||
cl_sampler_properties properties[] = {
|
actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error);
|
||||||
CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords,
|
|
||||||
CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode,
|
|
||||||
CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode,
|
|
||||||
0, 0, 0 };
|
|
||||||
if (gTestMipmaps) {
|
|
||||||
properties[6] = CL_SAMPLER_MIP_FILTER_MODE;
|
|
||||||
properties[7] = imageSampler->filter_mode;
|
|
||||||
}
|
|
||||||
actualSampler = clCreateSamplerWithProperties(context, properties, &error );
|
|
||||||
test_error(error, "Unable to create image sampler");
|
test_error(error, "Unable to create image sampler");
|
||||||
|
|
||||||
// Set arguments
|
// Set arguments
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
// See the License for the specific language governing permissions and
|
// See the License for the specific language governing permissions and
|
||||||
// limitations under the License.
|
// limitations under the License.
|
||||||
//
|
//
|
||||||
#include "../testBase.h"
|
#include "test_common.h"
|
||||||
#include <float.h>
|
#include <float.h>
|
||||||
|
|
||||||
#define MAX_ERR 0.005f
|
#define MAX_ERR 0.005f
|
||||||
@@ -499,16 +499,7 @@ int test_read_image_3D( cl_context context, cl_command_queue queue, cl_kernel ke
|
|||||||
test_error( error, "Unable to create result buffer" );
|
test_error( error, "Unable to create result buffer" );
|
||||||
|
|
||||||
// Create sampler to use
|
// Create sampler to use
|
||||||
cl_sampler_properties properties[] = {
|
actualSampler = create_sampler(context, imageSampler, gTestMipmaps, &error);
|
||||||
CL_SAMPLER_NORMALIZED_COORDS, imageSampler->normalized_coords,
|
|
||||||
CL_SAMPLER_ADDRESSING_MODE, imageSampler->addressing_mode,
|
|
||||||
CL_SAMPLER_FILTER_MODE, imageSampler->filter_mode,
|
|
||||||
0, 0, 0 };
|
|
||||||
if (gTestMipmaps) {
|
|
||||||
properties[6] = CL_SAMPLER_MIP_FILTER_MODE;
|
|
||||||
properties[7] = imageSampler->filter_mode;
|
|
||||||
}
|
|
||||||
actualSampler = clCreateSamplerWithProperties(context, properties, &error );
|
|
||||||
test_error(error, "Unable to create image sampler");
|
test_error(error, "Unable to create image sampler");
|
||||||
|
|
||||||
// Set arguments
|
// Set arguments
|
||||||
|
|||||||
Reference in New Issue
Block a user