| 231 | } |
| 232 | |
| 233 | void ClScaleKernel::run_op(ITensorPack &tensors, const Window &window, cl::CommandQueue &queue) |
| 234 | { |
| 235 | ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); |
| 236 | ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(ICLKernel::window(), window); |
| 237 | |
| 238 | auto src = utils::cast::polymorphic_downcast<const ICLTensor *>(tensors.get_const_tensor(TensorType::ACL_SRC)); |
| 239 | auto dst = utils::cast::polymorphic_downcast<ICLTensor *>(tensors.get_tensor(TensorType::ACL_DST)); |
| 240 | |
| 241 | switch (_data_layout) |
| 242 | { |
| 243 | case DataLayout::NCHW: |
| 244 | { |
| 245 | Window slice = window.first_slice_window_2D(); |
| 246 | |
| 247 | do |
| 248 | { |
| 249 | unsigned int idx = 0; |
| 250 | add_2D_tensor_argument(idx, src, slice); |
| 251 | add_2D_tensor_argument(idx, dst, slice); |
| 252 | enqueue(queue, *this, slice, lws_hint()); |
| 253 | } while (window.slide_window_slice_2D(slice)); |
| 254 | break; |
| 255 | } |
| 256 | case DataLayout::NHWC: |
| 257 | { |
| 258 | Window collapsed = window.collapse(ICLKernel::window(), Window::DimZ); |
| 259 | Window slice = collapsed.first_slice_window_4D(); |
| 260 | |
| 261 | unsigned int idx = 0; |
| 262 | add_4d_tensor_nhwc_argument(idx, src); |
| 263 | add_4d_tensor_nhwc_argument(idx, dst); |
| 264 | enqueue(queue, *this, slice, lws_hint()); |
| 265 | break; |
| 266 | } |
| 267 | default: |
| 268 | ARM_COMPUTE_ERROR("Data layout not supported"); |
| 269 | } |
| 270 | } |
| 271 | } // namespace kernels |
| 272 | } // namespace opencl |
| 273 | } // namespace arm_compute |
nothing calls this directly
no test coverage detected