Tidy up BuildKernelInfo (#1461)

Remove the `offset` field from both structures, because it was always
set to the global `gMinVectorSizeIndex`.

Improve documentation and rename some variables:
 - `i` becomes `vectorSize`;
 - `kernel_count` becomes `threadCount`.

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-04 15:03:52 +01:00
committed by GitHub
parent c44b5b6ae3
commit c12bff46c6
27 changed files with 164 additions and 183 deletions

View File

@@ -113,10 +113,10 @@ int BuildKernel(const char *name, int vectorSize, cl_uint kernel_count,
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->relaxedMode);
cl_uint vectorSize = gMinVectorSizeIndex + job_id;
return BuildKernel(info->nameInCode, vectorSize, info->threadCount,
info->kernels[vectorSize].data(),
&(info->programs[vectorSize]), info->relaxedMode);
}
// Thread specific data for a worker thread
@@ -898,10 +898,9 @@ int TestFunc_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode)
// Init the kernels
{
BuildKernelInfo build_info = {
gMinVectorSizeIndex, test_info.threadCount, test_info.k,
test_info.programs, f->nameInCode, relaxedMode
};
BuildKernelInfo build_info{ test_info.threadCount, test_info.k,
test_info.programs, f->nameInCode,
relaxedMode };
if ((error = ThreadPool_Do(BuildKernelFn,
gMaxVectorSizeIndex - gMinVectorSizeIndex,
&build_info)))