From 6c95c2dd574ebc3217c949a17016eb071935bc3b Mon Sep 17 00:00:00 2001 From: Georgios Pinitas Date: Mon, 20 Aug 2018 16:06:58 +0100 Subject: COMPMID-1188: Static tuning of CLScale Change-Id: Icf1cc00d9861fdb8766d0b8fd33ca90833863927 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/144830 Reviewed-by: Anthony Barbier Tested-by: Jenkins --- src/runtime/CL/tuners/BifrostTuner.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/runtime/CL/tuners/BifrostTuner.cpp') diff --git a/src/runtime/CL/tuners/BifrostTuner.cpp b/src/runtime/CL/tuners/BifrostTuner.cpp index fa67710cc8..2d52f3392e 100644 --- a/src/runtime/CL/tuners/BifrostTuner.cpp +++ b/src/runtime/CL/tuners/BifrostTuner.cpp @@ -249,6 +249,34 @@ void tune_pooling_kernel(CLPoolingLayerKernel &k) k.set_lws_hint(lws_hint); } + +void tune_scale_kernel(CLScaleKernel &k) +{ + cl::NDRange lws_hint = k.lws_hint(); + const GPUTarget gpu_target = k.get_target(); + const DataType dt = k.input()->info()->data_type(); + const InterpolationPolicy interpolation = k._interpolationPolicy; + + // Configure the local work size for Bifrost, interpolation (bilinear) and datatype F32. + // The value are obtained via exhaustive autotuning. + if(gpu_target_is_in(gpu_target, GPUTarget::G71, GPUTarget::G72) && (dt == DataType::F32) && (interpolation == InterpolationPolicy::BILINEAR)) + { + auto dim_0 = k.output()->info()->dimension(0); + if(dim_0 == 480) + { + lws_hint = cl::NDRange(2, 1); + } + else if(dim_0 == 3120) + { + lws_hint = cl::NDRange(2, 8); + } + else if(dim_0 == 4160) + { + lws_hint = cl::NDRange(4, 8); + } + k.set_lws_hint(lws_hint); + } +} } // namespace void BifrostTuner::tune_kernel_static(ICLKernel &kernel) @@ -281,6 +309,10 @@ void BifrostTuner::tune_kernel_static(ICLKernel &kernel) { tune_pooling_kernel(*utils::cast::polymorphic_downcast(&kernel)); } + else if(dynamic_cast(&kernel) != nullptr) + { + tune_scale_kernel(*utils::cast::polymorphic_downcast(&kernel)); + } } void BifrostTuner::tune_kernel_dynamic(ICLKernel &kernel) -- cgit v1.2.1