mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-20 06:29:02 +00:00
Reduce differences by using common names (#1187)
Improve format. The binary_operator tests are left untouched by this commit as they require some non-automatic changes. Signed-off-by: Marco Antognini <marco.antognini@arm.com>
This commit is contained in:
@@ -24,9 +24,8 @@
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
static int BuildKernelDouble(const char *name, int vectorSize,
|
||||
cl_uint kernel_count, cl_kernel *k, cl_program *p,
|
||||
bool relaxedMode)
|
||||
static int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count,
|
||||
cl_kernel *k, cl_program *p, bool relaxedMode)
|
||||
{
|
||||
const char *c[] = { "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n",
|
||||
"__kernel void math_kernel",
|
||||
@@ -116,14 +115,12 @@ typedef struct BuildKernelInfo
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
} BuildKernelInfo;
|
||||
|
||||
static cl_int BuildKernel_DoubleFn(cl_uint job_id, cl_uint thread_id UNUSED,
|
||||
void *p)
|
||||
static cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p)
|
||||
{
|
||||
BuildKernelInfo *info = (BuildKernelInfo *)p;
|
||||
cl_uint i = info->offset + job_id;
|
||||
return BuildKernelDouble(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i], info->programs + i,
|
||||
info->relaxedMode);
|
||||
return BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i], info->programs + i, info->relaxedMode);
|
||||
}
|
||||
|
||||
// Thread specific data for a worker thread
|
||||
@@ -160,7 +157,7 @@ typedef struct TestInfo
|
||||
// otherwise.
|
||||
} TestInfo;
|
||||
|
||||
static cl_int TestDouble(cl_uint job_id, cl_uint thread_id, void *data);
|
||||
static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data);
|
||||
|
||||
int TestFunc_Double_Double(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
@@ -276,7 +273,7 @@ int TestFunc_Double_Double(const Func *f, MTdata d, bool relaxedMode)
|
||||
gMinVectorSizeIndex, test_info.threadCount, test_info.k,
|
||||
test_info.programs, f->nameInCode, relaxedMode
|
||||
};
|
||||
if ((error = ThreadPool_Do(BuildKernel_DoubleFn,
|
||||
if ((error = ThreadPool_Do(BuildKernelFn,
|
||||
gMaxVectorSizeIndex - gMinVectorSizeIndex,
|
||||
&build_info)))
|
||||
goto exit;
|
||||
@@ -285,7 +282,7 @@ int TestFunc_Double_Double(const Func *f, MTdata d, bool relaxedMode)
|
||||
// Run the kernels
|
||||
if (!gSkipCorrectnessTesting)
|
||||
{
|
||||
error = ThreadPool_Do(TestDouble, test_info.jobCount, &test_info);
|
||||
error = ThreadPool_Do(Test, test_info.jobCount, &test_info);
|
||||
|
||||
// Accumulate the arithmetic errors
|
||||
for (i = 0; i < test_info.threadCount; i++)
|
||||
@@ -424,7 +421,7 @@ exit:
|
||||
return error;
|
||||
}
|
||||
|
||||
static cl_int TestDouble(cl_uint job_id, cl_uint thread_id, void *data)
|
||||
static cl_int Test(cl_uint job_id, cl_uint thread_id, void *data)
|
||||
{
|
||||
const TestInfo *job = (const TestInfo *)data;
|
||||
size_t buffer_elements = job->subBufferSize;
|
||||
|
||||
Reference in New Issue
Block a user