mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Migrate device_execution suite to the new test registration framework (#2323)
Contributes to #2181. Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
@@ -20,7 +20,6 @@
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/typeWrappers.h"
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
|
||||
static const cl_uint MIN_DEVICE_PREFFERED_QUEUE_SIZE = 16 * 1024;
|
||||
@@ -29,7 +28,7 @@ static const cl_uint MAX_DEVICE_EMBEDDED_QUEUE_SIZE = 64 * 1024;
|
||||
|
||||
#ifdef CL_VERSION_2_0
|
||||
|
||||
int test_device_info(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(device_info)
|
||||
{
|
||||
cl_int err_ret;
|
||||
int embedded = 0;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
|
||||
static int check_device_queue(cl_device_id device, cl_context context, cl_command_queue queue, cl_uint size)
|
||||
@@ -97,7 +96,7 @@ static int check_device_queues(cl_device_id device, cl_context context, cl_uint
|
||||
return res;
|
||||
}
|
||||
|
||||
int test_device_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(device_queue)
|
||||
{
|
||||
cl_int err_ret, res = 0;
|
||||
size_t ret_len;
|
||||
@@ -187,4 +186,3 @@ int test_device_queue(cl_device_id device, cl_context context, cl_command_queue
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -595,7 +594,7 @@ static int check_kernel_results(cl_int* results, cl_int len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int test_enqueue_block(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(enqueue_block)
|
||||
{
|
||||
cl_uint i;
|
||||
cl_int n, err_ret, res = 0;
|
||||
@@ -660,7 +659,6 @@ int test_enqueue_block(cl_device_id device, cl_context context, cl_command_queue
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -671,7 +670,7 @@ static const kernel_src sources_enqueue_block_flags[] =
|
||||
static const size_t num_enqueue_block_flags = arr_size(sources_enqueue_block_flags);
|
||||
|
||||
|
||||
int test_enqueue_flags(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(enqueue_flags)
|
||||
{
|
||||
cl_uint i;
|
||||
cl_int err_ret, res = 0;
|
||||
@@ -759,5 +758,4 @@ int test_enqueue_flags(cl_device_id device, cl_context context, cl_command_queue
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -95,7 +94,7 @@ static int check_kernel_results(cl_int* results, cl_int len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int test_enqueue_multi_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(enqueue_multi_queue)
|
||||
{
|
||||
cl_uint i;
|
||||
cl_int k, err_ret, res = 0;
|
||||
@@ -196,7 +195,6 @@ int test_enqueue_multi_queue(cl_device_id device, cl_context context, cl_command
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -609,7 +608,7 @@ static int check_kernel_results(cl_int* results, cl_int len, std::vector<cl_uint
|
||||
return -1;
|
||||
}
|
||||
|
||||
int test_enqueue_ndrange(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(enqueue_ndrange)
|
||||
{
|
||||
MTdata d;
|
||||
cl_uint i;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -43,8 +42,7 @@ static const char* enqueue_multi_level = R"(
|
||||
block_fn(res, level);
|
||||
})";
|
||||
|
||||
int test_enqueue_profiling(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(enqueue_profiling)
|
||||
{
|
||||
cl_int err_ret, res = 0;
|
||||
clCommandQueueWrapper dev_queue;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -1637,7 +1636,7 @@ static const kernel_src_check sources_enqueue_wg_size[] =
|
||||
{ KERNEL(enqueue_mix_wg_size_all_diff), check_all_diff_mix }
|
||||
};
|
||||
|
||||
int test_enqueue_wg_size(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(enqueue_wg_size)
|
||||
{
|
||||
MTdata d;
|
||||
cl_uint i, k;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -1010,7 +1009,7 @@ static int check_kernel_results(cl_int* results, cl_int len)
|
||||
return -1;
|
||||
}
|
||||
|
||||
int test_execute_block(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(execute_block)
|
||||
{
|
||||
size_t i;
|
||||
size_t ret_len;
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -129,7 +128,7 @@ static const kernel_src sources_multi_queue_block[] =
|
||||
static const size_t num_kernels_multi_queue_block = arr_size(sources_multi_queue_block);
|
||||
|
||||
|
||||
int test_host_multi_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(host_multi_queue)
|
||||
{
|
||||
cl_uint i;
|
||||
cl_int err_ret, res = 0;
|
||||
@@ -228,7 +227,5 @@ int test_host_multi_queue(cl_device_id device, cl_context context, cl_command_qu
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -90,7 +89,7 @@ static int check_kernel_results(cl_int* results, cl_int len)
|
||||
/*
|
||||
Test checks kernel block execution order in case of two different kernels with enqueue block submitted to one ordered host queue.
|
||||
*/
|
||||
int test_host_queue_order(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(host_queue_order)
|
||||
{
|
||||
cl_int k, err_ret, res = 0;
|
||||
clCommandQueueWrapper dev_queue;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "harness/testHarness.h"
|
||||
#include "harness/parseParameters.h"
|
||||
#include "utils.h"
|
||||
#include "procs.h"
|
||||
|
||||
std::string gKernelName;
|
||||
int gWimpyMode = 0;
|
||||
@@ -57,17 +56,6 @@ test_status InitCL(cl_device_id device) {
|
||||
return TEST_PASS;
|
||||
}
|
||||
|
||||
test_definition test_list[] = {
|
||||
ADD_TEST(device_info), ADD_TEST(device_queue),
|
||||
ADD_TEST(execute_block), ADD_TEST(enqueue_block),
|
||||
ADD_TEST(enqueue_nested_blocks), ADD_TEST(enqueue_wg_size),
|
||||
ADD_TEST(enqueue_flags), ADD_TEST(enqueue_multi_queue),
|
||||
ADD_TEST(host_multi_queue), ADD_TEST(enqueue_ndrange),
|
||||
ADD_TEST(host_queue_order), ADD_TEST(enqueue_profiling),
|
||||
};
|
||||
|
||||
const int test_num = ARRAY_SIZE( test_list );
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
argc = parseCustomParam(argc, argv);
|
||||
@@ -98,5 +86,7 @@ int main(int argc, const char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
return runTestHarnessWithCheck(argc, argv, test_num, test_list, false, 0, InitCL);
|
||||
return runTestHarnessWithCheck(
|
||||
argc, argv, test_registry::getInstance().num_tests(),
|
||||
test_registry::getInstance().definitions(), false, 0, InitCL);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,6 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "procs.h"
|
||||
#include "utils.h"
|
||||
#include <time.h>
|
||||
|
||||
@@ -303,7 +302,7 @@ static const kernel_src_check sources_nested_blocks[] =
|
||||
{ KERNEL(enqueue_nested_blocks_all_diff), check_all_diff }
|
||||
};
|
||||
|
||||
int test_enqueue_nested_blocks(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements)
|
||||
REGISTER_TEST(enqueue_nested_blocks)
|
||||
{
|
||||
cl_uint i, k;
|
||||
cl_int err_ret, res = 0;
|
||||
|
||||
@@ -1,34 +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/testHarness.h"
|
||||
|
||||
extern int test_device_info(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_device_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_execute_block(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_enqueue_block(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_enqueue_nested_blocks(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_enqueue_wg_size(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_enqueue_flags(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_enqueue_multi_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_host_multi_queue(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_enqueue_ndrange(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_host_queue_order(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
extern int test_enqueue_profiling(cl_device_id device, cl_context context,
|
||||
cl_command_queue queue, int num_elements);
|
||||
|
||||
extern int test_execution_stress(cl_device_id device, cl_context context, cl_command_queue queue, int num_elements);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user