@@ -144,6 +144,9 @@ class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kOnnxDomain, 7, Aco
144144class ONNX_OPERATOR_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 7 , Atan);
145145class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 7 , 8 , float , Gemm);
146146class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 7 , 8 , double , Gemm);
147+ #ifdef MLAS_F16VEC_INTRINSICS_SUPPORTED
148+ class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 7 , 8 , MLFloat16, MatMul);
149+ #endif
147150class ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 1 , 10 , Hardmax);
148151class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 1 , 10 , float , LogSoftmax);
149152class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 1 , 10 , double , LogSoftmax);
@@ -344,6 +347,9 @@ class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME(kCpuExecutionProvider, kOn
344347class ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 9 , 10 , Flatten);
345348class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 9 , 10 , float , Gemm);
346349class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 9 , 10 , double , Gemm);
350+ #ifdef MLAS_F16VEC_INTRINSICS_SUPPORTED
351+ class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 9 , 10 , MLFloat16, MatMul);
352+ #endif
347353class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 9 , 12 , float , MatMul);
348354class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 9 , 12 , double , MatMul);
349355class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 9 , 12 , int32_t , MatMul);
@@ -514,6 +520,9 @@ class ONNX_OPERATOR_KERNEL_CLASS_NAME(kCpuExecutionProvider, kOnnxDomain, 11, Sp
514520class ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 11 , 12 , ScatterND);
515521class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 11 , 12 , float , Gemm);
516522class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 11 , 12 , double , Gemm);
523+ #ifdef MLAS_F16VEC_INTRINSICS_SUPPORTED
524+ class ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 11 , 12 , MLFloat16, MatMul);
525+ #endif
517526class ONNX_OPERATOR_VERSIONED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 11 , 12 , GatherElements);
518527class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 11 , uint8_t , BitShift);
519528class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 11 , uint32_t , BitShift);
@@ -620,6 +629,9 @@ class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME(kCpuExecutionProvider, kOnnxDomain,
620629class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 13 , string, Expand);
621630class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 13 , float , Gemm);
622631class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 13 , double , Gemm);
632+ #ifdef MLAS_F16VEC_INTRINSICS_SUPPORTED
633+ class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 13 , MLFloat16, MatMul);
634+ #endif
623635class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 13 , float , MatMul);
624636class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 13 , double , MatMul);
625637class ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 13 , int32_t , MatMul);
@@ -2814,7 +2826,7 @@ Status RegisterOnnxOperatorKernels(KernelRegistry& kernel_registry) {
28142826
28152827
28162828 BuildKernelCreateInfo<ONNX_OPERATOR_KERNEL_CLASS_NAME (kCpuExecutionProvider , kQuadricDomain , 1 , QuadricCustomOp)>,
2817-
2829+
28182830 };
28192831
28202832 for (auto & function_table_entry : function_table) {
@@ -2827,6 +2839,13 @@ Status RegisterOnnxOperatorKernels(KernelRegistry& kernel_registry) {
28272839 return Status::OK ();
28282840}
28292841
2842+ #ifdef MLAS_F16VEC_INTRINSICS_SUPPORTED
2843+ #pragma message("MLAS_F16VEC_INTRINSICS_SUPPORTED is defined")
2844+ #else
2845+ #pragma message("MLAS_F16VEC_INTRINSICS_SUPPORTED is NOT defined")
2846+ #endif
2847+
2848+
28302849#ifdef MLAS_F16VEC_INTRINSICS_SUPPORTED
28312850Status RegisterFp16Kernels (KernelRegistry& kernel_registry) {
28322851 static const BuildKernelCreateInfoFn function_table[] = {
@@ -2853,6 +2872,14 @@ Status RegisterFp16Kernels(KernelRegistry& kernel_registry) {
28532872 MLFloat16, LeakyRelu)>,
28542873 BuildKernelCreateInfo<ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 16 , MLFloat16,
28552874 LeakyRelu)>,
2875+ BuildKernelCreateInfo<ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 7 , 8 ,
2876+ MLFloat16, MatMul)>,
2877+ BuildKernelCreateInfo<ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 9 , 10 ,
2878+ MLFloat16, MatMul)>,
2879+ BuildKernelCreateInfo<ONNX_OPERATOR_VERSIONED_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 11 , 12 ,
2880+ MLFloat16, MatMul)>,
2881+ BuildKernelCreateInfo<ONNX_OPERATOR_TYPED_KERNEL_CLASS_NAME (kCpuExecutionProvider , kOnnxDomain , 13 , MLFloat16,
2882+ MatMul)>
28562883 };
28572884
28582885 for (auto & function_table_entry : function_table) {
@@ -3104,6 +3131,7 @@ Status RegisterCPUKernels(KernelRegistry& kernel_registry) {
31043131 ORT_RETURN_IF_ERROR (RegisterOnnxOperatorKernels (kernel_registry));
31053132#ifdef MLAS_F16VEC_INTRINSICS_SUPPORTED
31063133 if (MlasFp16AccelerationSupported ()) {
3134+ #pragma message("calling RegisterFp16Kernels")
31073135 ORT_RETURN_IF_ERROR (RegisterFp16Kernels (kernel_registry));
31083136 }
31093137#endif
0 commit comments