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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user