diff --git a/test_conformance/math_brute_force/binary_two_results_i_double.cpp b/test_conformance/math_brute_force/binary_two_results_i_double.cpp index ee1a8442..f3a5088d 100644 --- a/test_conformance/math_brute_force/binary_two_results_i_double.cpp +++ b/test_conformance/math_brute_force/binary_two_results_i_double.cpp @@ -37,9 +37,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -49,7 +51,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -92,7 +95,7 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; int64_t maxError2 = 0; int ftz = f->ftz || gForceFTZ; @@ -496,11 +499,5 @@ int TestFunc_DoubleI_Double_Double(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/binary_two_results_i_float.cpp b/test_conformance/math_brute_force/binary_two_results_i_float.cpp index db6393d6..3bff093d 100644 --- a/test_conformance/math_brute_force/binary_two_results_i_float.cpp +++ b/test_conformance/math_brute_force/binary_two_results_i_float.cpp @@ -37,9 +37,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -49,7 +51,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -93,7 +96,7 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); int64_t maxError2 = 0; @@ -481,11 +484,5 @@ int TestFunc_FloatI_Float_Float(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/i_unary_double.cpp b/test_conformance/math_brute_force/i_unary_double.cpp index 5d10cdb2..4c6545a2 100644 --- a/test_conformance/math_brute_force/i_unary_double.cpp +++ b/test_conformance/math_brute_force/i_unary_double.cpp @@ -35,9 +35,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -47,7 +49,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -57,7 +60,7 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; int ftz = f->ftz || gForceFTZ; uint64_t step = getTestStep(sizeof(cl_double), BUFFER_SIZE); int scale = @@ -228,11 +231,5 @@ int TestFunc_Int_Double(const Func *f, MTdata d, bool relaxedMode) exit: RestoreFPState(&oldMode); - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/i_unary_float.cpp b/test_conformance/math_brute_force/i_unary_float.cpp index af49a137..ffae1321 100644 --- a/test_conformance/math_brute_force/i_unary_float.cpp +++ b/test_conformance/math_brute_force/i_unary_float.cpp @@ -35,9 +35,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -47,7 +49,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -57,7 +60,7 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); uint64_t step = getTestStep(sizeof(float), BUFFER_SIZE); int scale = (int)((1ULL << 32) / (16 * BUFFER_SIZE / sizeof(float)) + 1); @@ -226,11 +229,5 @@ int TestFunc_Int_Float(const Func *f, MTdata d, bool relaxedMode) exit: RestoreFPState(&oldMode); - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/mad_double.cpp b/test_conformance/math_brute_force/mad_double.cpp index 8d8fec52..589eda9e 100644 --- a/test_conformance/math_brute_force/mad_double.cpp +++ b/test_conformance/math_brute_force/mad_double.cpp @@ -35,9 +35,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -47,7 +49,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -57,7 +60,7 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; double maxErrorVal = 0.0f; double maxErrorVal2 = 0.0f; @@ -213,11 +216,5 @@ int TestFunc_mad_Double(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/mad_float.cpp b/test_conformance/math_brute_force/mad_float.cpp index 04ac5aa6..513f20dc 100644 --- a/test_conformance/math_brute_force/mad_float.cpp +++ b/test_conformance/math_brute_force/mad_float.cpp @@ -35,9 +35,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -47,7 +49,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -60,7 +63,7 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; float maxErrorVal = 0.0f; float maxErrorVal2 = 0.0f; @@ -214,11 +217,5 @@ int TestFunc_mad_Float(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/ternary_double.cpp b/test_conformance/math_brute_force/ternary_double.cpp index b5f1ab09..cf88b526 100644 --- a/test_conformance/math_brute_force/ternary_double.cpp +++ b/test_conformance/math_brute_force/ternary_double.cpp @@ -39,9 +39,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -51,7 +53,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -134,7 +137,7 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; int ftz = f->ftz || gForceFTZ; double maxErrorVal = 0.0f; @@ -654,11 +657,5 @@ int TestFunc_Double_Double_Double_Double(const Func *f, MTdata d, vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/ternary_float.cpp b/test_conformance/math_brute_force/ternary_float.cpp index cf361841..949fc488 100644 --- a/test_conformance/math_brute_force/ternary_float.cpp +++ b/test_conformance/math_brute_force/ternary_float.cpp @@ -39,9 +39,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -51,7 +53,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -146,7 +149,7 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) logFunctionInfo(f->name, sizeof(cl_float), relaxedMode); Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); float maxErrorVal = 0.0f; @@ -790,11 +793,5 @@ int TestFunc_Float_Float_Float_Float(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/unary_two_results_double.cpp b/test_conformance/math_brute_force/unary_two_results_double.cpp index 3c37c18c..9cb0269f 100644 --- a/test_conformance/math_brute_force/unary_two_results_double.cpp +++ b/test_conformance/math_brute_force/unary_two_results_double.cpp @@ -36,9 +36,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -48,7 +50,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -58,7 +61,7 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError0 = 0.0f; float maxError1 = 0.0f; int ftz = f->ftz || gForceFTZ; @@ -366,11 +369,5 @@ int TestFunc_Double2_Double(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/unary_two_results_float.cpp b/test_conformance/math_brute_force/unary_two_results_float.cpp index 2550c0e9..fd7b0e68 100644 --- a/test_conformance/math_brute_force/unary_two_results_float.cpp +++ b/test_conformance/math_brute_force/unary_two_results_float.cpp @@ -36,9 +36,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -48,7 +50,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -58,7 +61,7 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError0 = 0.0f; float maxError1 = 0.0f; int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); @@ -500,11 +503,5 @@ int TestFunc_Float2_Float(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/unary_two_results_i_double.cpp b/test_conformance/math_brute_force/unary_two_results_i_double.cpp index c8db7dbf..54c8b213 100644 --- a/test_conformance/math_brute_force/unary_two_results_i_double.cpp +++ b/test_conformance/math_brute_force/unary_two_results_i_double.cpp @@ -37,9 +37,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -49,7 +51,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -65,7 +68,7 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; int64_t maxError2 = 0; int ftz = f->ftz || gForceFTZ; @@ -338,11 +341,5 @@ int TestFunc_DoubleI_Double(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/unary_two_results_i_float.cpp b/test_conformance/math_brute_force/unary_two_results_i_float.cpp index f3191c18..8f7307d9 100644 --- a/test_conformance/math_brute_force/unary_two_results_i_float.cpp +++ b/test_conformance/math_brute_force/unary_two_results_i_float.cpp @@ -37,9 +37,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -49,7 +51,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -65,7 +68,7 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; int64_t maxError2 = 0; int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); @@ -338,11 +341,5 @@ int TestFunc_FloatI_Float(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/unary_u_double.cpp b/test_conformance/math_brute_force/unary_u_double.cpp index 98dad66f..625556f7 100644 --- a/test_conformance/math_brute_force/unary_u_double.cpp +++ b/test_conformance/math_brute_force/unary_u_double.cpp @@ -35,9 +35,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -47,7 +49,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -62,7 +65,7 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; int ftz = f->ftz || gForceFTZ; double maxErrorVal = 0.0f; @@ -238,11 +241,5 @@ int TestFunc_Double_ULong(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; } diff --git a/test_conformance/math_brute_force/unary_u_float.cpp b/test_conformance/math_brute_force/unary_u_float.cpp index 0a2533f9..5bc9e9ff 100644 --- a/test_conformance/math_brute_force/unary_u_float.cpp +++ b/test_conformance/math_brute_force/unary_u_float.cpp @@ -35,9 +35,11 @@ int BuildKernel(const char *name, int vectorSize, cl_kernel *k, cl_program *p, relaxedMode); } +using Kernels = std::array; + struct BuildKernelInfo2 { - cl_kernel *kernels; + Kernels &kernels; Programs &programs; const char *nameInCode; bool relaxedMode; // Whether to build with -cl-fast-relaxed-math. @@ -47,7 +49,8 @@ cl_int BuildKernelFn(cl_uint job_id, cl_uint thread_id UNUSED, void *p) { BuildKernelInfo2 *info = (BuildKernelInfo2 *)p; cl_uint vectorSize = gMinVectorSizeIndex + job_id; - return BuildKernel(info->nameInCode, vectorSize, info->kernels + vectorSize, + return BuildKernel(info->nameInCode, vectorSize, + &(info->kernels[vectorSize]), &(info->programs[vectorSize]), info->relaxedMode); } @@ -57,7 +60,7 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) { int error; Programs programs; - cl_kernel kernels[VECTOR_SIZE_COUNT]; + Kernels kernels; float maxError = 0.0f; int ftz = f->ftz || gForceFTZ || 0 == (CL_FP_DENORM & gFloatCapabilities); float maxErrorVal = 0.0f; @@ -243,11 +246,5 @@ int TestFunc_Float_UInt(const Func *f, MTdata d, bool relaxedMode) vlog("\n"); exit: - // Release - for (auto k = gMinVectorSizeIndex; k < gMaxVectorSizeIndex; k++) - { - clReleaseKernel(kernels[k]); - } - return error; }