mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Use clProgramWrapper in math_brute_force (#1451)
Simplify code by avoiding manual resource management. This allows removing clReleaseProgram from `MakeKernels` to reduce behavioral differences between `MakeKernels` and `MakeKernel`. Original patch by Marco Antognini. Signed-off-by: Marco Antognini <marco.antognini@arm.com> Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com>
This commit is contained in:
committed by
GitHub
parent
2cf24e63b7
commit
0a5a8f90c9
@@ -117,7 +117,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -127,7 +127,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -150,7 +150,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -791,7 +793,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -115,7 +115,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -125,7 +125,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -148,7 +148,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -948,7 +950,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -116,7 +116,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -126,7 +126,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -713,7 +715,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -114,7 +114,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -124,7 +124,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -706,7 +708,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -116,7 +116,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *operator_symbol;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -126,7 +126,7 @@ 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 BuildKernel(info->operator_symbol, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -149,7 +149,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -758,7 +760,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -114,7 +114,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *operator_symbol;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -124,7 +124,7 @@ 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 BuildKernel(info->operator_symbol, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -147,7 +147,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -885,7 +887,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -121,7 +122,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -131,7 +132,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
struct ComputeReferenceInfoD
|
||||
@@ -172,7 +173,7 @@ cl_int ReferenceD(cl_uint jid, cl_uint tid, void *userInfo)
|
||||
int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
int64_t maxError2 = 0;
|
||||
@@ -577,7 +578,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -119,7 +120,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -129,7 +130,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
struct ComputeReferenceInfoF
|
||||
@@ -171,7 +172,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode)
|
||||
|
||||
logFunctionInfo(f->name, sizeof(cl_float), relaxedMode);
|
||||
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities);
|
||||
@@ -562,7 +563,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#ifndef COMMON_H
|
||||
#define COMMON_H
|
||||
|
||||
#include "harness/typeWrappers.h"
|
||||
#include "utility.h"
|
||||
|
||||
#include <array>
|
||||
@@ -24,4 +25,7 @@
|
||||
// Array of thread-specific kernels for each vector size.
|
||||
using KernelMatrix = std::array<std::vector<cl_kernel>, VECTOR_SIZE_COUNT>;
|
||||
|
||||
// Array of programs for each vector size.
|
||||
using Programs = std::array<clProgramWrapper, VECTOR_SIZE_COUNT>;
|
||||
|
||||
#endif /* COMMON_H */
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -106,7 +107,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -116,7 +117,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -124,7 +125,7 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p)
|
||||
int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
int ftz = f->ftz || gForceFTZ;
|
||||
uint64_t step = getTestStep(sizeof(cl_double), BUFFER_SIZE);
|
||||
@@ -299,7 +300,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -104,7 +105,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -114,7 +115,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -122,7 +123,7 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p)
|
||||
int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities);
|
||||
uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE);
|
||||
@@ -295,7 +296,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -115,7 +115,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -125,7 +125,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -703,7 +705,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -113,7 +113,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -123,7 +123,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -141,7 +141,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -692,7 +694,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -109,7 +109,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -119,7 +119,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -476,7 +478,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -108,7 +108,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -118,7 +118,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -490,7 +492,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -119,7 +120,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -129,7 +130,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -137,7 +138,7 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p)
|
||||
int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
double maxErrorVal = 0.0f;
|
||||
@@ -298,7 +299,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -117,7 +118,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -127,7 +128,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -138,7 +139,7 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode)
|
||||
|
||||
logFunctionInfo(f->name, sizeof(cl_float), relaxedMode);
|
||||
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
float maxErrorVal = 0.0f;
|
||||
@@ -297,7 +298,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -1092,7 +1092,6 @@ int MakeKernels(const char **c, cl_uint count, const char *name,
|
||||
clGetProgramBuildInfo(*p, gDevice, CL_PROGRAM_BUILD_LOG,
|
||||
sizeof(buffer), buffer, NULL);
|
||||
vlog_error("Log: %s\n", buffer);
|
||||
clReleaseProgram(*p);
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -122,7 +123,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -132,7 +133,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
// A table of more difficult cases to get right
|
||||
@@ -213,7 +214,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d,
|
||||
bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
int ftz = f->ftz || gForceFTZ;
|
||||
@@ -737,7 +738,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -120,7 +121,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -130,7 +131,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
// A table of more difficult cases to get right
|
||||
@@ -223,7 +224,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode)
|
||||
|
||||
logFunctionInfo(f->name, sizeof(cl_float), relaxedMode);
|
||||
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities);
|
||||
@@ -872,7 +873,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -109,7 +109,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -119,7 +119,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -514,7 +516,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -107,7 +107,7 @@ struct BuildKernelInfo
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_uint kernel_count;
|
||||
KernelMatrix &kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -117,7 +117,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernel_count,
|
||||
info->kernels[i].data(), info->programs + i,
|
||||
info->kernels[i].data(), &(info->programs[i]),
|
||||
info->relaxedMode);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,9 @@ struct TestInfo
|
||||
{
|
||||
size_t subBufferSize; // Size of the sub-buffer in elements
|
||||
const Func *f; // A pointer to the function info
|
||||
cl_program programs[VECTOR_SIZE_COUNT]; // programs for various vector sizes
|
||||
|
||||
// Programs for various vector sizes.
|
||||
Programs programs;
|
||||
|
||||
// Thread-specific kernels for each vector size:
|
||||
// k[vector_size][thread_id]
|
||||
@@ -691,7 +693,6 @@ exit:
|
||||
// Release
|
||||
for (auto i = gMinVectorSizeIndex; i < gMaxVectorSizeIndex; i++)
|
||||
{
|
||||
clReleaseProgram(test_info.programs[i]);
|
||||
for (auto &kernel : test_info.k[i])
|
||||
{
|
||||
clReleaseKernel(kernel);
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -113,7 +114,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -123,7 +124,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -131,7 +132,7 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p)
|
||||
int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError0 = 0.0f;
|
||||
float maxError1 = 0.0f;
|
||||
@@ -443,7 +444,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -111,7 +112,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -121,7 +122,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -129,7 +130,7 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p)
|
||||
int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError0 = 0.0f;
|
||||
float maxError1 = 0.0f;
|
||||
@@ -575,7 +576,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -114,7 +115,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -124,7 +125,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
cl_ulong abs_cl_long(cl_long i)
|
||||
@@ -138,7 +139,7 @@ cl_ulong abs_cl_long(cl_long i)
|
||||
int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
int64_t maxError2 = 0;
|
||||
@@ -415,7 +416,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -112,7 +113,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -122,7 +123,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
cl_ulong abs_cl_long(cl_long i)
|
||||
@@ -136,7 +137,7 @@ cl_ulong abs_cl_long(cl_long i)
|
||||
int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
int64_t maxError2 = 0;
|
||||
@@ -413,7 +414,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -108,7 +109,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -118,7 +119,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
cl_ulong random64(MTdata d)
|
||||
@@ -131,7 +132,7 @@ cl_ulong random64(MTdata d)
|
||||
int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
int ftz = f->ftz || gForceFTZ;
|
||||
@@ -311,7 +312,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
#include "common.h"
|
||||
#include "function_list.h"
|
||||
#include "test_functions.h"
|
||||
#include "utility.h"
|
||||
@@ -105,7 +106,7 @@ struct BuildKernelInfo
|
||||
{
|
||||
cl_uint offset; // the first vector size to build
|
||||
cl_kernel *kernels;
|
||||
cl_program *programs;
|
||||
Programs &programs;
|
||||
const char *nameInCode;
|
||||
bool relaxedMode; // Whether to build with -cl-fast-relaxed-math.
|
||||
};
|
||||
@@ -115,7 +116,7 @@ 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 BuildKernel(info->nameInCode, i, info->kernels + i,
|
||||
info->programs + i, info->relaxedMode);
|
||||
&(info->programs[i]), info->relaxedMode);
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
@@ -123,7 +124,7 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p)
|
||||
int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode)
|
||||
{
|
||||
int error;
|
||||
cl_program programs[VECTOR_SIZE_COUNT];
|
||||
Programs programs;
|
||||
cl_kernel kernels[VECTOR_SIZE_COUNT];
|
||||
float maxError = 0.0f;
|
||||
int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities);
|
||||
@@ -313,7 +314,6 @@ exit:
|
||||
for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++)
|
||||
{
|
||||
clReleaseKernel(kernels[k]);
|
||||
clReleaseProgram(programs[k]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user