|
12 | 12 | #include "core/common/safeint.h" |
13 | 13 | #include "core/common/float16.h" |
14 | 14 | #include "core/framework/op_kernel.h" |
| 15 | +#include "core/providers/cpu/mlas_backend_kernel_selector_config_utils.h" |
15 | 16 | #include "core/providers/cpu/nn/conv_attributes.h" |
16 | 17 |
|
17 | 18 | #include "contrib_ops/cpu/fused_activation.h" |
@@ -46,6 +47,7 @@ class FusedConvFp16 final : public OpKernel { |
46 | 47 | FusedConvFp16(const OpKernelInfo& info) : OpKernel(info), conv_attrs_(info) { |
47 | 48 | ORT_ENFORCE(GetFusedActivationAttr(info, activation_).IsOK()); |
48 | 49 | channels_last_ = (info.GetKernelDef().OpName() == "NhwcFusedConv"); |
| 50 | + SetupMlasBackendKernelSelectorFromConfigOptions(mlas_backend_kernel_selector_config_, info.GetConfigOptions()); |
49 | 51 | } |
50 | 52 |
|
51 | 53 | Status Compute(OpKernelContext* context) const override; |
@@ -93,6 +95,7 @@ class FusedConvFp16 final : public OpKernel { |
93 | 95 | } |
94 | 96 |
|
95 | 97 | MLAS_ACTIVATION activation_; |
| 98 | + MLAS_BACKEND_KERNEL_SELECTOR_CONFIG mlas_backend_kernel_selector_config_; |
96 | 99 | ConvAttributes conv_attrs_; |
97 | 100 | TensorShape W_shape_; |
98 | 101 | BufferUniquePtr packed_W_buffer_; |
@@ -558,6 +561,7 @@ Status FusedConvFp16::Compute(OpKernelContext* context) const { |
558 | 561 | gemm_params.ldc = static_cast<size_t>(M); |
559 | 562 | gemm_params.Bias = Bdata; |
560 | 563 | gemm_params.OutputProcessor = (!channels_last_ && sum_data) ? nullptr : &act; // process fused activation and add |
| 564 | + gemm_params.BackendKernelSelectorConfig = &mlas_backend_kernel_selector_config_; |
561 | 565 |
|
562 | 566 | MlasHalfGemmBatch( |
563 | 567 | static_cast<size_t>(output_count), |
|
0 commit comments