mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
Use clMemWrapper in math_brute_force (#1476)
Simplify code by avoiding manual resource management. Original patch by Marco Antognini. Signed-off-by: Marco Antognini <marco.antognini@arm.com> Signed-off-by: Sven van Haastregt <sven.vanhaastregt@arm.com> 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
8f5a2f0ae8
commit
f94c135755
@@ -122,9 +122,11 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p)
|
||||
// Thread specific data for a worker thread
|
||||
struct ThreadInfo
|
||||
{
|
||||
cl_mem inBuf; // input buffer for the thread
|
||||
cl_mem inBuf2; // input buffer for the thread
|
||||
cl_mem outBuf[VECTOR_SIZE_COUNT]; // output buffers for the thread
|
||||
// Input and output buffers for the thread
|
||||
clMemWrapper inBuf;
|
||||
clMemWrapper inBuf2;
|
||||
Buffers outBuf;
|
||||
|
||||
float maxError; // max error value. Init to 0.
|
||||
double
|
||||
maxErrorValue; // position of the max error value (param 1). Init to 0.
|
||||
@@ -950,10 +952,6 @@ exit:
|
||||
for (auto &threadInfo : test_info.tinfo)
|
||||
{
|
||||
free_mtdata(threadInfo.d);
|
||||
clReleaseMemObject(threadInfo.inBuf);
|
||||
clReleaseMemObject(threadInfo.inBuf2);
|
||||
for (auto j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
|
||||
clReleaseMemObject(threadInfo.outBuf[j]);
|
||||
}
|
||||
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user