mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Migrate thread_dimensions suite to the new test registration framework (#2309)
Contributes to #2181 Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
@@ -14,27 +14,16 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
#include "harness/compat.h"
|
||||
#include "harness/testHarness.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "procs.h"
|
||||
|
||||
// Additional parameters to limit test scope (-n,-b,-x)
|
||||
cl_uint maxThreadDimension = 0;
|
||||
cl_uint bufferSize = 0;
|
||||
cl_uint bufferStep = 0;
|
||||
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST(quick_1d_explicit_local), ADD_TEST(quick_2d_explicit_local),
|
||||
ADD_TEST(quick_3d_explicit_local), ADD_TEST(quick_1d_implicit_local),
|
||||
ADD_TEST(quick_2d_implicit_local), ADD_TEST(quick_3d_implicit_local),
|
||||
ADD_TEST(full_1d_explicit_local), ADD_TEST(full_2d_explicit_local),
|
||||
ADD_TEST(full_3d_explicit_local), ADD_TEST(full_1d_implicit_local),
|
||||
ADD_TEST(full_2d_implicit_local), ADD_TEST(full_3d_implicit_local),
|
||||
};
|
||||
|
||||
const int test_num = ARRAY_SIZE(test_list);
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
int delArg = 0;
|
||||
@@ -88,5 +77,6 @@ int main(int argc, const char *argv[])
|
||||
i -= delArg;
|
||||
}
|
||||
|
||||
return runTestHarness(argc, argv, test_num, test_list, false, 0);
|
||||
return runTestHarness(argc, argv, test_registry::getInstance().num_tests(),
|
||||
test_registry::getInstance().definitions(), false, 0);
|
||||
}
|
||||
|
||||
@@ -1,72 +0,0 @@
|
||||
//
|
||||
// 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
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
//
|
||||
#include "harness/kernelHelpers.h"
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/errorHelpers.h"
|
||||
#include "harness/conversions.h"
|
||||
#include "harness/mt19937.h"
|
||||
|
||||
extern const int kVectorSizeCount;
|
||||
|
||||
extern int test_quick_1d_explicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_quick_2d_explicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_quick_3d_explicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_quick_1d_implicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_quick_2d_implicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_quick_3d_implicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
|
||||
extern int test_full_1d_explicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_full_2d_explicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_full_3d_explicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_full_1d_implicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_full_2d_implicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
extern int test_full_3d_implicit_local(cl_device_id deviceID,
|
||||
cl_context context,
|
||||
cl_command_queue queue,
|
||||
int num_elements);
|
||||
@@ -14,6 +14,11 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
#include "harness/compat.h"
|
||||
#include "harness/kernelHelpers.h"
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/errorHelpers.h"
|
||||
#include "harness/conversions.h"
|
||||
#include "harness/mt19937.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -22,8 +27,6 @@
|
||||
|
||||
#include <cinttypes>
|
||||
|
||||
#include "procs.h"
|
||||
|
||||
#define ITERATIONS 4
|
||||
#define DEBUG 0
|
||||
|
||||
@@ -1118,101 +1121,89 @@ int test_thread_dimensions(cl_device_id device, cl_context context,
|
||||
#define QUICK 1
|
||||
#define FULL 0
|
||||
|
||||
int test_quick_1d_explicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(quick_1d_explicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 1, 1,
|
||||
device, context, queue, 1, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 65536 * 512, QUICK, 4, 1);
|
||||
}
|
||||
|
||||
int test_quick_2d_explicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(quick_2d_explicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 2, 1,
|
||||
device, context, queue, 2, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 65536 / 4, QUICK, 16, 1);
|
||||
}
|
||||
|
||||
int test_quick_3d_explicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(quick_3d_explicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 3, 1,
|
||||
device, context, queue, 3, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 1024, QUICK, 32, 1);
|
||||
}
|
||||
|
||||
|
||||
int test_quick_1d_implicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(quick_1d_implicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 1, 1,
|
||||
device, context, queue, 1, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 65536 * 256, QUICK, 4, 0);
|
||||
}
|
||||
|
||||
int test_quick_2d_implicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(quick_2d_implicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 2, 1,
|
||||
device, context, queue, 2, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 65536 / 4, QUICK, 16, 0);
|
||||
}
|
||||
|
||||
int test_quick_3d_implicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(quick_3d_implicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 3, 1,
|
||||
device, context, queue, 3, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 1024, QUICK, 32, 0);
|
||||
}
|
||||
|
||||
|
||||
int test_full_1d_explicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(full_1d_explicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 1, 1,
|
||||
device, context, queue, 1, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 65536 * 512, FULL, 4, 1);
|
||||
}
|
||||
|
||||
int test_full_2d_explicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(full_2d_explicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 2, 1,
|
||||
device, context, queue, 2, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 65536 / 4, FULL, 16, 1);
|
||||
}
|
||||
|
||||
int test_full_3d_explicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(full_3d_explicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 3, 1,
|
||||
device, context, queue, 3, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 1024, FULL, 32, 1);
|
||||
}
|
||||
|
||||
|
||||
int test_full_1d_implicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(full_1d_implicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 1, 1,
|
||||
device, context, queue, 1, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 65536 * 256, FULL, 4, 0);
|
||||
}
|
||||
|
||||
int test_full_2d_implicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(full_2d_implicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 2, 1,
|
||||
device, context, queue, 2, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 65536 / 4, FULL, 16, 0);
|
||||
}
|
||||
|
||||
int test_full_3d_implicit_local(cl_device_id deviceID, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(full_3d_implicit_local)
|
||||
{
|
||||
return test_thread_dimensions(
|
||||
deviceID, context, queue, 3, 1,
|
||||
device, context, queue, 3, 1,
|
||||
maxThreadDimension ? maxThreadDimension : 1024, FULL, 32, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user