| 321 | } |
| 322 | } |
| 323 | Status CpuWinogradConv2d::validate(const ITensorInfo *src, |
| 324 | const ITensorInfo *weights, |
| 325 | const ITensorInfo *biases, |
| 326 | const ITensorInfo *dst, |
| 327 | const PadStrideInfo &conv_info, |
| 328 | const ActivationLayerInfo &act_info, |
| 329 | bool enable_fast_math) |
| 330 | { |
| 331 | ARM_COMPUTE_TRACE_EVENT(ARM_COMPUTE_PROF_CAT_CPU, ARM_COMPUTE_PROF_LVL_CPU, "CpuWinogradConv2d::validate"); |
| 332 | ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(src, weights, dst); |
| 333 | ARM_COMPUTE_RETURN_ON_ERROR(validate_arguments(src, weights, biases, dst, conv_info)); |
| 334 | |
| 335 | // Disable winograd for fp16 if fast math is false. |
| 336 | if (!enable_fast_math) |
| 337 | { |
| 338 | ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN(src, 1, DataType::F32); |
| 339 | } |
| 340 | |
| 341 | const Tensor4DShape kernel_shape{internal_get_shape(weights)}; |
| 342 | arm_conv::winograd::WinogradImpl winograd_impl{}; |
| 343 | |
| 344 | std::unique_ptr<arm_conv::ConvolutionArgs> conv_args; |
| 345 | const bool success = get_winograd_kernel_implementation(src, weights, dst, conv_info, act_info, enable_fast_math, |
| 346 | &winograd_impl, conv_args); |
| 347 | |
| 348 | ARM_COMPUTE_RETURN_ERROR_ON_MSG_VAR(success == false, "Unsupported kernel size: %d x %d.\n", kernel_shape.n_rows, |
| 349 | kernel_shape.n_cols); |
| 350 | ARM_COMPUTE_LOG_MSG_WITH_FORMAT_ACL(arm_compute::logging::LogLevel::INFO, "Using input transform: %s\n", |
| 351 | winograd_impl.input_transform->get_name().c_str()); |
| 352 | ARM_COMPUTE_LOG_MSG_WITH_FORMAT_ACL(arm_compute::logging::LogLevel::INFO, "Using weight transform: %s\n", |
| 353 | winograd_impl.input_transform->get_name().c_str()); |
| 354 | ARM_COMPUTE_LOG_MSG_WITH_FORMAT_ACL(arm_compute::logging::LogLevel::INFO, "Using output transform: %s\n", |
| 355 | winograd_impl.input_transform->get_name().c_str()); |
| 356 | return Status{}; |
| 357 | } |
| 358 | |
| 359 | void CpuWinogradConv2d::run(ITensorPack &tensors) |
| 360 | { |
nothing calls this directly
no test coverage detected