Use clCommandQueueWrapper in math_brute_force (#1463)

Simplify code by avoiding manual resource management.

This commit only modifies tests that use one queue per thread.  The
other unmodified tests are single-threaded and use the global
`gQueue`.

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:
Sven van Haastregt
2022-08-24 10:31:32 +01:00
committed by GitHub
parent 9666ca3c70
commit c82dabd4bb
12 changed files with 36 additions and 24 deletions

View File

@@ -131,7 +131,9 @@ struct ThreadInfo
double maxErrorValue2; // position of the max error value (param 2). Init
// to 0.
MTdata d;
cl_command_queue tQueue; // per thread command queue to improve performance
// Per thread command queue to improve performance
clCommandQueueWrapper tQueue;
};
struct TestInfo
@@ -952,7 +954,6 @@ exit:
clReleaseMemObject(threadInfo.inBuf2);
for (auto j = gMinVectorSizeIndex; j < gMaxVectorSizeIndex; j++)
clReleaseMemObject(threadInfo.outBuf[j]);
clReleaseCommandQueue(threadInfo.tQueue);
}
return error;