mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Enhancement: Thread dimensions user parameters (#1384)
* Fix format in the test scope * Add user params to limit testing Add parameters to reduce amount of testing. Helpful for debugging or for machines with lower performance. * Restore default value * Print info only if testing params bigger than 0.
This commit is contained in:
committed by
GitHub
parent
b041ec0a9a
commit
05ba82ad9a
@@ -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,25 +19,74 @@
|
||||
#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 ),
|
||||
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 );
|
||||
const int test_num = ARRAY_SIZE(test_list);
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
int delArg = 0;
|
||||
for (auto i = 0; i < argc; i++)
|
||||
{
|
||||
delArg = 0;
|
||||
|
||||
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
|
||||
{
|
||||
log_info("Thread dimensions options:\n");
|
||||
log_info("\t-n\tMaximum thread dimension value\n");
|
||||
log_info("\t-b\tSpecifies a buffer size for calculations\n");
|
||||
log_info("\t-x\tSpecifies a step for calculations\n");
|
||||
}
|
||||
if (strcmp(argv[i], "-n") == 0)
|
||||
{
|
||||
delArg++;
|
||||
if (atoi(argv[i + 1]) < 1)
|
||||
{
|
||||
log_info("ERROR: -n Maximum thread dimension value must be "
|
||||
"greater than 0");
|
||||
return TEST_FAIL;
|
||||
}
|
||||
maxThreadDimension = atoi(argv[i + 1]);
|
||||
delArg++;
|
||||
}
|
||||
if (strcmp(argv[i], "-b") == 0)
|
||||
{
|
||||
delArg++;
|
||||
if (atoi(argv[i + 1]) < 1)
|
||||
{
|
||||
log_info("ERROR: -b Buffer size must be greater than 0");
|
||||
return TEST_FAIL;
|
||||
}
|
||||
bufferSize = atoi(argv[i + 1]);
|
||||
delArg++;
|
||||
}
|
||||
if (strcmp(argv[i], "-x") == 0)
|
||||
{
|
||||
delArg++;
|
||||
if (atoi(argv[i + 1]) < 1)
|
||||
{
|
||||
log_info("ERROR: -x Buffer step must be greater than 0");
|
||||
return TEST_FAIL;
|
||||
}
|
||||
bufferStep = atoi(argv[i + 1]);
|
||||
delArg++;
|
||||
}
|
||||
for (int j = i; j < argc - delArg; j++) argv[j] = argv[j + delArg];
|
||||
argc -= delArg;
|
||||
i -= delArg;
|
||||
}
|
||||
|
||||
return runTestHarness(argc, argv, test_num, test_list, false, 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
|
||||
@@ -21,17 +21,52 @@
|
||||
|
||||
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);
|
||||
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);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user