Migrate non_uniform_work_group suite to the new test registration framework (#2317)

Contributes to #2181

Signed-off-by: Kévin Petit <kpet@free.fr>
This commit is contained in:
Kévin Petit
2025-03-11 21:48:14 +00:00
committed by GitHub
parent 132ba21a3c
commit 13b82d1833
8 changed files with 24 additions and 89 deletions

View File

@@ -16,7 +16,6 @@
#ifndef TESTNONUNIFORMWORKGROUP_H
#define TESTNONUNIFORMWORKGROUP_H
#include "procs.h"
#include <vector>
#include "tools.h"
#include <algorithm>

View File

@@ -13,31 +13,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "procs.h"
#include "tools.h"
#include "harness/testHarness.h"
#include "TestNonUniformWorkGroup.h"
test_definition test_list[] = {
ADD_TEST( non_uniform_1d_basic ),
ADD_TEST( non_uniform_1d_atomics ),
ADD_TEST( non_uniform_1d_barriers ),
ADD_TEST( non_uniform_2d_basic ),
ADD_TEST( non_uniform_2d_atomics ),
ADD_TEST( non_uniform_2d_barriers ),
ADD_TEST( non_uniform_3d_basic ),
ADD_TEST( non_uniform_3d_atomics ),
ADD_TEST( non_uniform_3d_barriers ),
ADD_TEST( non_uniform_other_basic ),
ADD_TEST( non_uniform_other_atomics ),
ADD_TEST( non_uniform_other_barriers ),
};
const int test_num = ARRAY_SIZE( test_list );
test_status InitCL(cl_device_id device) {
auto version = get_device_cl_version(device);
auto expected_min_version = Version(2, 0);
@@ -69,6 +48,9 @@ int main(int argc, const char *argv[])
PrimeNumbers::generatePrimeNumbers(100000);
return runTestHarnessWithCheck(static_cast<int>(programArgs.size()), &programArgs.front(), test_num, test_list, false, false, InitCL);
return runTestHarnessWithCheck(
static_cast<int>(programArgs.size()), &programArgs.front(),
test_registry::getInstance().num_tests(),
test_registry::getInstance().definitions(), false, false, InitCL);
}

View File

@@ -1,32 +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/typeWrappers.h"
extern int test_non_uniform_1d_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_1d_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_1d_barriers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_2d_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_2d_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_2d_barriers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_3d_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_3d_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_3d_barriers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_other_basic(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_other_atomics(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);
extern int test_non_uniform_other_barriers(cl_device_id deviceID, cl_context context, cl_command_queue queue, int num_elements);

View File

@@ -13,13 +13,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "procs.h"
#include "tools.h"
#include "TestNonUniformWorkGroup.h"
int
test_non_uniform_2d_basic(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_2d_basic)
{
SubTestExecutor exec(device, context, queue);
@@ -140,8 +138,7 @@ int
return exec.status();
}
int
test_non_uniform_2d_atomics(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_2d_atomics)
{
SubTestExecutor exec(device, context, queue);
@@ -262,8 +259,7 @@ int
return exec.status();
}
int
test_non_uniform_2d_barriers(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_2d_barriers)
{
SubTestExecutor exec(device, context, queue);

View File

@@ -13,13 +13,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "procs.h"
#include "tools.h"
#include "TestNonUniformWorkGroup.h"
int
test_non_uniform_3d_basic(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_3d_basic)
{
SubTestExecutor exec(device, context, queue);
@@ -148,8 +146,7 @@ int
return exec.status();
}
int
test_non_uniform_3d_atomics(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_3d_atomics)
{
SubTestExecutor exec(device, context, queue);
@@ -278,8 +275,7 @@ int
return exec.status();
}
int
test_non_uniform_3d_barriers(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_3d_barriers)
{
SubTestExecutor exec(device, context, queue);

View File

@@ -13,13 +13,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "procs.h"
#include "tools.h"
#include "TestNonUniformWorkGroup.h"
int
test_non_uniform_other_basic(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_other_basic)
{
SubTestExecutor exec(device, context, queue);
@@ -105,8 +103,7 @@ int
return exec.status();
}
int
test_non_uniform_other_atomics(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_other_atomics)
{
SubTestExecutor exec(device, context, queue);
@@ -190,8 +187,7 @@ int
return exec.status();
}
int
test_non_uniform_other_barriers(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_other_barriers)
{
SubTestExecutor exec(device, context, queue);

View File

@@ -13,13 +13,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
#include "procs.h"
#include "tools.h"
#include "TestNonUniformWorkGroup.h"
int
test_non_uniform_1d_basic(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_1d_basic)
{
SubTestExecutor exec(device, context, queue);
@@ -144,8 +142,7 @@ int
return exec.status();
}
int
test_non_uniform_1d_atomics(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_1d_atomics)
{
SubTestExecutor exec(device, context, queue);
@@ -270,8 +267,7 @@ int
return exec.status();
}
int
test_non_uniform_1d_barriers(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
REGISTER_TEST(non_uniform_1d_barriers)
{
SubTestExecutor exec(device, context, queue);

View File

@@ -16,7 +16,9 @@
#ifndef TOOLS_H
#define TOOLS_H
#include "procs.h"
#include "harness/testHarness.h"
#include "harness/typeWrappers.h"
#include <vector>
#include <map>
#include <string>