#include <stdint.h> #include <stdio.h> #include "AutoTilerLib.h" /* * Copyright (C) 2018 GreenWaves Technologies * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "CNN_Generators_SQ8.h" #include "CNN_Generator_Util.h" #include "CNN_Copy_Generators.h" #include "Gap.h" #include "../CNN_Libraries_SQ8/CNN_Infos_SQ8.h" #define MaxS(a, b) (((int)(a)>(int)(b))?(a):(b)) #define Max(a, b) (((a)>(b))?(a):(b)) #define Min(a, b) (((a)<(b))?(a):(b)) #define Abs(x) (((x)<0)?-(x):(x)) #define D0 KER_ITER_D0 #define D1 KER_ITER_D1 #define D2 KER_ITER_D2 #define D3 KER_ITER_D3 #define T0 KER_ITER_TILE0 #define T1 KER_ITER_TILE1 #define T2 KER_ITER_TILE2 void LoadCNN_SQ8_Library() { LoadCNN_Copy_Library(); LibKernelTemplate("KerSetBias_SQ8_T", CArgs(6, TCArg("int * __restrict__", "Out"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned short int", "Feat"), TCArg("void * __restrict__", "Bias"), TCArg("unsigned char", "NormBias") ) ); LibKernelTemplate("KerConv_SQ8_T", CArgs(20, TCArg("signed char * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "UsedW"), TCArg("unsigned short int", "H"), TCArg("unsigned short int", "UsedH"), TCArg("unsigned short int", "InFeatures"), TCArg("unsigned short int", "OutFeatures"), TCArg("unsigned short int", "TotalInFeatures"), TCArg("signed char * __restrict__", "Filter"), TCArg("signed char * __restrict__", "Bias"), TCArg("int * __restrict__", "Out"), TCArg("v4s", "Pad"), TCArg("unsigned char", "NormBias"), TCArg("unsigned char", "Orientation"), TCArg("unsigned short", "N"), TCArg("unsigned char", "S"), TCArg("unsigned char", "D"), TCArg("unsigned short", "Ny"), TCArg("unsigned char", "Sy"), TCArg("unsigned char", "Dy") ) ); LibKernelTemplate("KerConvRedAct_SQ8_T", CArgs(23, TCArg("signed char * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "UsedW"), TCArg("unsigned short int", "H"), TCArg("unsigned short int", "UsedH"), TCArg("unsigned short int", "InFeatures"), TCArg("unsigned short int", "OutFeatures"), TCArg("unsigned short int", "TotalInFeatures"), TCArg("signed char * __restrict__", "Filter"), TCArg("signed char * __restrict__", "Bias"), TCArg("signed char * __restrict__", "Scale"), TCArg("signed char * __restrict__", "ScaleN"), TCArg("signed char * __restrict__", "Infos"), TCArg("signed char * __restrict__", "Out"), TCArg("v4s", "Pad"), TCArg("unsigned char", "NormBias"), TCArg("unsigned char", "Orientation"), TCArg("unsigned short", "N"), TCArg("unsigned char", "S"), TCArg("unsigned char", "D"), TCArg("unsigned short", "Ny"), TCArg("unsigned char", "Sy"), TCArg("unsigned char", "Dy") ) ); LibKernelTemplate("Ker_MM_Conv_SQ8_T", CArgs(22, TCArg("signed char * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned char", "Fx"), TCArg("unsigned char", "Fy"), TCArg("unsigned char", "Sx"), TCArg("unsigned char", "Sy"), TCArg("unsigned char", "Dx"), TCArg("unsigned char", "Dy"), TCArg("unsigned char", "FirstTile"), TCArg("v4s", "Pad"), TCArg("signed char * __restrict__", "Filter"), TCArg("int * __restrict__", "Bias"), TCArg("signed char * __restrict__", "Out"), TCArg("unsigned short int", "InFeat"), TCArg("unsigned short int", "OutFeat"), TCArg("unsigned short int", "Wo"), TCArg("unsigned short int", "Ho"), TCArg("unsigned char * __restrict__", "Scale"), TCArg("unsigned char * __restrict__", "ScaleN"), TCArg("signed char * __restrict__", "ColBuff"), TCArg("signed char * __restrict__", "Infos") ) ); LibKernelTemplate("Ker_MM_Pool_SQ8_T", CArgs(14, TCArg("signed char * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned char", "Fx"), TCArg("unsigned char", "Fy"), TCArg("unsigned char", "Sx"), TCArg("unsigned char", "Sy"), TCArg("unsigned char", "FirstTile"), TCArg("v4s", "Pad"), TCArg("signed char * __restrict__", "Out"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "Wo"), TCArg("unsigned short int", "Ho"), TCArg("signed char * __restrict__", "Infos") ) ); LibKernelTemplate("Ker_MM_Pool_USQ8_T", CArgs(14, TCArg("unsigned char * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned char", "Fx"), TCArg("unsigned char", "Fy"), TCArg("unsigned char", "Sx"), TCArg("unsigned char", "Sy"), TCArg("unsigned char", "FirstTile"), TCArg("v4s", "Pad"), TCArg("unsigned char * __restrict__", "Out"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "Wo"), TCArg("unsigned short int", "Ho"), TCArg("signed char * __restrict__", "Infos") ) ); LibKernelTemplate("Ker_MM_Pool_SQ16_T", CArgs(14, TCArg("signed short * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned char", "Fx"), TCArg("unsigned char", "Fy"), TCArg("unsigned char", "Sx"), TCArg("unsigned char", "Sy"), TCArg("unsigned char", "FirstTile"), TCArg("v4s", "Pad"), TCArg("signed short * __restrict__", "Out"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "Wo"), TCArg("unsigned short int", "Ho"), TCArg("signed char * __restrict__", "Infos") ) ); LibKernelTemplate("Ker_MM_Pool_USQ16_T", CArgs(14, TCArg("unsigned short * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned char", "Fx"), TCArg("unsigned char", "Fy"), TCArg("unsigned char", "Sx"), TCArg("unsigned char", "Sy"), TCArg("unsigned char", "FirstTile"), TCArg("v4s", "Pad"), TCArg("unsigned short * __restrict__", "Out"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "Wo"), TCArg("unsigned short int", "Ho"), TCArg("signed char * __restrict__", "Infos") ) ); LibKernelTemplate("KerConvLinReduct_SQ8_T", CArgs(8, TCArg("int *__restrict__", "In"), TCArg("void *__restrict__", "Out"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned char *__restrict__", "Scale"), TCArg("unsigned char *__restrict__", "ScaleN"), TCArg("signed char *__restrict__", "Infos") ) ); LibKernelTemplate("KerPool_HWC_USQ8_T", CArgs(13, TCArg("unsigned char * __restrict__", "In"), TCArg("unsigned char * __restrict__", "Out"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "UsedW"), TCArg("unsigned short int", "H"), TCArg("unsigned short int", "UsedH"), TCArg("unsigned short int", "FS"), TCArg("unsigned short int", "FSy"), TCArg("unsigned char", "S"), TCArg("unsigned char", "Sy"), TCArg("v4s", "Pad"), TCArg("signed char * __restrict__", "Infos") ) ); LibKernelTemplate("KerActivation_SQ8_T", CArgs(6, TCArg("signed char *__restrict__", "In"), TCArg("signed char *__restrict__", "Out"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("signed char *__restrict__", "Infos") ) ); LibKernelTemplate("KerPool_SQ8_T", CArgs(18, TCArg("signed char * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "UsedW"), TCArg("unsigned short int", "H"), TCArg("unsigned short int", "UsedH"), TCArg("unsigned short int", "Feat"), TCArg("signed char * __restrict__", "Out"), TCArg("v4s", "Pad"), TCArg("unsigned short", "FS"), TCArg("unsigned char", "S"), TCArg("unsigned char", "D"), TCArg("unsigned short", "FSy"), TCArg("unsigned char", "Sy"), TCArg("unsigned char", "Dy"), TCArg("unsigned char", "PoolMax"), TCArg("unsigned char", "Orientation"), TCArg("unsigned char", "DoScale"), TCArg("signed char * __restrict__", "Infos") ) ); LibKernelTemplate("KerGlobalPool_SQ8_T", CArgs(8, TCArg("void * __restrict__", "In"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "TileIndex"), TCArg("int * __restrict__", "Out"), TCArg("unsigned char", "DoScale"), TCArg("void * __restrict__", "Infos") ) ); LibKernelTemplate("KerLinear_SQ8_T", CArgs(10, TCArg("signed char * __restrict__", "In"), TCArg("signed char * __restrict__", "Weights"), TCArg("void * __restrict__", "Bias"), TCArg("void * __restrict__", "Out"), TCArg("unsigned short int", "InDim"), TCArg("unsigned short int", "TotalInDim"), TCArg("unsigned short int", "OutDim"), TCArg("unsigned char *__restrict__", "Scale"), TCArg("unsigned char *__restrict__", "ScaleN"), TCArg("signed char *__restrict__", "Infos") ) ); LibKernelTemplate("KerMat3_SQ8_T", CArgs(8, TCArg("signed char *__restrict__", "In1"), TCArg("signed char *__restrict__", "In2"), TCArg("signed char *__restrict__", "Out"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("unsigned char", "DoScale"), TCArg("signed char *__restrict__", "Infos") ) ); LibKernelTemplate("KerMatMul_SQ8_T", CArgs(19, TCArg("signed char * __restrict__", "In1"), TCArg("unsigned short int", "W_In1"), TCArg("unsigned short int", "H_In1"), TCArg("signed char * __restrict__", "In2"), TCArg("unsigned short int", "W_In2"), TCArg("void * __restrict__", "Bias"), TCArg("unsigned char * __restrict__", "Scale"), TCArg("unsigned char * __restrict__", "ScaleN"), TCArg("signed char * __restrict__", "Out"), TCArg("unsigned short int", "W_Out"), TCArg("unsigned short int", "OutFirstCol"), TCArg("signed char * __restrict__", "BufferColIn2"), TCArg("unsigned char", "NormBias"), TCArg("unsigned char", "ColFirst"), TCArg("unsigned char", "Sx"), TCArg("unsigned char", "Sy"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("signed char *__restrict__", "Infos") ) ); LibKernelTemplate("KerMatMul_PL_SQ8_T", CArgs(19, TCArg("signed char * __restrict__", "In1"), TCArg("unsigned short int", "W_In1"), TCArg("unsigned short int", "H_In1"), TCArg("signed char * __restrict__", "In2"), TCArg("unsigned short int", "W_In2"), TCArg("void * __restrict__", "Bias"), TCArg("unsigned char", "Scale"), TCArg("unsigned char", "ScaleN"), TCArg("signed char * __restrict__", "Out"), TCArg("unsigned short int", "W_Out"), TCArg("unsigned short int", "OutFirstCol"), TCArg("signed char * __restrict__", "BufferColIn2"), TCArg("unsigned char", "NormBias"), TCArg("unsigned char", "ColFirst"), TCArg("unsigned char", "Sx"), TCArg("unsigned char", "Sy"), TCArg("unsigned short int", "W"), TCArg("unsigned short int", "H"), TCArg("signed char *__restrict__", "Infos") ) ); LibKernelTemplate("KerSoftMax_SQ8_T", CArgs(6, TCArg("signed char *__restrict__", "In"), TCArg("unsigned short int", "Feat"), TCArg("unsigned short int", "N"), TCArg("unsigned short int", "Norm"), TCArg("short int *__restrict__", "Out"), TCArg("signed char *__restrict__", "Infos") ) ); /****************************************************************************************************************/ /* Kernels for features and coefficients on 8 bits. Kernels for multiple output features evaluated in parallel */ /****************************************************************************************************************/ /* Bias setting */ LibKernel("KerParSetBiasB8_SQ8", CALL_PARALLEL, 0, "KerSetBias_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParSetBiasB16_SQ8", CALL_PARALLEL, 0, "KerSetBias_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 1, CNN_Type(2,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParSetBiasB32_SQ8", CALL_PARALLEL, 0, "KerSetBias_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 1, CNN_Type(4,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParSetBiasB8_HWC_SQ8", CALL_HWC_KER|CALL_PARALLEL, 0, "KerSetBias_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParSetBiasB16_HWC_SQ8", CALL_HWC_KER|CALL_PARALLEL, 0, "KerSetBias_SQ8_T",CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 1, CNN_Type(2,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParSetBiasB32_HWC_SQ8", CALL_HWC_KER|CALL_PARALLEL, 0, "KerSetBias_SQ8_T",CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 1, CNN_Type(4,0,0,0,4), 0,0,0,0,0,0)); /* Convolutions with 32b output, Bias set before */ LibKernel("KerParConv1x1Stride1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 1,1,1,1,1,1)); LibKernel("KerParConv1x1Stride2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 1,1,1,1,2,2)); LibKernel("KerParConv1x1StrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 1,1,1,1,-1,-2)); LibKernel("KerParConv3x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,1,1,1,1,1)); LibKernel("KerParConv3x1Stride2x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,1,1,1,2,1)); LibKernel("KerParConv1x3Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 1,3,1,1,1,1)); LibKernel("KerParConv1x3Stride1x2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 1,3,1,1,1,2)); LibKernel("KerParConv3x3Stride1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,1,1,1,1)); LibKernel("KerParConv3x3Stride2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,1,1,2,2)); LibKernel("KerParConv3x3StrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,1,1,-1,-2)); LibKernel("KerParConv4x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 4,1,1,1,1,1)); LibKernel("KerParConv1x4Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 1,4,1,1,1,1)); LibKernel("KerParConv5x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 5,1,1,1,1,1)); LibKernel("KerParConv5x1Stride2x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 5,1,1,1,2,1)); LibKernel("KerParConv1x5Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 1,5,1,1,1,1)); LibKernel("KerParConv1x5Stride1x2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 1,5,1,1,1,2)); LibKernel("KerParConv5x5Stride1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 5,5,1,1,1,1)); LibKernel("KerParConv5x5Stride2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 5,5,1,1,2,2)); LibKernel("KerParConv5x5StrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 5,5,1,1,-1,-2)); LibKernel("KerParConv7x7StrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 7,7,1,1,-1,-2)); LibKernel("KerParConv13x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 13,1,1,1,1,1)); //LibKernel("KerParConv4x10StrideSxSy_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 4,10,1,1,-1,-1)); LibKernel("KerParConv1D_NStrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV1D), 0, 1, CNN_Type(1,1,1,0,4), -1,1,1,1,-1,1)); LibKernel("KerParConvNx1StrideSxS1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), -1,1,1,1,-1,1)); LibKernel("KerParConvNxNStrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), -1,-2,1,1,-1,-2)); LibKernel("KerParConvNxMStrideSxSy_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), -1,-1,1,1,-1,-1)); LibKernel("KerParConvNxMDxDyStrideSxSy_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), -1,-1,-1,-1,-1,-1)); LibKernel("KerParConv3x3DxDyStrideSxSy_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,-1,-1,-1,-1)); LibKernel("KerParConv3x3DxDyStride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,-1,-1,1,1)); LibKernel("KerParConv3x3D2x2Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,2,2,1,1)); LibKernel("KerParConv3x3D4x4Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,4,4,1,1)); LibKernel("KerParConv3x3D8x8Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,8,8,1,1)); LibKernel("KerParConv3x3D2x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,2,1,1,1)); LibKernel("KerParConv3x3D4x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,4,1,1,1)); LibKernel("KerParConv3x3D8x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,8,1,1,1)); LibKernel("KerParConv3x3DxD2Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 1, CNN_Type(1,1,1,0,4), 3,3,-1,2,1,1)); /* Depth Wise Convolutions, 8b bias, 32b output */ LibKernel("KerParConvDW1x1Stride1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 1,1,1,1,1,1)); LibKernel("KerParConvDW1x1Stride2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 1,1,1,1,2,2)); LibKernel("KerParConvDW1x1StrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 1,1,1,1,-1,-2)); LibKernel("KerParConvDW3x1Stride1x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 3,1,1,1,1,1)); LibKernel("KerParConvDW3x1Stride2x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 3,1,1,1,2,1)); LibKernel("KerParConvDW1x3Stride1x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 1,3,1,1,1,1)); LibKernel("KerParConvDW1x3Stride1x2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 1,3,1,1,1,2)); LibKernel("KerParConvDW3x3Stride1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 3,3,1,1,1,1)); LibKernel("KerParConvDW3x3Stride2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 3,3,1,1,2,2)); LibKernel("KerParConvDW3x3StrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 3,3,1,1,-1,-2)); LibKernel("KerParConvDW5x1Stride1x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 5,1,1,1,1,1)); LibKernel("KerParConvDW5x1Stride2x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 5,1,1,1,2,1)); LibKernel("KerParConvDW1x5Stride1x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 1,5,1,1,1,1)); LibKernel("KerParConvDW1x5Stride1x2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 1,5,1,1,1,2)); LibKernel("KerParConvDW5x5Stride1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 5,5,1,1,1,1)); LibKernel("KerParConvDW5x5Stride2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 5,5,1,1,2,2)); LibKernel("KerParConvDW5x5StrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 5,5,1,1,-1,-2)); LibKernel("KerParConvDW7x7StrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), 7,7,1,1,-1,-2)); LibKernel("KerParConvDWNxNStrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), -1,-2,1,1,-1,-2)); LibKernel("KerParConvDWNxMStrideSxSyB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), -1,-1,1,1,-1,-1)); LibKernel("KerParConvDWNxMDxDyStrideSxSyB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,1,0,4), -1,-1,-1,-1,-1,-1)); /* Depth Wise Convolutions, 16b bias, 32b output */ LibKernel("KerParConvDW1x1Stride1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 1,1,1,1,1,1)); LibKernel("KerParConvDW1x1Stride2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 1,1,1,1,2,2)); LibKernel("KerParConvDW1x1StrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 1,1,1,1,-1,-2)); LibKernel("KerParConvDW3x1Stride1x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 3,1,1,1,1,1)); LibKernel("KerParConvDW3x1Stride2x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 3,1,1,1,2,1)); LibKernel("KerParConvDW1x3Stride1x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 1,3,1,1,1,1)); LibKernel("KerParConvDW1x3Stride1x2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 1,3,1,1,1,2)); LibKernel("KerParConvDW3x3Stride1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 3,3,1,1,1,1)); LibKernel("KerParConvDW3x3Stride2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 3,3,1,1,2,2)); LibKernel("KerParConvDW3x3StrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 3,3,1,1,-1,-2)); LibKernel("KerParConvDW5x1Stride1x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 5,1,1,1,1,1)); LibKernel("KerParConvDW5x1Stride2x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 5,1,1,1,2,1)); LibKernel("KerParConvDW1x5Stride1x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 1,5,1,1,1,1)); LibKernel("KerParConvDW1x5Stride1x2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 1,5,1,1,1,2)); LibKernel("KerParConvDW5x5Stride1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 5,5,1,1,1,1)); LibKernel("KerParConvDW5x5Stride2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 5,5,1,1,2,2)); LibKernel("KerParConvDW5x5StrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 5,5,1,1,-1,-2)); LibKernel("KerParConvDW7x7StrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), 7,7,1,1,-1,-2)); LibKernel("KerParConvDWNxNStrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), -1,-2,1,1,-1,-2)); LibKernel("KerParConvDWNxMStrideSxSyB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), -1,-1,1,1,-1,-1)); LibKernel("KerParConvDWNxMDxDyStrideSxSyB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,2,0,4), -1,-1,-1,-1,-1,-1)); /* Depth Wise Convolutions, 32b bias, 32b output */ LibKernel("KerParConvDW1x1Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 1,1,1,1,1,1)); LibKernel("KerParConvDW1x1Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 1,1,1,1,2,2)); LibKernel("KerParConvDW1x1StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 1,1,1,1,-1,-2)); LibKernel("KerParConvDW3x1Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 3,1,1,1,1,1)); LibKernel("KerParConvDW3x1Stride2x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 3,1,1,1,2,1)); LibKernel("KerParConvDW1x3Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 1,3,1,1,1,1)); LibKernel("KerParConvDW1x3Stride1x2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 1,3,1,1,1,2)); LibKernel("KerParConvDW3x3Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 3,3,1,1,1,1)); LibKernel("KerParConvDW3x3Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 3,3,1,1,2,2)); LibKernel("KerParConvDW3x3StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 3,3,1,1,-1,-2)); LibKernel("KerParConvDW5x1Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 5,1,1,1,1,1)); LibKernel("KerParConvDW5x1Stride2x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 5,1,1,1,2,1)); LibKernel("KerParConvDW1x5Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 1,5,1,1,1,1)); LibKernel("KerParConvDW1x5Stride1x2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 1,5,1,1,1,2)); LibKernel("KerParConvDW5x5Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 5,5,1,1,1,1)); LibKernel("KerParConvDW5x5Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 5,5,1,1,2,2)); LibKernel("KerParConvDW5x5StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 5,5,1,1,-1,-2)); LibKernel("KerParConvDW7x7StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), 7,7,1,1,-1,-2)); LibKernel("KerParConvDWNxNStrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), -1,-2,1,1,-1,-2)); LibKernel("KerParConvDWNxMStrideSxSyB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), -1,-1,1,1,-1,-1)); LibKernel("KerParConvDWNxMDxDyStrideSxSyB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,4), -1,-1,-1,-1,-1,-1)); /* Depth Wise Convolutions, 32b bias, 8b output w/ reduction and activation */ LibKernel("KerParConvDWRedAct1x1Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 1,1,1,1,1,1)); LibKernel("KerParConvDWRedAct1x1Stride1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,1,1)); LibKernel("KerParConvDWRedAct1x1Stride1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,1,1)); LibKernel("KerParConvDWRedAct1x1Stride1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,1,1)); LibKernel("KerParConvDWRedAct1x1Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 1,1,1,1,2,2)); LibKernel("KerParConvDWRedAct1x1Stride2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,2,2)); LibKernel("KerParConvDWRedAct1x1Stride2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,2,2)); LibKernel("KerParConvDWRedAct1x1Stride2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,2,2)); LibKernel("KerParConvDWRedAct1x1StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-2)); LibKernel("KerParConvDWRedAct1x1StrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-2)); LibKernel("KerParConvDWRedAct1x1StrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-2)); LibKernel("KerParConvDWRedAct1x1StrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-2)); LibKernel("KerParConvDWRedAct3x1Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 3,1,1,1,1,1)); LibKernel("KerParConvDWRedAct3x1Stride1x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 3,1,1,1,1,1)); LibKernel("KerParConvDWRedAct3x1Stride1x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 3,1,1,1,1,1)); LibKernel("KerParConvDWRedAct3x1Stride1x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 3,1,1,1,1,1)); LibKernel("KerParConvDWRedAct3x1Stride2x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 3,1,1,1,2,1)); LibKernel("KerParConvDWRedAct3x1Stride2x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 3,1,1,1,2,1)); LibKernel("KerParConvDWRedAct3x1Stride2x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 3,1,1,1,2,1)); LibKernel("KerParConvDWRedAct3x1Stride2x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 3,1,1,1,2,1)); LibKernel("KerParConvDWRedAct1x3Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 1,3,1,1,1,1)); LibKernel("KerParConvDWRedAct1x3Stride1x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 1,3,1,1,1,1)); LibKernel("KerParConvDWRedAct1x3Stride1x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 1,3,1,1,1,1)); LibKernel("KerParConvDWRedAct1x3Stride1x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 1,3,1,1,1,1)); LibKernel("KerParConvDWRedAct1x3Stride1x2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 1,3,1,1,1,2)); LibKernel("KerParConvDWRedAct1x3Stride1x2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 1,3,1,1,1,2)); LibKernel("KerParConvDWRedAct1x3Stride1x2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 1,3,1,1,1,2)); LibKernel("KerParConvDWRedAct1x3Stride1x2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 1,3,1,1,1,2)); LibKernel("KerParConvDWRedAct3x3Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 3,3,1,1,1,1)); LibKernel("KerParConvDWRedAct3x3Stride1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,1,1)); LibKernel("KerParConvDWRedAct3x3Stride1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,1,1)); LibKernel("KerParConvDWRedAct3x3Stride1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,1,1)); LibKernel("KerParConvDWRedAct3x3Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 3,3,1,1,2,2)); LibKernel("KerParConvDWRedAct3x3Stride2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,2,2)); LibKernel("KerParConvDWRedAct3x3Stride2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,2,2)); LibKernel("KerParConvDWRedAct3x3Stride2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,2,2)); LibKernel("KerParConvDWRedAct3x3StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 3,3,1,1,-1,-2)); LibKernel("KerParConvDWRedAct3x3StrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,-1,-2)); LibKernel("KerParConvDWRedAct3x3StrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,-1,-2)); LibKernel("KerParConvDWRedAct3x3StrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 3,3,1,1,-1,-2)); LibKernel("KerParConvDWRedAct5x1Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 5,1,1,1,1,1)); LibKernel("KerParConvDWRedAct5x1Stride1x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 5,1,1,1,1,1)); LibKernel("KerParConvDWRedAct5x1Stride1x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 5,1,1,1,1,1)); LibKernel("KerParConvDWRedAct5x1Stride1x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 5,1,1,1,1,1)); LibKernel("KerParConvDWRedAct5x1Stride2x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 5,1,1,1,2,1)); LibKernel("KerParConvDWRedAct5x1Stride2x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 5,1,1,1,2,1)); LibKernel("KerParConvDWRedAct5x1Stride2x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 5,1,1,1,2,1)); LibKernel("KerParConvDWRedAct5x1Stride2x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 5,1,1,1,2,1)); LibKernel("KerParConvDWRedAct1x5Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 1,5,1,1,1,1)); LibKernel("KerParConvDWRedAct1x5Stride1x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 1,5,1,1,1,1)); LibKernel("KerParConvDWRedAct1x5Stride1x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 1,5,1,1,1,1)); LibKernel("KerParConvDWRedAct1x5Stride1x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 1,5,1,1,1,1)); LibKernel("KerParConvDWRedAct1x5Stride1x2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 1,5,1,1,1,2)); LibKernel("KerParConvDWRedAct1x5Stride1x2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 1,5,1,1,1,2)); LibKernel("KerParConvDWRedAct1x5Stride1x2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 1,5,1,1,1,2)); LibKernel("KerParConvDWRedAct1x5Stride1x2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 1,5,1,1,1,2)); LibKernel("KerParConvDWRedAct5x5Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 5,5,1,1,1,1)); LibKernel("KerParConvDWRedAct5x5Stride1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,1,1)); LibKernel("KerParConvDWRedAct5x5Stride1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,1,1)); LibKernel("KerParConvDWRedAct5x5Stride1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,1,1)); LibKernel("KerParConvDWRedAct5x5Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 5,5,1,1,2,2)); LibKernel("KerParConvDWRedAct5x5Stride2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,2,2)); LibKernel("KerParConvDWRedAct5x5Stride2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,2,2)); LibKernel("KerParConvDWRedAct5x5Stride2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,2,2)); LibKernel("KerParConvDWRedAct5x5StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 5,5,1,1,-1,-2)); LibKernel("KerParConvDWRedAct5x5StrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,-1,-2)); LibKernel("KerParConvDWRedAct5x5StrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,-1,-2)); LibKernel("KerParConvDWRedAct5x5StrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 5,5,1,1,-1,-2)); LibKernel("KerParConvDWRedAct7x7StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), 7,7,1,1,-1,-2)); LibKernel("KerParConvDWRedAct7x7StrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 7,7,1,1,-1,-2)); LibKernel("KerParConvDWRedAct7x7StrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 7,7,1,1,-1,-2)); LibKernel("KerParConvDWRedAct7x7StrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 7,7,1,1,-1,-2)); LibKernel("KerParConvDWRedActNxNStrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParConvDWRedActNxNStrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParConvDWRedActNxNStrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParConvDWRedActNxNStrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParConvDWRedActNxMStrideSxSyB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParConvDWRedActNxMStrideSxSyB32_ReLU_SQ8",CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParConvDWRedActNxMStrideSxSyB32_ReLUM_SQ8",CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParConvDWRedActNxMStrideSxSyB32_ReLUN_SQ8",CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParConvDWRedActNxMDxDyStrideSxSyB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerParConvDWRedActNxMDxDyStrideSxSyB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerParConvDWRedActNxMDxDyStrideSxSyB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerParConvDWRedActNxMDxDyStrideSxSyB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); /* Linear layer, 32b output with bias set before and scaling/activation done after */ LibKernel("KerParLinearLayer_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), 0, 1, CNN_Type(1,1,0,0,4), 0,0,0,0,0,0)); /* Linear layer, 8b output with bias and scaling/activation (ReLU, ReLUN) done in a single shot */ LibKernel("KerParLinearLayerFullFeatB8_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_ReLU_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_ReLUN_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_ReLUM_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_HSwish_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB8_Tanh_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_ReLU_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_ReLUN_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_ReLUM_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_HSwish_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB16_Tanh_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_HSwish_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); LibKernel("KerParLinearLayerFullFeatB32_Tanh_SQ8", CALL_PARALLEL, 0, "KerLinear_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LINEAR), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,0,0)); /* Convolution or Linear output reduction with per channel scaling and optional activation. Out != In and In Place (IO) */ LibKernel("KerParReduct_CC_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSwish_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Tanh_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_HSwish_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T",CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T",CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReductIO_CC_Tanh_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T",CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); /* Pooling (Max or Avg) with tensor centric scaling and optional ReLU or ReLUN activation */ LibKernel("KerParPool2x2Stride2_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,1), 2,2,1,1,2,2)); LibKernel("KerParPool2x2Stride2_ReLU_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,1), 2,2,1,1,2,2)); LibKernel("KerParPool2x2Stride2_ReLUN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,1), 2,2,1,1,2,2)); LibKernel("KerParPool2x2Stride2_ReLUM_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,1), 2,2,1,1,2,2)); LibKernel("KerParPool2x2Stride2_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,1), 2,2,1,1,2,2)); LibKernel("KerParPoolNxNStrideS_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParPoolNxNStrideS_ReLU_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParPoolNxNStrideS_ReLUN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParPoolNxNStrideS_ReLUM_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParPoolNxNStrideS_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerParPoolNxMStrideSxSy_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParPoolNxMStrideSxSy_ReLU_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParPoolNxMStrideSxSy_ReLUN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParPoolNxMStrideSxSy_ReLUM_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParPoolNxMStrideSxSy_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUM_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUMN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_LeakyReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_HSwish_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_HSigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_Sigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_Tanh_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUM_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUMN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_LeakyReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_HSwish_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_HSigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_Sigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_Tanh_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLU_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUN_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUM_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUMN_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_LeakyReLU_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_HSwish_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_HSigmoid_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_Sigmoid_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_Tanh_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLU_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUN_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUM_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUMN_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_LeakyReLU_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_HSwish_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_HSigmoid_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_Sigmoid_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_Tanh_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ8_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(-1,0,0,0,-1), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLU_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUN_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUM_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUMN_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_LeakyReLU_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_HSwish_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_HSigmoid_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_Sigmoid_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_Tanh_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLU_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUN_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUM_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_ReLUMN_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_LeakyReLU_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_HSwish_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_HSigmoid_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_Sigmoid_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParMaxPoolNxMStrideSxSy_HWC_Tanh_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_MAXPOOL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLU_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUN_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUM_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUMN_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_LeakyReLU_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_HSwish_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_HSigmoid_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_Sigmoid_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_Tanh_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_SQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(2,0,0,0,2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLU_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUN_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUM_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_ReLUMN_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_LeakyReLU_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_HSwish_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_HSigmoid_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_Sigmoid_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); LibKernel("KerParAvgPoolNxMStrideSxSy_HWC_Tanh_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Pool_USQ16_T", CNN_Match(CNN_OperList(1, KOP_AVGPOOL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(-2,0,0,0,-2), -1,-1,1,1,-1,-1)); /* Global Pooling (Max or Avg) with tensor centric scaling and optional ReLU or ReLUN activation */ LibKernel("KerParGlobalMaxPoolFullFeat_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPoolFullFeat_ReLU_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPoolFullFeat_ReLUN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPoolFullFeat_ReLUM_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPoolFullFeat_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPool_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPool_Reduct_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL_REDUCT), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPool_Reduct_ReLU_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL_REDUCT), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPool_Reduct_ReLUN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL_REDUCT), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPool_Reduct_ReLUM_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL_REDUCT), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalMaxPool_Reduct_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_MAXPOOL_REDUCT), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPoolFullFeat_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPoolFullFeat_ReLU_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPoolFullFeat_ReLUN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPoolFullFeat_ReLUM_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPoolFullFeat_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPool_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPool_Reduct_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL_REDUCT), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPool_Reduct_ReLU_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL_REDUCT), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPool_Reduct_ReLUN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL_REDUCT), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPool_Reduct_ReLUM_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL_REDUCT), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalAvgPool_Reduct_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_AVGPOOL_REDUCT), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPoolFullFeat_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPoolFullFeat_ReLU_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPoolFullFeat_ReLUN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPoolFullFeat_ReLUM_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPoolFullFeat_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPool_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPool_Reduct_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T", CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL_REDUCT), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPool_Reduct_ReLU_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL_REDUCT), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPool_Reduct_ReLUN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL_REDUCT), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPool_Reduct_ReLUM_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL_REDUCT), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerParGlobalSumPool_Reduct_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerGlobalPool_SQ8_T",CNN_Match(CNN_OperList(1, KOP_GLOBAL_SUMPOOL_REDUCT), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); /* Matrix Algebra */ /* Matrix Addition with tensor centric scaling and optional activation */ LibKernel("KerMatAdd_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_NONE), 0, CNN_Type(1,1,0,0,1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_ReLU_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,0,0,1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,0,0,1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_HSIGMOID), 0, CNN_Type(1,1,0,0,1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_HSwish_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_HSWISH), 0, CNN_Type(1,1,0,0,1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_LEAKYRELU), 0, CNN_Type(1,1,0,0,1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_USQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_NONE), 0, CNN_Type(-1,-1,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_ReLU_USQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_RELU), 0, CNN_Type(-1,-1,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_ReLUN_USQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(-1,-1,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_ReLUM_USQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(-1,-1,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerMatAdd_ReLUMN_USQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATADD), CNN_OperList(1, KOP_RELUMN), 0, CNN_Type(-1,-1,0,0,-1), 0,0,0,0,0,0)); /* Matrix Multiplication for 1x1 convolutions with channel scaling and optional ReLU or ReLUN activation */ /* 8b Bias */ LibKernel("KerParMatMulB8_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_ReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_ReLUM_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_HSwish_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_Tanh_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulSxSyB8_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_ReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_ReLUM_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_HSwish_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB8_Tanh_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,-1,-1)); /* 16b Bias */ LibKernel("KerParMatMulB16_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_ReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_ReLUM_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_HSwish_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_Tanh_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulSxSyB16_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_ReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_ReLUM_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_HSwish_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB16_Tanh_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,-1,-1)); /* 32b Bias or No Bias at all */ LibKernel("KerParMatMulB32_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_HSwish_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_Tanh_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_HSwish_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_Tanh_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_TRANSPOSED, KOP_MATMUL_NOBIAS_TRANSPOSED), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLU_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUN_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUM_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUMN_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_LeakyReLU_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_HSwish_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_HSigmoid_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_Sigmoid_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_Tanh_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR, KOP_MATMUL_NOBIAS_SCALE_SCALAR), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_ReLU_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_ReLUN_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_ReLUM_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_ReLUMN_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_LeakyReLU_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_HSwish_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_HSigmoid_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_Sigmoid_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulTransposedB32_Tanh_PL_SQ8", CALL_PARALLEL, 0, "KerMatMul_PL_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL_SCALE_SCALAR_TRANSPOSED, KOP_MATMUL_NOBIAS_SCALE_SCALAR_TRANSPOSED), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulSxSyB32_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_HSwish_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); LibKernel("KerParMatMulSxSyB32_Tanh_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MATMUL, KOP_MATMUL_NOBIAS), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,-1,-1)); /* Mat Mul based convolutions */ /* CHW In and Out tensors, [OutFeat,InFeat,Fy,Fx] weights */ LibKernel("KerPar_MM_Conv1D_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_ReLU_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_ReLUN_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_ReLUM_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_ReLUMN_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_LeakyReLU_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_HSwish_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_HSigmoid_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_Sigmoid_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_Tanh_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_ReLU_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_ReLUN_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_ReLUM_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_ReLUMN_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_LeakyReLU_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_HSwish_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_HSigmoid_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_Sigmoid_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_Tanh_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_ReLU_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_ReLUN_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_ReLUM_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_ReLUMN_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_LeakyReLU_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_HSwish_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_HSigmoid_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_Sigmoid_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_Tanh_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_ReLU_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_ReLUN_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_ReLUM_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_ReLUMN_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_LeakyReLU_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_HSwish_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_HSigmoid_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_Sigmoid_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_Tanh_SQ8", CALL_PARALLEL, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); /* HWC In and Out tensors, [OutFeat,Fy,Fx,InFeat] weights */ LibKernel("KerPar_MM_Conv1x1_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_ReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_ReLUN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_ReLUM_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_ReLUMN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_LeakyReLU_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_HSwish_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_HSigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_Sigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1x1_Tanh_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_ReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_ReLUN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_ReLUM_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_ReLUMN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_LeakyReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_HSwish_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_HSigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_Sigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("Ker_MM_Conv1x1_Tanh_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 0, CNN_Type(1,1,4,0,1), 1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_ReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_ReLUN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_ReLUM_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_ReLUMN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_LeakyReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_HSwish_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_HSigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_Sigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_Tanh_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), -1,1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_ReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_ReLUN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_ReLUM_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_ReLUMN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_LeakyReLU_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_HSwish_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_HSigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_Sigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv1D_DxDy_Tanh_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), -1,1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_ReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_ReLUN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_ReLUM_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_ReLUMN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_LeakyReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_HSwish_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_HSigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_Sigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_Tanh_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_ReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_ReLUN_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_ReLUM_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_ReLUMN_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_LeakyReLU_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_HSwish_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_HSigmoid_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_Sigmoid_HWC_SQ8",CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerPar_MM_Conv2D_DxDy_Tanh_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("Ker_MM_Conv2D_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_NONE), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_ReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_ReLUN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_ReLUM_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_ReLUMN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_RELUMN), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_LeakyReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_LEAKYRELU), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_HSwish_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSWISH), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_HSigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_HSIGMOID), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_Sigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_SIGMOID), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("Ker_MM_Conv2D_Tanh_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "Ker_MM_Conv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MM_CONV), CNN_OperList(1, KOP_TANH), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); /* Matrix Multiplication for 1x1 convolutions with channel scaling and optional ReLU or ReLUN activation, optimized form when In1 fits entirely into shared L1 */ /* 8b Bias */ LibKernel("KerParMatMulB8_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_ReLU_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_ReLUN_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_ReLUM_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_ReLUMN_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_LeakyReLU_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_HSwish_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_HSigmoid_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_Sigmoid_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB8_Tanh_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); /* 16b Bias */ LibKernel("KerParMatMulB16_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_ReLU_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_ReLUN_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_ReLUM_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_ReLUMN_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_LeakyReLU_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_HSwish_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_HSigmoid_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_Sigmoid_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB16_Tanh_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,2,0,1), 0,0,0,0,1,1)); /* 32b Bias */ LibKernel("KerParMatMulB32_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLU_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUN_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUM_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_ReLUMN_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_LeakyReLU_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_HSwish_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_HSigmoid_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_Sigmoid_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatMulB32_Tanh_SF_SQ8", CALL_PARALLEL, 0, "KerMatMul_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATMUL_SM1), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,4,0,1), 0,0,0,0,1,1)); /* Matrix by vector multiplication with tensor centric scaling and optional activation */ LibKernel("KerParMatVectMul_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_NONE), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_ReLU_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_RELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_ReLUN_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_ReLUM_SF_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_ReLUMN_SF_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_LeakyReLU_SF_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_HSwish_SF_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_HSigmoid_SF_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_Sigmoid_SF_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); LibKernel("KerParMatVectMul_Tanh_SF_SQ8", CALL_PARALLEL, 0, "KerMat3_SQ8_T", CNN_Match(CNN_OperList(1, KOP_MATVECTMUL), CNN_OperList(1, KOP_TANH), 1, CNN_Type(1,1,1,0,1), 0,0,0,0,1,1)); /* SoftMax, pre scaling */ LibKernel("KerParSoftMax_SQ8", CALL_PARALLEL, 0, "KerSoftMax_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SOFTMAX), 0, -1, CNN_Type(1,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParSoftMax8Bits_SQ8", CALL_PARALLEL, 0, "KerSoftMax_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SOFTMAX), 0, -1, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParSoftMax_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerSoftMax_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SOFTMAX), 0, -1, CNN_Type(1,0,0,0,2), 0,0,0,0,0,0)); /****************************************************************************************************************/ /* Kernels for features and coefficients on 8 bits. Kernels for a single feature evaluated in parallel */ /****************************************************************************************************************/ /* Bias setting */ LibKernel("KerSetBiasB8_SQ8", CALL_PARALLEL, 0, "KerSetBias_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 0, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerSetBiasB16_SQ8", CALL_PARALLEL, 0, "KerSetBias_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 0, CNN_Type(2,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerSetBiasB32_SQ8", CALL_PARALLEL, 0, "KerSetBias_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 0, CNN_Type(4,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerSetBiasB8_HWC_SQ8", CALL_HWC_KER|CALL_PARALLEL, 0, "KerSetBias_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 0, CNN_Type(1,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerSetBiasB16_HWC_SQ8", CALL_HWC_KER|CALL_PARALLEL, 0, "KerSetBias_SQ8_T",CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 0, CNN_Type(2,0,0,0,4), 0,0,0,0,0,0)); LibKernel("KerSetBiasB32_HWC_SQ8", CALL_HWC_KER|CALL_PARALLEL, 0, "KerSetBias_SQ8_T",CNN_Match(CNN_OperList(1, KOP_SETBIAS), 0, 0, CNN_Type(4,0,0,0,4), 0,0,0,0,0,0)); /* Convolutions with 32b output */ LibKernel("KerConv1x1Stride1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 1,1,1,1,1,1)); LibKernel("KerConv1x1Stride2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 1,1,1,1,2,2)); LibKernel("KerConv1x1StrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 1,1,1,1,-1,-2)); LibKernel("KerConv3x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 3,1,1,1,1,1)); LibKernel("KerConv3x1Stride2x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 3,1,1,1,2,1)); LibKernel("KerConv1x3Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 1,3,1,1,1,1)); LibKernel("KerConv1x3Stride1x2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 1,3,1,1,1,2)); LibKernel("KerConv3x3Stride1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 3,3,1,1,1,1)); LibKernel("KerConv3x3Stride2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 3,3,1,1,2,2)); LibKernel("KerConv3x3StrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 3,3,1,1,-1,-2)); LibKernel("KerConv5x1Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 5,1,1,1,1,1)); LibKernel("KerConv5x1Stride2x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 5,1,1,1,2,1)); LibKernel("KerConv1x5Stride1x1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 1,5,1,1,1,1)); LibKernel("KerConv1x5Stride1x2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 1,5,1,1,1,2)); LibKernel("KerConv5x5Stride1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 5,5,1,1,1,1)); LibKernel("KerConv5x5Stride2_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 5,5,1,1,2,2)); LibKernel("KerConv5x5StrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 5,5,1,1,-1,-2)); LibKernel("KerConv7x7StrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), 7,7,1,1,-1,-2)); LibKernel("KerConv1D_NStrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV1D),0,0, CNN_Type(1,1,1,0,4), -1,1,1,1,-1,1)); LibKernel("KerConvNx1StrideSxS1_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), -1,1,1,1,-1,1)); LibKernel("KerConvNxNStrideS_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), -1,-2,1,1,-1,-2)); LibKernel("KerConvNxMStrideSxSy_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), -1,-1,1,1,-1,-1)); LibKernel("KerConvNxMDxDyStrideSxSy_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV), 0, 0, CNN_Type(1,1,1,0,4), -1,-1,-1,-1,-1,-1)); /* Depth Wise Convolutions, 8b bias, 32b output */ LibKernel("KerConvDW1x1Stride1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 1,1,1,1,1,1)); LibKernel("KerConvDW1x1Stride2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 1,1,1,1,2,2)); LibKernel("KerConvDW1x1StrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 1,1,1,1,-1,-2)); LibKernel("KerConvDW3x1Stride1x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 3,1,1,1,1,1)); LibKernel("KerConvDW3x1Stride2x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 3,1,1,1,2,1)); LibKernel("KerConvDW1x3Stride1x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 1,3,1,1,1,1)); LibKernel("KerConvDW1x3Stride1x2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 1,3,1,1,1,2)); LibKernel("KerConvDW3x3Stride1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 3,3,1,1,1,1)); LibKernel("KerConvDW3x3Stride2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 3,3,1,1,2,2)); LibKernel("KerConvDW3x3StrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 3,3,1,1,-1,-2)); LibKernel("KerConvDW5x1Stride1x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 5,1,1,1,1,1)); LibKernel("KerConvDW5x1Stride2x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 5,1,1,1,2,1)); LibKernel("KerConvDW1x5Stride1x1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 1,5,1,1,1,1)); LibKernel("KerConvDW1x5Stride1x2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 1,5,1,1,1,2)); LibKernel("KerConvDW5x5Stride1B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 5,5,1,1,1,1)); LibKernel("KerConvDW5x5Stride2B8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 5,5,1,1,2,2)); LibKernel("KerConvDW5x5StrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 5,5,1,1,-1,-2)); LibKernel("KerConvDW7x7StrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), 7,7,1,1,-1,-2)); LibKernel("KerConvDWNxNStrideSB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), -1,-2,1,1,-1,-2)); LibKernel("KerConvDWNxMStrideSxSyB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), -1,-1,1,1,-1,-1)); LibKernel("KerConvDWNxMDxDyStrideSxSyB8_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T",CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,1,0,4), -1,-1,-1,-1,-1,-1)); /* Depth Wise Convolutions, 16b bias, 32b output */ LibKernel("KerConvDW1x1Stride1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 1,1,1,1,1,1)); LibKernel("KerConvDW1x1Stride2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 1,1,1,1,2,2)); LibKernel("KerConvDW1x1StrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 1,1,1,1,-1,-2)); LibKernel("KerConvDW3x1Stride1x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 3,1,1,1,1,1)); LibKernel("KerConvDW3x1Stride2x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 3,1,1,1,2,1)); LibKernel("KerConvDW1x3Stride1x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 1,3,1,1,1,1)); LibKernel("KerConvDW1x3Stride1x2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 1,3,1,1,1,2)); LibKernel("KerConvDW3x3Stride1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 3,3,1,1,1,1)); LibKernel("KerConvDW3x3Stride2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 3,3,1,1,2,2)); LibKernel("KerConvDW3x3StrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 3,3,1,1,-1,-2)); LibKernel("KerConvDW5x1Stride1x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 5,1,1,1,1,1)); LibKernel("KerConvDW5x1Stride2x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 5,1,1,1,2,1)); LibKernel("KerConvDW1x5Stride1x1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 1,5,1,1,1,1)); LibKernel("KerConvDW1x5Stride1x2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 1,5,1,1,1,2)); LibKernel("KerConvDW5x5Stride1B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 5,5,1,1,1,1)); LibKernel("KerConvDW5x5Stride2B16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 5,5,1,1,2,2)); LibKernel("KerConvDW5x5StrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 5,5,1,1,-1,-2)); LibKernel("KerConvDW7x7StrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), 7,7,1,1,-1,-2)); LibKernel("KerConvDWNxNStrideSB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), -1,-2,1,1,-1,-2)); LibKernel("KerConvDWNxMStrideSxSyB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), -1,-1,1,1,-1,-1)); LibKernel("KerConvDWNxMDxDyStrideSxSyB16_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T",CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,2,0,4), -1,-1,-1,-1,-1,-1)); /* Depth Wise Convolutions, 32b bias, 32b output */ LibKernel("KerConvDW1x1Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 1,1,1,1,1,1)); LibKernel("KerConvDW1x1Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 1,1,1,1,2,2)); LibKernel("KerConvDW1x1StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 1,1,1,1,-1,-2)); LibKernel("KerConvDW3x1Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 3,1,1,1,1,1)); LibKernel("KerConvDW3x1Stride2x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 3,1,1,1,2,1)); LibKernel("KerConvDW1x3Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 1,3,1,1,1,1)); LibKernel("KerConvDW1x3Stride1x2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 1,3,1,1,1,2)); LibKernel("KerConvDW3x3Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 3,3,1,1,1,1)); LibKernel("KerConvDW3x3Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 3,3,1,1,2,2)); LibKernel("KerConvDW3x3StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 3,3,1,1,-1,-2)); LibKernel("KerConvDW5x1Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 5,1,1,1,1,1)); LibKernel("KerConvDW5x1Stride2x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 5,1,1,1,2,1)); LibKernel("KerConvDW1x5Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 1,5,1,1,1,1)); LibKernel("KerConvDW1x5Stride1x2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 1,5,1,1,1,2)); LibKernel("KerConvDW5x5Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 5,5,1,1,1,1)); LibKernel("KerConvDW5x5Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 5,5,1,1,2,2)); LibKernel("KerConvDW5x5StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 5,5,1,1,-1,-2)); LibKernel("KerConvDW7x7StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), 7,7,1,1,-1,-2)); LibKernel("KerConvDWNxNStrideSB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), -1,-2,1,1,-1,-2)); LibKernel("KerConvDWNxMStrideSxSyB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), -1,-1,1,1,-1,-1)); LibKernel("KerConvDWNxMDxDyStrideSxSyB32_SQ8", CALL_PARALLEL, 0, "KerConv_SQ8_T",CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,4), -1,-1,-1,-1,-1,-1)); /* Depth Wise Convolutions, 32b bias, 8b output w/ reduction and activation */ LibKernel("KerConvDWRedAct3x1Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 3,1,1,1,1,1)); LibKernel("KerConvDWRedAct3x1Stride1x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 3,1,1,1,1,1)); LibKernel("KerConvDWRedAct3x1Stride1x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 3,1,1,1,1,1)); LibKernel("KerConvDWRedAct3x1Stride1x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 3,1,1,1,1,1)); LibKernel("KerConvDWRedAct3x1Stride2x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 3,1,1,1,2,1)); LibKernel("KerConvDWRedAct3x1Stride2x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 3,1,1,1,2,1)); LibKernel("KerConvDWRedAct3x1Stride2x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 3,1,1,1,2,1)); LibKernel("KerConvDWRedAct3x1Stride2x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 3,1,1,1,2,1)); LibKernel("KerConvDWRedAct1x3Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 1,3,1,1,1,1)); LibKernel("KerConvDWRedAct1x3Stride1x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 1,3,1,1,1,1)); LibKernel("KerConvDWRedAct1x3Stride1x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 1,3,1,1,1,1)); LibKernel("KerConvDWRedAct1x3Stride1x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 1,3,1,1,1,1)); LibKernel("KerConvDWRedAct1x3Stride1x2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 1,3,1,1,1,2)); LibKernel("KerConvDWRedAct1x3Stride1x2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 1,3,1,1,1,2)); LibKernel("KerConvDWRedAct1x3Stride1x2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 1,3,1,1,1,2)); LibKernel("KerConvDWRedAct1x3Stride1x2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 1,3,1,1,1,2)); LibKernel("KerConvDWRedAct3x3Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 3,3,1,1,1,1)); LibKernel("KerConvDWRedAct3x3Stride1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,1,1)); LibKernel("KerConvDWRedAct3x3Stride1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,1,1)); LibKernel("KerConvDWRedAct3x3Stride1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,1,1)); LibKernel("KerConvDWRedAct3x3Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 3,3,1,1,2,2)); LibKernel("KerConvDWRedAct3x3Stride2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,2,2)); LibKernel("KerConvDWRedAct3x3Stride2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,2,2)); LibKernel("KerConvDWRedAct3x3Stride2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,2,2)); LibKernel("KerConvDWRedAct3x3StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 3,3,1,1,-1,-2)); LibKernel("KerConvDWRedAct3x3StrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,-1,-2)); LibKernel("KerConvDWRedAct3x3StrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,-1,-2)); LibKernel("KerConvDWRedAct3x3StrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 3,3,1,1,-1,-2)); LibKernel("KerConvDWRedAct5x1Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 5,1,1,1,1,1)); LibKernel("KerConvDWRedAct5x1Stride1x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 5,1,1,1,1,1)); LibKernel("KerConvDWRedAct5x1Stride1x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 5,1,1,1,1,1)); LibKernel("KerConvDWRedAct5x1Stride1x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 5,1,1,1,1,1)); LibKernel("KerConvDWRedAct5x1Stride2x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 5,1,1,1,2,1)); LibKernel("KerConvDWRedAct5x1Stride2x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 5,1,1,1,2,1)); LibKernel("KerConvDWRedAct5x1Stride2x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 5,1,1,1,2,1)); LibKernel("KerConvDWRedAct5x1Stride2x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 5,1,1,1,2,1)); LibKernel("KerConvDWRedAct1x5Stride1x1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 1,5,1,1,1,1)); LibKernel("KerConvDWRedAct1x5Stride1x1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 1,5,1,1,1,1)); LibKernel("KerConvDWRedAct1x5Stride1x1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 1,5,1,1,1,1)); LibKernel("KerConvDWRedAct1x5Stride1x1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 1,5,1,1,1,1)); LibKernel("KerConvDWRedAct1x5Stride1x2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 1,5,1,1,1,2)); LibKernel("KerConvDWRedAct1x5Stride1x2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 1,5,1,1,1,2)); LibKernel("KerConvDWRedAct1x5Stride1x2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 1,5,1,1,1,2)); LibKernel("KerConvDWRedAct1x5Stride1x2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 1,5,1,1,1,2)); LibKernel("KerConvDWRedAct5x5Stride1B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 5,5,1,1,1,1)); LibKernel("KerConvDWRedAct5x5Stride1B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,1,1)); LibKernel("KerConvDWRedAct5x5Stride1B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,1,1)); LibKernel("KerConvDWRedAct5x5Stride1B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,1,1)); LibKernel("KerConvDWRedAct5x5Stride2B32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 5,5,1,1,2,2)); LibKernel("KerConvDWRedAct5x5Stride2B32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,2,2)); LibKernel("KerConvDWRedAct5x5Stride2B32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,2,2)); LibKernel("KerConvDWRedAct5x5Stride2B32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,2,2)); LibKernel("KerConvDWRedAct5x5StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 5,5,1,1,-1,-2)); LibKernel("KerConvDWRedAct5x5StrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,-1,-2)); LibKernel("KerConvDWRedAct5x5StrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,-1,-2)); LibKernel("KerConvDWRedAct5x5StrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 5,5,1,1,-1,-2)); LibKernel("KerConvDWRedAct7x7StrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), 7,7,1,1,-1,-2)); LibKernel("KerConvDWRedAct7x7StrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), 7,7,1,1,-1,-2)); LibKernel("KerConvDWRedAct7x7StrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), 7,7,1,1,-1,-2)); LibKernel("KerConvDWRedAct7x7StrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), 7,7,1,1,-1,-2)); LibKernel("KerConvDWRedActNxNStrideSB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerConvDWRedActNxNStrideSB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerConvDWRedActNxNStrideSB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerConvDWRedActNxNStrideSB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerConvDWRedActNxMStrideSxSyB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerConvDWRedActNxMStrideSxSyB32_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerConvDWRedActNxMStrideSxSyB32_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerConvDWRedActNxMStrideSxSyB32_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerConvDWRedActNxMDxDyStrideSxSyB32_SQ8", CALL_PARALLEL, 0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), 0, 0, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerConvDWRedActNxMDxDyStrideSxSyB32_ReLU_SQ8",CALL_PARALLEL,0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerConvDWRedActNxMDxDyStrideSxSyB32_ReLUM_SQ8",CALL_PARALLEL,0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); LibKernel("KerConvDWRedActNxMDxDyStrideSxSyB32_ReLUN_SQ8",CALL_PARALLEL,0, "KerConvRedAct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_CONV_DW), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,1,4,0,1), -1,-1,-1,-1,-1,-1)); /* Convolution, Linear output reduction with per channel scaling and optional activation. Out != In and In Place (IO) */ LibKernel("KerReduct_CC_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_NONE), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELU), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUMN), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSIGMOID), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_HSwish_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSWISH), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_LEAKYRELU), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_SIGMOID), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_Tanh_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_TANH), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_NONE), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_ReLU_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELU), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_ReLUN_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_ReLUM_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUMN), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_HSIGMOID), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HSwish_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_HSWISH), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_LEAKYRELU), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_SIGMOID), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_Tanh_SQ8", CALL_PARALLEL, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_TANH), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_NONE), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_ReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELU), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_ReLUN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_ReLUM_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUM), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_ReLUMN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_RELUMN), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_HSigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_HSIGMOID), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_HSwish_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_HSWISH), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_LeakyReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_LEAKYRELU), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_Sigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_SIGMOID), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_HWC_Tanh_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO), CNN_OperList(1, KOP_TANH), 0, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); /* Activation and reduct for CHW input and HWC output Layer Layout */ LibKernel("KerParReduct_CC_CHW2HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_ReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_ReLUN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_ReLUM_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_ReLUMN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_HSigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_HSwish_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_LeakyReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_Sigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_CHW2HWC_Tanh_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_CHW2HWC), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); /* Activation and reduct for HWC input/output Layer Layout */ LibKernel("KerParReduct_CC_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUM_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUMN_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSwish_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_LeakyReLU_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Sigmoid_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Tanh_HWC_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLU_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUN_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUM_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUMN_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSigmoid_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSwish_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_LeakyReLU_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Sigmoid_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Tanh_HWC_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLU_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUN_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUM_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUMN_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSigmoid_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSwish_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_LeakyReLU_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Sigmoid_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Tanh_HWC_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLU_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUN_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUM_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_ReLUMN_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSigmoid_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_HSwish_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_LeakyReLU_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Sigmoid_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerParReduct_CC_Tanh_HWC_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); /* Activation and Reduct without PerChannel Scaling */ LibKernel("KerReduct_CC_NoScale_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUM_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUMN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_HSigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_HSwish_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_LeakyReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_Sigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_Tanh_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLU_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUN_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUM_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUMN_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_HSigmoid_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_HSwish_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_LeakyReLU_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_Sigmoid_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_Tanh_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); /* Unsigned */ LibKernel("KerReduct_CC_NoScale_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLU_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUN_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUM_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUMN_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_HSigmoid_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_HSwish_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_LeakyReLU_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_Sigmoid_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_Tanh_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLU_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUN_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUM_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_ReLUMN_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_HSigmoid_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_HSwish_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_LeakyReLU_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_Sigmoid_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReduct_CC_NoScale_Tanh_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_NOSCALE), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); /* Activation and Reduct without PerChannel Scaling */ LibKernel("KerReductIO_CC_NoScale_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUM_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUMN_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_HSigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_HSwish_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_LeakyReLU_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_Sigmoid_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_Tanh_SQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLU_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUN_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUM_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUMN_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_HSigmoid_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_HSwish_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_LeakyReLU_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_Sigmoid_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_Tanh_SQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,2), 0,0,0,0,0,0)); /* Unsigned */ LibKernel("KerReductIO_CC_NoScale_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLU_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUN_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUM_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUMN_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_HSigmoid_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_HSwish_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_LeakyReLU_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_Sigmoid_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_Tanh_USQ8", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,-1), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_NONE), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLU_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELU), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUN_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUN), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUM_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUM), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_ReLUMN_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_RELUMN), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_HSigmoid_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_HSIGMOID), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_HSwish_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_HSWISH), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_LeakyReLU_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_LEAKYRELU), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_Sigmoid_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_SIGMOID), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); LibKernel("KerReductIO_CC_NoScale_Tanh_USQ16", CALL_PARALLEL|CALL_HWC_KER, 0, "KerConvLinReduct_SQ8_T", CNN_Match(CNN_OperList(1, KOP_DP_REDUCT_IO_NOSCALE), CNN_OperList(1, KOP_TANH), 1, CNN_Type(4,0,0,0,-2), 0,0,0,0,0,0)); /* Activations with tensor centric scaling */ LibKernel("Ker_ActNone_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_ACT_NONE), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_ReLU_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_RELU), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_ReLUN_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_RELUN), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_ReLUM_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_RELUM), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_ReLUMN_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_RELUMN), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_HSigmoid_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_HSIGMOID), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_HSwish_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_HSWISH), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_LeakyReLU_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_LEAKYRELU),0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_Sigmoid_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_SIGMOID), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); LibKernel("Ker_Tanh_SQ8", CALL_PARALLEL, 0, "KerActivation_SQ8_T", CNN_Match(CNN_OperList(1, KOP_TANH), 0, 0, CNN_Type(1,0,0,0,1), 0,0,0,0,0,0)); /* Pooling (Max or Avg) with tensor centric scaling and optional ReLU or ReLUN activation */ LibKernel("KerPool2x2Stride2_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 0, CNN_Type(1,0,0,0,1), 2,2,1,1,2,2)); LibKernel("KerPool2x2Stride2_ReLU_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,0,0,0,1), 2,2,1,1,2,2)); LibKernel("KerPool2x2Stride2_ReLUN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,0,0,0,1), 2,2,1,1,2,2)); LibKernel("KerPoolNxNStrideS_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 0, CNN_Type(1,0,0,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerPoolNxNStrideS_ReLU_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,0,0,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerPoolNxNStrideS_ReLUN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,0,0,0,1), -1,-2,1,1,-1,-2)); LibKernel("KerPoolNxMStrideSxSy_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_NONE), 0, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPoolNxMStrideSxSy_ReLU_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELU), 0, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LibKernel("KerPoolNxMStrideSxSy_ReLUN_SQ8", CALL_PARALLEL, 0, "KerPool_SQ8_T", CNN_Match(CNN_OperList(2, KOP_MAXPOOL, KOP_AVGPOOL), CNN_OperList(1, KOP_RELUN), 0, CNN_Type(1,0,0,0,1), -1,-1,1,1,-1,-1)); LoadCNN_Copy_Library(); } /********************************************************************************************************************************************************************* Generator for Convolutions with channel centric scaling, followed by an optional pooling (Max or Average), followed by an optional Activation. Imm2Col based Template: Name: Name of the generated user kernel Ctrl: Overide generator default options (TileOrientation, Parallel Features, Use HWCE), Def=(TILE_HOR, 1, 0) Bias_DataSize: 1: byte, 2: half word, 4: word Scale_DataSize: 1: byte, 2: half word, 4: word InFeat: Number of input feature's maps OutFeat: Number of output feature's maps Width: Number of columns of a given feature map Height: Number of lines of a given feature map ConvOper: Type of convolution, Regular convolution: KOP_CONV, KOP_CONV_DP, Depth wise convolution: KOP_CONV_DW Fcx: Convolution filter x dimension Fcy: Convolution filter y dimension Dcx: Convolution filter dilation factor, x dimension Dcy: Convolution filter dilation factor, y dimension Scx: Convolution filter stride x dimension Scy: Convolution filter stride y dimension ConvPad: 0: No padding, 1: Zero padding PoolOper: Type of Pooling, KOP_NONE, Max Pooling: KOP_MAXPOOL, Average Pooling: KOP_AVGPOOL Fpx: Pooling filter x dimension Fpy: Pooling filter y dimension Dpx: Pooling filter dilation factor, x dimension Dpy: Pooling filter dilation factor, y dimension Spx: Pooling filter stride x dimension Spy: Pooling filter stride y dimension PoolPad: 0: No padding, 1: Zero padding ActOper: Optional activation function: KOP_NONE, KOP_RELU, KOP_RELUN, KOP_HSWISH, KOP_HSIGMOID, KOP_LEAKYRELU, KOP_SIGMOID, KOP_TANH Signature: Name(In, Filter, Bias, Out, Scale, ScaleN, Infos) CNN_MM_ConvolutionPoolAct_SQ8 *********************************************************************************************************************************************************************/ static Kernel_T *CNN_MM_ConvolutionPoolAct_SQ8_Internal( char *Name, CNN_GenControl_T *Ctrl, int Bias_DataSize, int Scale_DataSize, int InFeat, int OutFeat, int Width, int Height, KernelOper_T ConvOper, int Fcx, int Fcy, int Dcx, int Dcy, int Scx, int Scy, int ConvPad, KernelOper_T PoolOper, int Fpx, int Fpy, int Dpx, int Dpy, int Spx, int Spy, int PoolPad, KernelOper_T ActOper ) { if (ConvOper==KOP_NONE) { if (PoolOper!=KOP_NONE) return CNN_PoolAct_SQ8_Internal(Name, Ctrl, InFeat, Width, Height, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, ActOper); else if (ActOper!=KOP_NONE) return CNN_Act_SQ8_Internal(Name, Ctrl, InFeat, Width, Height, ActOper); else GenTilingError("CNN_MM_ConvolutionPoolAct_SQ8 Kernel: %s, All requested operations are KOP_NONE", Name); } int ParFeat = 1, HWC = 0, ParFeatConv = 2; int CustomInfos = 0; Tile_Orientation_T TileOrientation = TILE_HOR; AT_PadType PadType = PAD_BALANCED_LEFT; // In HWC only you can have cases where you must tile also the input feature, in CHW if you fail the entire infeat solution then go back to the normal (non-MM) implementation // unsigned int InFeatProp = (InFeatOneTile!=0)?SPACE_PROP_ONE_TILE:0; if (PoolOper==KOP_NONE) { Fpx=1; Dpx=1; Spx=1; Fpy=1; Dpy=1; Spy=1; } if (Ctrl) { if (Ctrl->TileOrientation != -1) TileOrientation = (Ctrl->TileOrientation==0)?TILE_HOR:TILE_VER; if (Ctrl->PadType != -1) PadType = Ctrl->PadType; if (Ctrl->HWC) HWC = 1; if (Ctrl->ParallelFeatures != -1) ParFeatConv = Ctrl->ParallelFeatures; if (ActOper == KOP_CUSTOM) { CustomInfos = Ctrl->CustomActivationInfos; } } if (HWC && Fcy==1 && Fcx==1 && Scy==1 && Scx==1 && Dcy==1 && Dcx==1 && (PoolOper==KOP_NONE)) return CNN_MatMulAct_SQ8_Internal(Name, Ctrl, Bias_DataSize, Scale_DataSize, 1, InFeat, Height*Width, OutFeat, InFeat, 0,0,0,0, KOP_MATMUL_TRANSPOSED, ActOper, 0); if (ParFeatConv == 2 && HWC && Fcy>1 && (InFeat < 8)) ParFeatConv = 0; else ParFeatConv = 1; unsigned int Bs = Bias_DataSize; KernelOper_T COper = ConvOper; int OverlapC, OverlapP; int TileCons; int Wo, Ho, Wc, Hc; int PadCw=0, PadCh=0, PadPw=0, PadPh=0; v4s PadInp = (v4s){0,0,0,0}, PadInc = (v4s){0,0,0,0}, PadIncT = (v4s){0,0,0,0}; char *ConvKerName=0, *PoolKerName=0, *ActKerName=0; int NeedFcx, NeedFcy, NeedDcx, NeedDcy, NeedScx, NeedScy, NeedFpx, NeedFpy, NeedDpx, NeedDpy, NeedSpx, NeedSpy; int UsedWidth, UsedHeight, UsedWc, UsedHc; int StandAloneAct = (ActOper!=KOP_NONE); unsigned long long int LayerOp = 0; unsigned long long int LayerBandwidth = 0; int Log=1; int DWConv = ConvOper == KOP_CONV_DW; int Os = DWConv?D0:D1; if ((ConvOper != KOP_CONV) && (ConvOper != KOP_CONV_DW)) GenTilingError("CNN_MM_ConvolutionPoolAct_SQ8 Kernel: %s, ConvOper, expecting KOP_CONV, KOP_CONV_DW", Name); if (!(PoolOper == KOP_NONE || PoolOper == KOP_MAXPOOL || PoolOper == KOP_AVGPOOL)) GenTilingError("CNN_MM_ConvolutionPoolAct_SQ8 Kernel: %s, PoolOper, expecting KOP_NONE, KOP_MAXPOOL or KOP_AVGPOOL", Name); if (!(ActOper == KOP_NONE || ActOper == KOP_CUSTOM || ActOper == KOP_RELU || ActOper == KOP_RELUN || ActOper == KOP_RELUM || ActOper == KOP_RELUMN || ActOper == KOP_HSIGMOID || ActOper == KOP_HSWISH || ActOper == KOP_LEAKYRELU || ActOper == KOP_SIGMOID || ActOper == KOP_TANH)) GenTilingError("CNN_MM_ConvolutionPoolAct_SQ8 Kernel: %s, ActOper, expecting KOP_NONE, KOP_RELU, KOP_RELUN, KOP_HSIGMOID, KOP_TANH, KOP_HSWISH or KOP_LEAKYRELU", Name); if (DWConv && (InFeat != OutFeat)) GenTilingError("CNN_ConvolutionPoolAct_NE16 Kernel: %s, Depth wise convolution requested with InFeat:%d != OutFeat:%d", Name, InFeat, OutFeat); CNN_LayerOutputDim(Width, Height, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, ConvPad, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, &Wc, &Hc, &Wo, &Ho, &PadCw, &PadCh, &PadPw, &PadPh); PadInc = CNN_EdgePaddingValue(PadType, PadCw, PadCh); PadInp = CNN_EdgePaddingValue(PadType, PadPw, PadPh); /* Pad value for tiling, need to accrue phantom values created for Pool padding */ PadIncT = (v4s) {PadInp[0]*Scx+PadInc[0], PadInp[1]*Scx+PadInc[1], PadInp[2]*Scy+PadInc[2], PadInp[3]*Scy+PadInc[3]}; CNN_TileOverlap(TileOrientation, Fcx, Fcy, Dcx, Dcy, Scx, Scy, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &OverlapC, &OverlapP); UsedWc = CNN_UsedInputDimension(Wo, Fpx, Spx, Dpx, PadPw); UsedHc = CNN_UsedInputDimension(Ho, Fpy, Spy, Dpy, PadPh); UsedWidth = CNN_UsedInputDimension(UsedWc, Fcx, Scx, Dcx, PadCw); UsedHeight = CNN_UsedInputDimension(UsedHc, Fcy, Scy, Dcy, PadCh); TileCons = (TileOrientation==TILE_HOR)?CNN_Scm(Scy, Spy):CNN_Scm(Scx, Spx); /* Re evaluate now that we know exactly what is used */ PadInc[1] = Max(0, PadInc[1]-(Width-UsedWidth)); PadInc[3] = Max(0, PadInc[3]-(Height-UsedHeight)); PadInp[1] = Max(0, PadInp[1]-(Wc-UsedWc)); PadInp[3] = Max(0, PadInp[3]-(Hc-UsedHc)); PadIncT = (v4s) {PadInp[0]*Scx+PadInc[0], PadInp[1]*Scx+PadInc[1], PadInp[2]*Scy+PadInc[2], PadInp[3]*Scy+PadInc[3]}; UsedWc = (Wo-1)*Spx+(Dpx*(Fpx-1)+1)-PadInp[0]-PadInp[1]; UsedHc = (Ho-1)*Spy+(Dpy*(Fpy-1)+1)-PadInp[2]-PadInp[3]; UsedWidth = (UsedWc-1)*Scx+(Dcx*(Fcx-1)+1) -PadInc[0]-PadInc[1]; UsedHeight = (UsedHc-1)*Scy+(Dcy*(Fcy-1)+1)-PadInc[2]-PadInc[3]; Wc = UsedWc; Hc = UsedHc; int KerLayout = HWC?CALL_HWC_KER:0; int BuffS = ALIGN(InFeat*Fcx*Fcy, 3); if (HWC) { if (Fcx==1&&Fcy==1) BuffS = 1; else if (ParFeatConv) BuffS = 2*ALIGN(InFeat*Fcx*Fcy, 3); else BuffS = 2 * InFeat*Fcx*Fcy*8; } /* Layer number of operations and memory bandwidth requirements */ LayerOp += (int64_t) Wc*Hc*Fcx*Fcy*OutFeat; if (!DWConv) LayerOp *= InFeat; if (PoolOper) LayerOp += (int64_t) OutFeat*Wo*Ho*Fpx*Fpy; if (ActOper) LayerOp += (int64_t) OutFeat*Wo*Ho; LayerBandwidth += (int64_t) Width*Height*1*InFeat*(DWConv?1:OutFeat); LayerBandwidth += (int64_t) Wo*Ho*1*OutFeat; LayerBandwidth += (int64_t) Fcx*Fcy*1*InFeat*(DWConv?1:OutFeat); LayerBandwidth += (int64_t) Bias_DataSize*OutFeat; ConvKerName = CNN_FindMatchingKernelAttr(DWConv?KOP_MM_CONV_DW:KOP_MM_CONV, (PoolOper==KOP_NONE)?ActOper:KOP_NONE, ParFeatConv, KerLayout, 1, 1, Bias_DataSize, 0, 1, Fcx, Fcy, Dcx, Dcy, Scx, Scy, &NeedFcx, &NeedFcy, &NeedDcx, &NeedDcy, &NeedScx, &NeedScy, 0); if (ConvKerName) { if (PoolOper==KOP_NONE) StandAloneAct = 0; } else ConvKerName = CNN_FindMatchingKernelAttr(DWConv?KOP_MM_CONV_DW:KOP_MM_CONV, KOP_NONE, ParFeatConv, KerLayout, 1, 1, Bias_DataSize, 0, 1, Fcx, Fcy, Dcx, Dcy, Scx, Scy, &NeedFcx, &NeedFcy, &NeedDcx, &NeedDcy, &NeedScx, &NeedScy, 0); if (ConvKerName==0) GenTilingError("CNN_MM_ConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Convolution basic kernel", Name); if (PoolOper!=KOP_NONE) { PoolKerName = CNN_FindMatchingKernelAttr(PoolOper, ActOper, ParFeat, KerLayout, 1, 0, 0, 0, 1, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &NeedFpx, &NeedFpy, &NeedDpx, &NeedDpy, &NeedSpx, &NeedSpy, 0); if (PoolKerName==0) PoolKerName = CNN_FindMatchingKernelAttr(PoolOper, KOP_NONE, ParFeat, KerLayout, 1, 0, 0, 0, 1, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &NeedFpx, &NeedFpy, &NeedDpx, &NeedDpy, &NeedSpx, &NeedSpy, 0); else if (ActOper) StandAloneAct = 0; else if (PoolOper==KOP_AVGPOOL && ActOper==KOP_NONE && HWC) { StandAloneAct = 1; ActOper = KOP_ACT_NONE; } if (PoolKerName==0) GenTilingError("CNN_MM_ConvolutionPoolAct_SQ8: %s, Can't find a matching Pooling %s basic kernel", Name, ActOper?"with linear rectification":""); } if (ActOper && StandAloneAct) { if (ActOper == KOP_CUSTOM) { if (!Ctrl||!Ctrl->CustomActivationName) GenTilingError("CNN_MM_ConvolutionPoolAct_SQ8: %s, ActOper is KOP_CUSTOM but no kernel name supplied", Name); ActKerName = Ctrl->CustomActivationName; } else { ActKerName = CNN_FindMatchingKernelAttr(ActOper, KOP_NONE, 0, 0, 1, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (ActKerName==0) GenTilingError("CNN_MM_ConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Activation basic kernel", Name); } } if (Log) { GenTilingDebug("InFeat: %d, OutFeat: %d%s%s\n", InFeat, OutFeat, HWC?", HWC":", CHW", ParFeatConv?", Out Chan Parallel":", H Parallel"); GenTilingDebug("Conv => W: %d, Pad:[%d,%d] PadT:[%d,%d] => Wc: %d, Filter:[%d,%d]\n", Width, PadInc[0], PadInc[1], PadIncT[0], PadIncT[1], Wc, Fcx, Fcy); GenTilingDebug(" => H: %d, Pad:[%d,%d] PadT:[%d,%d] => Hc: %d\n", Height, PadInc[2], PadInc[3], PadIncT[2], PadIncT[3], Hc); GenTilingDebug("Pool => Wc: %d, Pad:[%d,%d] => Wo: %d, Filter:[%d,%d]\n", Wc, PadInp[0], PadInp[1], Wo, Fpx, Fpy); GenTilingDebug(" => Hc: %d, Pad:[%d,%d] => Ho: %d\n", Hc, PadInp[2], PadInp[3], Ho); GenTilingDebug("OverlapC: %d\n", OverlapC); GenTilingDebug("OverlapP: %d\n", OverlapP); GenTilingDebug("TileCons: %d\n", TileCons); GenTilingDebug("UsedIn : [%d x %d]\n", UsedWidth, UsedHeight); GenTilingDebug("UsedC : [%d x %d]\n", UsedWc, UsedHc); if (ConvKerName) GenTilingDebug("%20s: %s\n", "ConvKerName", ConvKerName); if (PoolKerName) GenTilingDebug("%20s: %s\n", "PoolKerName", PoolKerName); if (ActKerName) GenTilingDebug("%20s: %s\n", "ActKerName", ActKerName); GenTilingDebug("Nb Oper : %lld\n", LayerOp); } int OutTileCons = 8; int TileFirst = 0; // ((InFeat*OutFeat*Fcx*Fcy) < (InFeat*Width*Height)); Kernel_T *Kernel = UserKernel(Name, DWConv? KernelIterSpace(2, IterParSpace(D0, InFeat, OutTileCons), IterTiledSpace(T0)): TileFirst? KernelIterSpace(3, IterTiledSpace(T0), IterParSpace(D1, OutFeat, OutTileCons), IterParSpace(D0|SPACE_PROP_ONE_TILE, InFeat, InFeat)): KernelIterSpace(3, IterParSpace(D1, OutFeat, OutTileCons), IterTiledSpace(T0), IterParSpace(D0|SPACE_PROP_ONE_TILE, InFeat, InFeat)), TileOrientation, CArgs(8, TCArg(CNN_ArgDataType(1,1,1), "In"), TCArg(CNN_ArgDataType(1,1,1), "Filter"), TCArg(CNN_ArgDataType(Bs,1,1), "Bias"), TCArg(CNN_ArgDataType(1,1,1), "Out"), TCArg(CNN_ArgDataTypeUns(1,1,1),"Scale"), TCArg(CNN_ArgDataType(1,1,1),"ScaleN"), TCArg(CNN_ArgDataType(1,1,1), "Infos"), (CustomInfos)?TCArg(CNN_ArgDataType(1,1,1), "CustomInfos"):AT_NO_C_ARG ), Calls(3, Call(ConvKerName, DWConv?LOC_LOOP:LOC_D0, Bindings(22, K_Arg("In", KER_ARG_TILE), K_Arg("In", KER_ARG_TILE_W), K_Arg("In", KER_ARG_TILE_H), NeedFcx?Imm(Fcx):AT_IGNORE_ARG_BINDING, /* Conv Fx */ NeedFcy?Imm(Fcy):AT_IGNORE_ARG_BINDING, /* Conv Fy */ NeedScx?Imm(Scx):AT_IGNORE_ARG_BINDING, /* Conv Stridex */ NeedScy?Imm(Scy):AT_IGNORE_ARG_BINDING, /* Conv Stridey */ NeedDcx?Imm(Dcx):AT_IGNORE_ARG_BINDING, /* Conv x dilation */ NeedDcy?Imm(Dcy):AT_IGNORE_ARG_BINDING, /* Conv y dilation */ K_ArgPred("In", KER_ARG_TILEFIRST, T0), /* First Tile */ K_Arg("In", KER_ARG_TILE_PAD), /* Conv Padding */ K_Arg("Filter", KER_ARG_TILE), K_Arg("Bias", KER_ARG_TILE), K_Arg(PoolKerName?"ConvOut":"Out", KER_ARG_TILE), DWConv?K_ArgPar(PoolKerName?"ConvOut":"Out", KER_ARG_PARTILE_SIZE, Os):Imm(InFeat), /* In Features */ K_ArgPar(PoolKerName?"ConvOut":"Out", KER_ARG_PARTILE_SIZE, Os), /* Out Features */ K_Arg(PoolKerName?"ConvOut":"Out", KER_ARG_TILE_W), K_Arg(PoolKerName?"ConvOut":"Out", KER_ARG_TILE_H), K_Arg("Scale", KER_ARG_TILE), K_Arg("ScaleN", KER_ARG_TILE), K_Arg("KerBuff", KER_ARG_TILE), K_Arg("Infos", KER_ARG_TILE) ) ), (PoolKerName==0)?AT_NO_CALL: Call(PoolKerName, DWConv?LOC_LOOP:LOC_D0_EPILOG, (HWC==0)? Bindings(18, K_Arg("ConvOut", KER_ARG_TILE), /* Pooling input tile */ K_Arg("ConvOut", KER_ARG_TILE_W), /* Pooling input tile width */ K_Arg("ConvOut", KER_ARG_TILE_USEDW), /* Pooling input tile width, used part of it */ K_Arg("ConvOut", KER_ARG_TILE_H), /* Pooling input tile height */ K_Arg("ConvOut", KER_ARG_TILE_USEDH), /* Pooling input tile height, used part of it */ K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, Os), /* Number of output features in this tile */ K_Arg("Out", KER_ARG_TILE), /* Pooling output tile */ K_Arg("ConvOut", KER_ARG_TILE_PAD), /* Pooling Pad */ NeedFpx?Imm(Fpx):AT_IGNORE_ARG_BINDING, /* Pooling Fx */ NeedSpx?Imm(Spx):AT_IGNORE_ARG_BINDING, /* Pooling Stridex */ NeedDpx?Imm(Dpx):AT_IGNORE_ARG_BINDING, /* Pooling Dx */ NeedFpy?Imm(Fpy):AT_IGNORE_ARG_BINDING, /* Pooling Fy */ NeedSpy?Imm(Spy):AT_IGNORE_ARG_BINDING, /* Pooling Stridey */ NeedDpy?Imm(Dpy):AT_IGNORE_ARG_BINDING, /* Pooling Dy */ Imm((PoolOper==KOP_MAXPOOL)?1:0), /* PoolMax or PoolAverage */ AT_IGNORE_ARG_BINDING, /* Pooling Orientation when feature parallel */ Imm((ActOper==KOP_NONE)), /* Scaling when no activation */ K_Arg("Infos", KER_ARG_TILE) /* Infos */ ): Bindings(14, K_Arg("ConvOut", KER_ARG_TILE), /* Input tile */ K_Arg("ConvOut", KER_ARG_TILE_W), /* Input tile width */ K_Arg("ConvOut", KER_ARG_TILE_H), /* Input tile height */ NeedFpx?Imm(Fpx):AT_IGNORE_ARG_BINDING, /* Pool Fx */ NeedFpy?Imm(Fpy):AT_IGNORE_ARG_BINDING, /* Pool Fy */ NeedSpx?Imm(Spx):AT_IGNORE_ARG_BINDING, /* Pool Stridex */ NeedSpy?Imm(Spy):AT_IGNORE_ARG_BINDING, /* Pool Stridey */ K_ArgPred("ConvOut", KER_ARG_TILEFIRST, T0), /* First Tile */ K_Arg("ConvOut", KER_ARG_TILE_PAD), /* Pool Padding */ K_Arg("Out", KER_ARG_TILE), /* Pooling output tile */ K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, Os), /* In Features */ K_Arg("Out", KER_ARG_TILE_W), /* Output tile width */ K_Arg("Out", KER_ARG_TILE_H), /* Output tile height */ K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ), (ActKerName==0)?AT_NO_CALL: Call(ActKerName, DWConv?LOC_LOOP:LOC_D0_EPILOG, Bindings(6, K_Arg("Out", KER_ARG_TILE), /* Input tile */ K_Arg("Out", KER_ARG_TILE), /* Output tile */ K_ArgPar("Out", KER_ARG_PARTILE_SIZE, Os), /* Number of Features */ K_Arg("Out", KER_ARG_TILE_W), /* Input tile width */ K_Arg("Out", KER_ARG_TILE_H), /* Input tile height */ (ActOper==KOP_CUSTOM)?((CustomInfos)?K_Arg("CustomInfos", KER_ARG_TILE):AT_NO_ARG_BINDING):K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ) ), (HWC==0)? KerArgs(10, KerArg ("KerBuff",KerArgSpace(1,T0), O_BUFF|O_NTILED, BuffS, 1, 1, 0, 0, 0, 0), KerArgP("In", KerArgSpace(2,D0,T0), O_IN|O_DB, Width, Height, UsedWidth, UsedHeight, PadIncT, PadInc, 1, OverlapC, 0, TileCons, "In"), KerArg ("Bias", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, Bs, 0, 0, 0, "Bias"), KerArg ("Scale", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "Scale"), KerArg ("ScaleN", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "ScaleN"), DWConv? KerArg ("Filter", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, Fcx, Fcy, 1, 0, 0, 0, "Filter"): KerArg ("Filter", KerArgSpace(2,Os,D0), O_IN|O_DB|O_CONST, Fcx, Fcy, 1, 0, 0, 0, "Filter"), KerArg ("Out", KerArgSpace(2,Os,T0), O_OUT|O_DB, Wo, Ho, 1, 0, 0, 0, "Out"), (PoolKerName==0)?AT_NO_KER_ARG: KerArgP("ConvOut",KerArgSpace(2,Os,T0), O_BUFF|O_ONETILE, Wc, Hc, UsedWc, UsedHc, PadInp, PadInp, 1, OverlapP, 0, 0, ""), KerArg ("Infos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED, 1, 1, AT_INF_DIM, 0, 0, 0, "Infos"), (CustomInfos)?KerArg ("CustomInfos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED, 1, 1, CustomInfos, 0, 0, 0, "CustomInfos"):AT_NO_KER_ARG ): KerArgs(10, KerArg ("KerBuff",KerArgSpace(1,T0), O_BUFF|O_NTILED, BuffS, 1, 1, 0, 0, 0, 0), KerArgP("In", KerArgSpace(2,T0,D0), O_IN|O_DB, Width, Height, UsedWidth, UsedHeight, PadIncT, PadInc, 1, OverlapC, 0, TileCons, "In"), KerArg ("Bias", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, Bs, 0, 0, 0, "Bias"), KerArg ("Scale", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "Scale"), KerArg ("ScaleN", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "ScaleN"), DWConv? KerArg ("Filter", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, Fcx, Fcy, 1, 0, 0, 0, "Filter"): KerArg ("Filter", KerArgSpace(2,Os,D0), O_IN|O_DB|O_CONST, Fcx, Fcy, 1, 0, 0, 0, "Filter"), KerArg ("Out", KerArgSpace(2,T0,Os), O_OUT|O_DB, Wo, Ho, 1, 0, 0, 0, "Out"), (PoolKerName==0)?AT_NO_KER_ARG: KerArgP("ConvOut",KerArgSpace(2,T0,Os), O_BUFF|O_ONETILE, Wc, Hc, UsedWc, UsedHc, PadInp, PadInp, 1, OverlapP, 0, 0, ""), KerArg ("Infos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED, 1, 1, AT_INF_DIM, 0, 0, 0, "Infos"), (CustomInfos)?KerArg ("CustomInfos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED, 1, 1, CustomInfos, 0, 0, 0, "CustomInfos"):AT_NO_KER_ARG ) ); if (Kernel) { AddKernelInfos(Name, AT_KERINFO_OPER, LayerOp, 0); AddKernelInfos(Name, AT_KERINFO_BANDWIDTH, LayerBandwidth, 0); AddKernelArgDim(Name, "In", 4, Height, Width, InFeat, 1); AddKernelArgDim(Name, "Filter", 5, OutFeat, InFeat, Fcx, Fcy, 1); AddKernelArgDim(Name, "Bias", 2, OutFeat, Bias_DataSize); AddKernelArgDim(Name, "Out", 4, Ho, Wo, OutFeat, 1); AddKernelArgDim(Name, "Scale", 2, OutFeat, 1); AddKernelArgDim(Name, "ScaleN", 2, OutFeat, 1); AddKernelArgDim(Name, "Infos", 2, AT_INF_DIM, 1); if (CustomInfos) AddKernelArgDim(Name, "CustomInfos", 2, CustomInfos, 1); if (Ctrl && (Ctrl->Out_L3)) SetKerArgInL3(Name, "Out"); if (Ctrl && (Ctrl->Filter_L3)) SetKerArgInL3(Name, "Filter"); AT_PrepareForTest_SQ8(Name, InFeat, OutFeat, Width, Height, Bias_DataSize, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, PadInc, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PadInp, ActOper); } return Kernel; } static Kernel_T *CNN_HWC_DWConvolutionPoolAct_SQ8_Internal( char *Name, CNN_GenControl_T *Ctrl, int Bias_DataSize, int Scale_DataSize, int InFeat, int OutFeat, int Width, int Height, KernelOper_T ConvOper, int Fcx, int Fcy, int Dcx, int Dcy, int Scx, int Scy, int ConvPad, KernelOper_T PoolOper, int Fpx, int Fpy, int Dpx, int Dpy, int Spx, int Spy, int PoolPad, KernelOper_T ActOper ) { if (ConvOper==KOP_NONE) { if (PoolOper!=KOP_NONE) return CNN_PoolAct_SQ8_Internal(Name, Ctrl, InFeat, Width, Height, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, ActOper); else if (ActOper!=KOP_NONE) return CNN_Act_SQ8_Internal(Name, Ctrl, InFeat, Width, Height, ActOper); else GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, All requested operations are KOP_NONE", Name); } int ParFeat = 1, HWC = 1; Tile_Orientation_T TileOrientation = TILE_HOR; AT_PadType PadType = PAD_BALANCED_LEFT; int CustomInfos = 0; if (PoolOper==KOP_NONE) { Fpx=1; Dpx=1; Spx=1; Fpy=1; Dpy=1; Spy=1; } if (Ctrl) { if (Ctrl->TileOrientation != -1) TileOrientation = (Ctrl->TileOrientation==0)?TILE_HOR:TILE_VER; if (Ctrl->PadType != -1) PadType = Ctrl->PadType; if (ActOper == KOP_CUSTOM) { CustomInfos = Ctrl->CustomActivationInfos; } } unsigned int Bs = Bias_DataSize; KernelOper_T COper = ConvOper; int OverlapC, OverlapP; int TileCons; int Wo, Ho, Wc, Hc; int PadCw=0, PadCh=0, PadPw=0, PadPh=0; v4s PadInp = (v4s){0,0,0,0}, PadInc = (v4s){0,0,0,0}, PadIncT = (v4s){0,0,0,0}; char *MatPermKerName=0, *ConvKerName=0, *DPReductionKerName=0, *PoolKerName=0, *ActKerName=0; int NeedFcx, NeedFcy, NeedDcx, NeedDcy, NeedScx, NeedScy, NeedFpx, NeedFpy, NeedDpx, NeedDpy, NeedSpx, NeedSpy; int UsedWidth, UsedHeight, UsedWc, UsedHc; int StandAloneAct = (ActOper!=KOP_NONE); unsigned long long int LayerOp = 0; unsigned long long int LayerBandwidth = 0; int Log=1; if (ConvOper != KOP_CONV_DW) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, ConvOper, expecting KOP_CONV", Name); if (!(PoolOper == KOP_NONE || PoolOper == KOP_MAXPOOL || PoolOper == KOP_AVGPOOL)) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, PoolOper, expecting KOP_NONE, KOP_MAXPOOL or KOP_AVGPOOL", Name); if (!(ActOper == KOP_NONE || ActOper == KOP_CUSTOM || ActOper == KOP_RELU || ActOper == KOP_RELUN || ActOper == KOP_RELUM || ActOper == KOP_RELUMN || ActOper == KOP_HSIGMOID || ActOper == KOP_HSWISH || ActOper == KOP_LEAKYRELU)) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, ActOper, expecting KOP_NONE, KOP_RELU, KOP_RELUN, KOP_HSIGMOID, KOP_TANH, KOP_HSWISH or KOP_LEAKYRELU", Name); if (InFeat != OutFeat) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, Depth wise convolution requested with InFeat:%d != OutFeat:%d", Name, InFeat, OutFeat); CNN_LayerOutputDim(Width, Height, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, ConvPad, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, &Wc, &Hc, &Wo, &Ho, &PadCw, &PadCh, &PadPw, &PadPh); PadInc = CNN_EdgePaddingValue(PadType, PadCw, PadCh); PadInp = CNN_EdgePaddingValue(PadType, PadPw, PadPh); /* Pad value for tiling, need to accrue phantom values created for Pool padding */ PadIncT = (v4s) {PadInp[0]*Scx+PadInc[0], PadInp[1]*Scx+PadInc[1], PadInp[2]*Scy+PadInc[2], PadInp[3]*Scy+PadInc[3]}; CNN_TileOverlap(TileOrientation, Fcx, Fcy, Dcx, Dcy, Scx, Scy, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &OverlapC, &OverlapP); UsedWc = CNN_UsedInputDimension(Wo, Fpx, Spx, Dpx, PadPw); UsedHc = CNN_UsedInputDimension(Ho, Fpy, Spy, Dpy, PadPh); UsedWidth = CNN_UsedInputDimension(UsedWc, Fcx, Scx, Dcx, PadCw); UsedHeight = CNN_UsedInputDimension(UsedHc, Fcy, Scy, Dcy, PadCh); TileCons = (TileOrientation==TILE_HOR)?CNN_Scm(Scy, Spy):CNN_Scm(Scx, Spx); /* Re evaluate now that we know exactly what is used */ PadInc[1] = Max(0, PadInc[1]-(Width-UsedWidth)); PadInc[3] = Max(0, PadInc[3]-(Height-UsedHeight)); PadInp[1] = Max(0, PadInp[1]-(Wc-UsedWc)); PadInp[3] = Max(0, PadInp[3]-(Hc-UsedHc)); PadIncT = (v4s) {PadInp[0]*Scx+PadInc[0], PadInp[1]*Scx+PadInc[1], PadInp[2]*Scy+PadInc[2], PadInp[3]*Scy+PadInc[3]}; UsedWc = (Wo-1)*Spx+(Dpx*(Fpx-1)+1)-PadInp[0]-PadInp[1]; UsedHc = (Ho-1)*Spy+(Dpy*(Fpy-1)+1)-PadInp[2]-PadInp[3]; UsedWidth = (UsedWc-1)*Scx+(Dcx*(Fcx-1)+1) -PadInc[0]-PadInc[1]; UsedHeight = (UsedHc-1)*Scy+(Dcy*(Fcy-1)+1)-PadInc[2]-PadInc[3]; Wc = UsedWc; Hc = UsedHc; int KerLayout = HWC?CALL_HWC_KER:0; int DP_OP = HWC?KOP_DP_REDUCT_CHW2HWC:KOP_DP_REDUCT; int BuffS = InFeat*Fcx*Fcy; /* Layer number of operations and memory bandwidth requirements */ LayerOp += (int64_t) Wc*Hc*Fcx*Fcy*InFeat; if (PoolOper) LayerOp += (int64_t) InFeat*Wo*Ho*Fpx*Fpy; if (ActOper) LayerOp += (int64_t) InFeat*Wo*Ho; LayerBandwidth += (int64_t) Width*Height*1*InFeat; LayerBandwidth += (int64_t) Wo*Ho*1*InFeat; LayerBandwidth += (int64_t) Fcx*Fcy*1*InFeat; LayerBandwidth += (int64_t) Bias_DataSize*InFeat; ConvKerName = CNN_FindMatchingKernel(KOP_CONV_DW, (PoolOper==KOP_NONE)?ActOper:KOP_NONE, ParFeat, 1, 1, Bias_DataSize, 0, 4, Fcx, Fcy, Dcx, Dcy, Scx, Scy, &NeedFcx, &NeedFcy, &NeedDcx, &NeedDcy, &NeedScx, &NeedScy, 0); if (ConvKerName) { if (PoolOper==KOP_NONE) StandAloneAct = 0; } else ConvKerName = CNN_FindMatchingKernel(KOP_CONV_DW, KOP_NONE, ParFeat, 1, 1, Bias_DataSize, 0, 4, Fcx, Fcy, Dcx, Dcy, Scx, Scy, &NeedFcx, &NeedFcy, &NeedDcx, &NeedDcy, &NeedScx, &NeedScy, 0); if (ConvKerName==0) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, Can't find a matching Convolution basic kernel", Name); MatPermKerName = CNN_FindMatchingKernelAttr(KOP_MATPERM_HWC2CHW, KOP_NONE, ParFeat, KerLayout, 1, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0, 0, 0, 0); if (MatPermKerName==0) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching basic kernel for 3D Tensor Permutation", Name); if (PoolOper != KOP_NONE) { DPReductionKerName = CNN_FindMatchingKernelAttr(DP_OP, KOP_NONE, ParFeat, KerLayout, 4, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (DPReductionKerName==0) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Reduction basic kernel", Name); } else { DPReductionKerName = CNN_FindMatchingKernelAttr(DP_OP, ActOper, ParFeat, KerLayout, 4, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (DPReductionKerName==0) DPReductionKerName = CNN_FindMatchingKernelAttr(DP_OP, KOP_NONE, ParFeat, KerLayout, 4, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); else if (ActOper) StandAloneAct = 0; if (DPReductionKerName==0) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Reduction basic kernel", Name); } if (PoolOper!=KOP_NONE) { PoolKerName = CNN_FindMatchingKernelAttr(PoolOper, ActOper, ParFeat, KerLayout, 1, 0, 0, 0, 1, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &NeedFpx, &NeedFpy, &NeedDpx, &NeedDpy, &NeedSpx, &NeedSpy, 0); if (PoolKerName==0) PoolKerName = CNN_FindMatchingKernelAttr(PoolOper, KOP_NONE, ParFeat, KerLayout, 1, 0, 0, 0, 1, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &NeedFpx, &NeedFpy, &NeedDpx, &NeedDpy, &NeedSpx, &NeedSpy, 0); else if (ActOper) StandAloneAct = 0; if (PoolKerName==0) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, Can't find a matching Pooling %s basic kernel", Name, ActOper?"with linear rectification":""); } if (ActOper && StandAloneAct) { if (ActOper == KOP_CUSTOM) { if (!Ctrl||!Ctrl->CustomActivationName) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, ActOper is KOP_CUSTOM but no kernel name supplied", Name); ActKerName = Ctrl->CustomActivationName; } else { ActKerName = CNN_FindMatchingKernelAttr(ActOper, KOP_NONE, 0, 0, 1, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (ActKerName==0) GenTilingError("CNN_HWC_DWConvolutionPoolAct_SQ8: %s, Can't find a matching Activation basic kernel", Name); } } if (Log) { GenTilingDebug("InFeat: %d, OutFeat: %d%s - TileOrientation: %s\n", InFeat, OutFeat, HWC?", HWC":", CHW", TileOrientation==TILE_HOR?"TILE_HOR":"TILE_VER"); GenTilingDebug("Conv => W: %d, Pad:[%d,%d] PadT:[%d,%d] => Wc: %d, Filter:[%d,%d]\n", Width, PadInc[0], PadInc[1], PadIncT[0], PadIncT[1], Wc, Fcx, Fcy); GenTilingDebug(" => H: %d, Pad:[%d,%d] PadT:[%d,%d] => Hc: %d\n", Height, PadInc[2], PadInc[3], PadIncT[2], PadIncT[3], Hc); GenTilingDebug("Pool => Wc: %d, Pad:[%d,%d] => Wo: %d, Filter:[%d,%d]\n", Wc, PadInp[0], PadInp[1], Wo, Fpx, Fpy); GenTilingDebug(" => Hc: %d, Pad:[%d,%d] => Ho: %d\n", Hc, PadInp[2], PadInp[3], Ho); GenTilingDebug("OverlapC: %d\n", OverlapC); GenTilingDebug("OverlapP: %d\n", OverlapP); GenTilingDebug("TileCons: %d\n", TileCons); GenTilingDebug("UsedIn : [%d x %d]\n", UsedWidth, UsedHeight); GenTilingDebug("UsedC : [%d x %d]\n", UsedWc, UsedHc); if (MatPermKerName) GenTilingDebug("%20s: %s\n", "MatPermKerName", MatPermKerName); if (ConvKerName) GenTilingDebug("%20s: %s\n", "ConvKerName", ConvKerName); if (DPReductionKerName) GenTilingDebug("%20s: %s\n", "DPReductionKerName", DPReductionKerName); if (PoolKerName) GenTilingDebug("%20s: %s\n", "PoolKerName", PoolKerName); if (ActKerName) GenTilingDebug("%20s: %s\n", "ActKerName", ActKerName); GenTilingDebug("Nb Oper : %lld\n", LayerOp); } int OutTileCons = 8; Kernel_T *Kernel = UserKernel(Name, KernelIterSpace(2, IterTiledSpace(T0), IterParSpace(D0, InFeat, 8)), TileOrientation, CArgs(8, TCArg(CNN_ArgDataType(1,1,1), "In"), TCArg(CNN_ArgDataType(1,1,1), "Filter"), TCArg(CNN_ArgDataType(Bs,1,1), "Bias"), TCArg(CNN_ArgDataType(1,1,1), "Out"), TCArg(CNN_ArgDataTypeUns(1,1,1),"Scale"), TCArg(CNN_ArgDataType(1,1,1), "ScaleN"), TCArg(CNN_ArgDataType(1,1,1), "Infos"), (CustomInfos)?TCArg(CNN_ArgDataType(1,1,1), "CustomInfos"):AT_NO_C_ARG ), Calls(5, Call(MatPermKerName, LOC_D0, Bindings(7, K_Arg("In", KER_ARG_TILE), /* Input tile */ K_Arg("PermOut", KER_ARG_TILE), /* Output tile */ K_ArgPar("In", KER_ARG_PARTILE_SIZE, D0), /* Out Features */ K_Arg("In", KER_ARG_TILE_W), /* Input tile width */ K_Arg("In", KER_ARG_TILE_H), /* Input tile height */ AT_IGNORE_ARG_BINDING, /* StrideX */ AT_IGNORE_ARG_BINDING /* StrideY */ ) ), Call(ConvKerName, LOC_D0, Bindings(20, K_Arg("PermOut", KER_ARG_TILE), /* Conv input tile */ K_Arg("In", KER_ARG_TILE_W), /* Conv input tile width */ K_Arg("In", KER_ARG_TILE_USEDW), /* Conv input tile width, used part of it */ K_Arg("In", KER_ARG_TILE_H), /* Conv input tile height */ K_Arg("In", KER_ARG_TILE_USEDH), /* Conv input tile height, used part of it */ K_ArgPar("Filter", KER_ARG_PARTILE_SIZE, D0), /* Number of input features in this tile */ K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, D0), /* Number of output features in this tile */ K_ArgPar("Filter", KER_ARG_LOADEDPARTILE_SIZE, D0), /* Total number of input features currently in L1 memory, argument promotion */ K_Arg("Filter", KER_ARG_TILE), /* Conv filter */ K_Arg("Bias", KER_ARG_TILE), /* Conv Bias when depth wise conv*/ K_Arg("ConvOut", KER_ARG_TILE), /* Conv output */ K_Arg("In", KER_ARG_TILE_PAD), /* Conv Padding */ K_TileOper("Infos", "char *", '@', AT_INF_BIASN), /* NormBias is depth wise conv */ AT_IGNORE_ARG_BINDING, /* Orientation when feature parallel */ NeedFcx?Imm(Fcx):AT_IGNORE_ARG_BINDING, /* Conv Fx */ NeedScx?Imm(Scx):AT_IGNORE_ARG_BINDING, /* Conv Stridex */ NeedDcx?Imm(Dcx):AT_IGNORE_ARG_BINDING, /* Conv Dx */ NeedFcy?Imm(Fcy):AT_IGNORE_ARG_BINDING, /* Conv Fy */ NeedScy?Imm(Scy):AT_IGNORE_ARG_BINDING, /* Conv Stridey */ NeedDcy?Imm(Dcy):AT_IGNORE_ARG_BINDING /* Conv Dy */ ) ), Call(DPReductionKerName, LOC_D0, /* DP Reduction also take care of optional activation */ Bindings(8, K_Arg("ConvOut", KER_ARG_TILE), /* Double precision input tile */ K_Arg(PoolOper?"ConvOut":"Out", KER_ARG_TILE), /* Single precision output tile, warning use IO kernel when In=Out */ K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, D0), /* Input tile Number of features */ K_Arg("ConvOut", KER_ARG_TILE_W), /* Input tile width */ K_Arg("ConvOut", KER_ARG_TILE_H), /* Input tile height */ K_Arg("Scale", KER_ARG_TILE), /* Per channel scale tile */ K_Arg("ScaleN", KER_ARG_TILE), /* Per channel scale normalization tile */ K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ), (PoolKerName==0)?AT_NO_CALL: Call(PoolKerName, LOC_D0, Bindings(14, K_Arg("ConvOut", KER_ARG_TILE), /* Input tile */ K_Arg("ConvOut", KER_ARG_TILE_W), /* Input tile width */ K_Arg("ConvOut", KER_ARG_TILE_H), /* Input tile height */ NeedFpx?Imm(Fpx):AT_IGNORE_ARG_BINDING, /* Pool Fx */ NeedFpy?Imm(Fpy):AT_IGNORE_ARG_BINDING, /* Pool Fy */ NeedSpx?Imm(Spx):AT_IGNORE_ARG_BINDING, /* Pool Stridex */ NeedSpy?Imm(Spy):AT_IGNORE_ARG_BINDING, /* Pool Stridey */ K_ArgPred("ConvOut", KER_ARG_TILEFIRST, T0), /* First Tile */ K_Arg("ConvOut", KER_ARG_TILE_PAD), /* Pool Padding */ K_Arg("Out", KER_ARG_TILE), /* Pooling output tile */ K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, D0), /* In Features */ K_Arg("Out", KER_ARG_TILE_W), /* Output tile width */ K_Arg("Out", KER_ARG_TILE_H), /* Output tile height */ K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ), (ActKerName==0)?AT_NO_CALL: Call(ActKerName, LOC_D0, Bindings(6, K_Arg("Out", KER_ARG_TILE), /* Input tile */ K_Arg("Out", KER_ARG_TILE), /* Output tile */ K_ArgPar("Out", KER_ARG_PARTILE_SIZE, D0), /* Number of Features */ K_Arg("Out", KER_ARG_TILE_W), /* Input tile width */ K_Arg("Out", KER_ARG_TILE_H), /* Input tile height */ (ActOper==KOP_CUSTOM)?((CustomInfos)?K_Arg("CustomInfos", KER_ARG_TILE):AT_NO_ARG_BINDING):K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ) ), KerArgs(10, KerArgP("In", KerArgSpace(2,T0,D0), O_IN|O_DB, Width, Height, UsedWidth, UsedHeight, PadIncT, PadInc, 1, OverlapC, 0, TileCons, "In"), KerArgP("PermOut",KerArgSpace(2,D0,T0), O_BUFF|O_ONETILE,Width, Height, UsedWidth, UsedHeight, PadIncT, PadInc, 1, OverlapC, 0, 0, ""), KerArg ("Bias", KerArgSpace(1,D0), O_IN|O_DB|O_CONST, 1, 1, Bs, 0, 0, 0, "Bias"), KerArg ("Scale", KerArgSpace(1,D0), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "Scale"), KerArg ("ScaleN", KerArgSpace(1,D0), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "ScaleN"), KerArg ("Filter", KerArgSpace(1,D0), O_IN|O_DB|O_CONST, Fcx, Fcy, 1, 0, 0, 0, "Filter"), KerArg ("Out", KerArgSpace(2,T0,D0), O_OUT|O_DB, Wo, Ho, 1, 0, 0, 0, "Out"), KerArgP("ConvOut",KerArgSpace(2,T0,D0), O_BUFF|O_ONETILE, Wc, Hc, UsedWc, UsedHc, PadInp, PadInp, 4, OverlapP, 0, 0, ""), KerArg ("Infos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED, 1, 1, AT_INF_DIM, 0, 0, 0, "Infos"), (CustomInfos)?KerArg ("CustomInfos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED, 1, 1, CustomInfos, 0, 0, 0, "CustomInfos"):AT_NO_KER_ARG ) ); if (Kernel) { AddKernelInfos(Name, AT_KERINFO_OPER, LayerOp, 0); AddKernelInfos(Name, AT_KERINFO_BANDWIDTH, LayerBandwidth, 0); AddKernelArgDim(Name, "In", 4, Height, Width, InFeat, 1); AddKernelArgDim(Name, "Filter", 4, InFeat, Fcx, Fcy, 1); AddKernelArgDim(Name, "Bias", 2, InFeat, Bias_DataSize); AddKernelArgDim(Name, "Out", 4, Ho, Wo, InFeat, 1); AddKernelArgDim(Name, "Scale", 2, InFeat, 1); AddKernelArgDim(Name, "ScaleN", 2, InFeat, 1); AddKernelArgDim(Name, "Infos", 2, AT_INF_DIM, 1); if (CustomInfos) AddKernelArgDim(Name, "CustomInfos", 2, CustomInfos, 1); if (Ctrl && (Ctrl->Out_L3)) SetKerArgInL3(Name, "Out"); AT_PrepareForTest_SQ8(Name, InFeat, OutFeat, Width, Height, Bias_DataSize, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, PadInc, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PadInp, ActOper); } return Kernel; } static Kernel_T *CNN_CHW_DWConvolutionPoolAct_SQ8_Internal( char *Name, CNN_GenControl_T *Ctrl, int Bias_DataSize, int Scale_DataSize, int InFeat, int OutFeat, int Width, int Height, KernelOper_T ConvOper, int Fcx, int Fcy, int Dcx, int Dcy, int Scx, int Scy, int ConvPad, KernelOper_T PoolOper, int Fpx, int Fpy, int Dpx, int Dpy, int Spx, int Spy, int PoolPad, KernelOper_T ActOper ) { int Log=1; int InTileCons = 4; int Bs = Bias_DataSize; int ParFeat = 1, HWC = 0; Tile_Orientation_T TileOrientation = TILE_HOR; AT_PadType PadType = PAD_BALANCED_LEFT; int CustomInfos = 0; if (Ctrl) { if (Ctrl->TileOrientation != -1) TileOrientation = (Ctrl->TileOrientation==0)?TILE_HOR:TILE_VER; if (Ctrl->ParallelFeatures != -1) ParFeat = Ctrl->ParallelFeatures; if (Ctrl->PadType != -1) PadType = Ctrl->PadType; if (ActOper == KOP_CUSTOM) { CustomInfos = Ctrl->CustomActivationInfos; } } if (ConvOper != KOP_CONV_DW) GenTilingError("CNN_CHW_DWConvolutionPoolAct_SQ8_Internal: %s, ConvOper, expecting KOP_CONV_DW", Name); if (InFeat != OutFeat) GenTilingError("CNN_CHW_DWConvolutionPoolAct_SQ8_Internal Kernel: %s, Depth wise convolution requested with InFeat:%d != OutFeat:%d", Name, InFeat, OutFeat); if (!(PoolOper == KOP_NONE || PoolOper == KOP_MAXPOOL || PoolOper == KOP_AVGPOOL)) GenTilingError("CNN_CHW_DWConvolutionPoolAct_SQ8_Internal Kernel: %s, PoolOper, expecting KOP_NONE, KOP_MAXPOOL or KOP_AVGPOOL", Name); if (!(ActOper == KOP_NONE || ActOper == KOP_CUSTOM || ActOper == KOP_RELU || ActOper == KOP_RELUN || ActOper == KOP_RELUM || ActOper == KOP_RELUMN || ActOper == KOP_HSIGMOID || ActOper == KOP_HSWISH || ActOper == KOP_LEAKYRELU || ActOper == KOP_SIGMOID || ActOper == KOP_TANH)) GenTilingError("CNN_CHW_DWConvolutionPoolAct_SQ8_Internal Kernel: %s, ActOper, expecting KOP_NONE, KOP_RELU, KOP_RELUN, KOP_RELUM, KOP_RELUMN, KOP_HSIGMOID, KOP_TANH, KOP_HSWISH or KOP_LEAKYRELU", Name); if (PoolOper==KOP_NONE) { Fpx=1; Dpx=1; Spx=1; Fpy=1; Dpy=1; Spy=1; } int OverlapC, OverlapP; int TileCons; int Wo, Ho, Wc, Hc; int PadCw=0, PadCh=0, PadPw=0, PadPh=0; v4s PadInp = (v4s){0,0,0,0}, PadInc = (v4s){0,0,0,0}, PadIncT = (v4s){0,0,0,0}; int DWConv=(ConvOper==KOP_CONV_DW); int NeedFcx, NeedFcy, NeedDcx, NeedDcy, NeedScx, NeedScy, NeedFpx, NeedFpy, NeedDpx, NeedDpy, NeedSpx, NeedSpy; int UsedWidth, UsedHeight, UsedWc, UsedHc; CNN_LayerOutputDim(Width, Height, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, ConvPad, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, &Wc, &Hc, &Wo, &Ho, &PadCw, &PadCh, &PadPw, &PadPh); PadInc = CNN_EdgePaddingValue(PadType, PadCw, PadCh); PadInp = CNN_EdgePaddingValue(PadType, PadPw, PadPh); /* Pad value for tiling, need to accrue phantom values created for Pool padding */ PadIncT = (v4s) {PadInp[0]*Scx+PadInc[0], PadInp[1]*Scx+PadInc[1], PadInp[2]*Scy+PadInc[2], PadInp[3]*Scy+PadInc[3]}; CNN_TileOverlap(TileOrientation, Fcx, Fcy, Dcx, Dcy, Scx, Scy, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &OverlapC, &OverlapP); UsedWc = CNN_UsedInputDimension(Wo, Fpx, Spx, Dpx, PadPw); UsedHc = CNN_UsedInputDimension(Ho, Fpy, Spy, Dpy, PadPh); UsedWidth = CNN_UsedInputDimension(UsedWc, Fcx, Scx, Dcx, PadCw); UsedHeight = CNN_UsedInputDimension(UsedHc, Fcy, Scy, Dcy, PadCh); TileCons = (TileOrientation==TILE_HOR)?CNN_Scm(Scy, Spy):CNN_Scm(Scx, Spx); /* Re evaluate now that we know exactly what is used */ PadInc[1] = Max(0, PadInc[1]-(Width-UsedWidth)); PadInc[3] = Max(0, PadInc[3]-(Height-UsedHeight)); PadInp[1] = Max(0, PadInp[1]-(Wc-UsedWc)); PadInp[3] = Max(0, PadInp[3]-(Hc-UsedHc)); PadIncT = (v4s) {PadInp[0]*Scx+PadInc[0], PadInp[1]*Scx+PadInc[1], PadInp[2]*Scy+PadInc[2], PadInp[3]*Scy+PadInc[3]}; UsedWc = (Wo-1)*Spx+(Dpx*(Fpx-1)+1)-PadInp[0]-PadInp[1]; UsedHc = (Ho-1)*Spy+(Dpy*(Fpy-1)+1)-PadInp[2]-PadInp[3]; UsedWidth = (UsedWc-1)*Scx+(Dcx*(Fcx-1)+1) -PadInc[0]-PadInc[1]; UsedHeight = (UsedHc-1)*Scy+(Dcy*(Fcy-1)+1)-PadInc[2]-PadInc[3]; Wc = UsedWc; Hc = UsedHc; /* Layer number of operations and memory bandwidth requirements */ unsigned long long int LayerOp = 0; unsigned long long int LayerBandwidth = 0; LayerOp += (int64_t) Wc*Hc*Fcx*Fcy*OutFeat; if (!DWConv) LayerOp *= (int64_t) InFeat; if (PoolOper) LayerOp += (int64_t) OutFeat*Wo*Ho*Fpx*Fpy; if (ActOper) LayerOp += (int64_t) OutFeat*Wo*Ho; LayerBandwidth += (int64_t) Width*Height*1*InFeat*(DWConv?1:OutFeat); LayerBandwidth += (int64_t) Wo*Ho*1*OutFeat; LayerBandwidth += (int64_t) Fcx*Fcy*1*InFeat*(DWConv?1:OutFeat); LayerBandwidth += (int64_t) Bs*OutFeat; /* Basic Kernel Matching */ int StandAloneAct = (ActOper!=KOP_NONE); char *ConvKerName=0, *PoolKerName=0, *ActKerName=0; ConvKerName = CNN_FindMatchingKernel(ConvOper, (PoolOper==KOP_NONE)?ActOper:KOP_NONE, ParFeat, 1, 1, Bs, 0, 1, Fcx, Fcy, Dcx, Dcy, Scx, Scy, &NeedFcx, &NeedFcy, &NeedDcx, &NeedDcy, &NeedScx, &NeedScy, 0); if (ConvKerName==0) GenTilingError("CNN_CHW_DWConvolutionPoolAct_SQ8_Internal Kernel: %s, Can't find a matching Convolution basic kernel", Name); if (PoolOper!=KOP_NONE) { PoolKerName = CNN_FindMatchingKernel(PoolOper, ActOper, ParFeat, 1, 0, 0, 0, 1, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &NeedFpx, &NeedFpy, &NeedDpx, &NeedDpy, &NeedSpx, &NeedSpy, 0); if (PoolKerName==0) PoolKerName = CNN_FindMatchingKernel(PoolOper, KOP_NONE, ParFeat, 1, 0, 0, 0, 1, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &NeedFpx, &NeedFpy, &NeedDpx, &NeedDpy, &NeedSpx, &NeedSpy, 0); else if (ActOper) { if (ActOper == KOP_CUSTOM) { if (!Ctrl||!Ctrl->CustomActivationName) GenTilingError("CNN_CHW_DWConvolutionPoolAct_SQ8_Internal: %s, ActOper is KOP_CUSTOM but no kernel name supplied", Name); ActKerName = Ctrl->CustomActivationName; } else { ActKerName = CNN_FindMatchingKernel(ActOper, KOP_NONE, 0, 1, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (ActKerName==0) GenTilingError("CNN_CHW_DWConvolutionPoolAct_SQ8_Internal Kernel: %s, Can't find a matching Activation basic kernel", Name); } } if (PoolKerName==0) GenTilingError("CNN_CHW_DWConvolutionPoolAct_SQ8_Internal Kernel: %s, Can't find a matching Pooling %s basic kernel", Name, ActOper?"with linear rectification":""); } if (Log) { GenTilingDebug("InFeat: %d, OutFeat: %d\n", InFeat, OutFeat); GenTilingDebug("Conv => W: %d, Pad:[%d,%d] PadT:[%d,%d] => Wc: %d, Filter:[%d,%d]\n", Width, PadInc[0], PadInc[1], PadIncT[0], PadIncT[1], Wc, Fcx, Fcy); GenTilingDebug(" => H: %d, Pad:[%d,%d] PadT:[%d,%d] => Hc: %d\n", Height, PadInc[2], PadInc[3], PadIncT[2], PadIncT[3], Hc); GenTilingDebug("Pool => Wc: %d, Pad:[%d,%d] => Wo: %d, Filter:[%d,%d]\n", Wc, PadInp[0], PadInp[1], Wo, Fpx, Fpy); GenTilingDebug(" => Hc: %d, Pad:[%d,%d] => Ho: %d\n", Hc, PadInp[2], PadInp[3], Ho); GenTilingDebug("OverlapC: %d\n", OverlapC); GenTilingDebug("OverlapP: %d\n", OverlapP); GenTilingDebug("TileCons: %d\n", TileCons); GenTilingDebug("UsedIn : [%d x %d]\n", UsedWidth, UsedHeight); GenTilingDebug("UsedC : [%d x %d]\n", UsedWc, UsedHc); if (ConvKerName) GenTilingDebug("%20s: %s\n", "ConvKerName", ConvKerName); if (PoolKerName) GenTilingDebug("%20s: %s\n", "PoolKerName", PoolKerName); if (ActKerName) GenTilingDebug("%20s: %s\n", "ActKerName", ActKerName); GenTilingDebug("Nb Oper : %lld\n", LayerOp); } Kernel_T *Kernel = UserKernel(Name, ParFeat? KernelIterSpace(2, IterParSpace(D0, InFeat, 8), IterTiledSpace(T0)): KernelIterSpace(2, IterFixedSpace(D0, InFeat), IterTiledSpace(T0)), TileOrientation, CArgs((CustomInfos)?8:7, /* User kernel C arguments */ TCArg(CNN_ArgDataType(1, 1,1), "In"), TCArg(CNN_ArgDataType(1, 1,1), "Filter"), TCArg(CNN_ArgDataType(Bs, 1,1), "Bias"), TCArg(CNN_ArgDataType(1, 1,1), "Out"), TCArg(CNN_ArgDataTypeUns(1,1,1), "Scale"), TCArg(CNN_ArgDataType(1, 1,1), "ScaleN"), TCArg(CNN_ArgDataType(1, 1,1), "Infos"), TCArg(CNN_ArgDataType(1, 1,1), "CustomInfos") ), Calls(3, Call(ConvKerName, LOC_LOOP, Bindings(23, K_Arg("In", KER_ARG_TILE), /* Conv input tile */ K_Arg("In", KER_ARG_TILE_W), /* Conv input tile width */ K_Arg("In", KER_ARG_TILE_USEDW), /* Conv input tile width, used part of it */ K_Arg("In", KER_ARG_TILE_H), /* Conv input tile height */ K_Arg("In", KER_ARG_TILE_USEDH), /* Conv input tile height, used part of it */ K_ArgPar("Filter", KER_ARG_PARTILE_SIZE, D0), /* Number of input features in this tile */ ParFeat?K_ArgPar((!PoolKerName)?"Out":"ConvOut", KER_ARG_PARTILE_SIZE, D0):Imm(1), /* Number of output features in this tile */ K_ArgPar("Filter", KER_ARG_LOADEDPARTILE_SIZE, D0), /* Total number of input features currently in L1 memory, argument promotion */ K_Arg("Filter", KER_ARG_TILE), /* Conv filter */ DWConv?K_Arg("Bias", KER_ARG_TILE):AT_IGNORE_ARG_BINDING, /* Conv Bias when depth wise conv*/ K_Arg("Scale", KER_ARG_TILE), /* Per channel scale tile */ K_Arg("ScaleN", KER_ARG_TILE), /* Per channel scale normalization tile */ K_Arg("Infos", KER_ARG_TILE), /* Infos */ K_Arg((!PoolKerName)?"Out":"ConvOut", KER_ARG_TILE), /* Conv output */ K_Arg("In", KER_ARG_TILE_PAD), /* Conv Padding */ DWConv?K_TileOper("Infos", "char *", '@', AT_INF_BIASN):AT_IGNORE_ARG_BINDING, /* NormBias is depth wise conv */ ParFeat?AT_IGNORE_ARG_BINDING:Imm((TileOrientation==TILE_HOR)?1:0), /* Orientation when feature parallel */ NeedFcx?Imm(Fcx):AT_IGNORE_ARG_BINDING, /* Conv Fx */ NeedScx?Imm(Scx):AT_IGNORE_ARG_BINDING, /* Conv Stridex */ NeedDcx?Imm(Dcx):AT_IGNORE_ARG_BINDING, /* Conv Dx */ NeedFcy?Imm(Fcy):AT_IGNORE_ARG_BINDING, /* Conv Fy */ NeedScy?Imm(Scy):AT_IGNORE_ARG_BINDING, /* Conv Stridey */ NeedDcy?Imm(Dcy):AT_IGNORE_ARG_BINDING /* Conv Dy */ ) ), (PoolKerName==0)?AT_NO_CALL: Call(PoolKerName, DWConv?LOC_LOOP:LOC_D0_EPILOG, Bindings(18, K_Arg("ConvOut", KER_ARG_TILE), /* Pooling input tile */ K_Arg("ConvOut", KER_ARG_TILE_W), /* Pooling input tile width */ K_Arg("ConvOut", KER_ARG_TILE_USEDW), /* Pooling input tile width, used part of it */ K_Arg("ConvOut", KER_ARG_TILE_H), /* Pooling input tile height */ K_Arg("ConvOut", KER_ARG_TILE_USEDH), /* Pooling input tile height, used part of it */ ParFeat?K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, D0):Imm(1), /* Number of output features in this tile */ K_Arg("Out", KER_ARG_TILE), /* Pooling output tile */ K_Arg("ConvOut", KER_ARG_TILE_PAD), /* Pooling Pad */ NeedFpx?Imm(Fpx):AT_IGNORE_ARG_BINDING, /* Pooling Fx */ NeedSpx?Imm(Spx):AT_IGNORE_ARG_BINDING, /* Pooling Stridex */ NeedDpx?Imm(Dpx):AT_IGNORE_ARG_BINDING, /* Pooling Dx */ NeedFpy?Imm(Fpy):AT_IGNORE_ARG_BINDING, /* Pooling Fy */ NeedSpy?Imm(Spy):AT_IGNORE_ARG_BINDING, /* Pooling Stridey */ NeedDpy?Imm(Dpy):AT_IGNORE_ARG_BINDING, /* Pooling Dy */ Imm((PoolOper==KOP_MAXPOOL)?1:0), /* PoolMax or PoolAverage */ ParFeat?AT_IGNORE_ARG_BINDING:Imm((TileOrientation==TILE_HOR)?1:0), /* Pooling Orientation when feature parallel */ Imm((ActOper==KOP_NONE)), /* Scaling when no activation */ K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ), (ActKerName==0)?AT_NO_CALL: Call(ActKerName, DWConv?LOC_LOOP:LOC_D0_EPILOG, Bindings(6, K_Arg("Out", KER_ARG_TILE), /* Input tile */ K_Arg("Out", KER_ARG_TILE), /* Output tile */ ParFeat?K_ArgPar("Out", KER_ARG_PARTILE_SIZE, D0):Imm(1), /* Number of features in this tile */ K_Arg("Out", KER_ARG_TILE_W), /* Tile width */ K_Arg("Out", KER_ARG_TILE_H), /* Tile height */ (ActOper==KOP_CUSTOM)?((CustomInfos)?K_Arg("CustomInfos", KER_ARG_TILE):AT_NO_ARG_BINDING):K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ) ), /* User kernel kernel arguments */ KerArgs(9, KerArgP("In", KerArgSpace(2,D0,T0), O_IN|O_DB, Width, Height, UsedWidth, UsedHeight, PadIncT, PadInc, 1, OverlapC, 0, TileCons, "In"), KerArg ("Bias", KerArgSpace(1,D0), O_IN|O_DB|O_CONST, 1, 1, Bs, 0, 0, 0, "Bias"), KerArg ("Scale", KerArgSpace(1,D0), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "Scale"), KerArg ("ScaleN", KerArgSpace(1,D0), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "ScaleN"), KerArg ("Filter", KerArgSpace(1,D0), O_IN|O_DB|O_CONST, 1, 1, Fcx*Fcy, 0, 0, 0, "Filter"), KerArg ("Out", KerArgSpace(2,D0,T0), O_OUT|O_DB, Wo, Ho, 1, 0, 0, 0, "Out"), (!PoolKerName)?AT_NO_KER_ARG: ((ParFeat)? KerArgP("ConvOut",KerArgSpace(2,D0,T0), O_BUFF|O_ONETILE, Wc, Hc, UsedWc, UsedHc, PadInp, PadInp, 1, OverlapP, 0, 0, ""): KerArgP("ConvOut",KerArgSpace(1,T0), O_BUFF|O_ONETILE, Wc, Hc, UsedWc, UsedHc, PadInp, PadInp, 1, OverlapP, 0, 0, "")), KerArg ("Infos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED|O_CONST, AT_INF_DIM, 1, 1, 0, 0, 0, "Infos"), (CustomInfos)? KerArg ("CustomInfos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED|O_CONST, CustomInfos, 1, 1, 0, 0, 0, "CustomInfos"):AT_NO_KER_ARG ) ); if (Kernel) { AddKernelInfos(Name, AT_KERINFO_OPER, LayerOp, 0); AddKernelInfos(Name, AT_KERINFO_BANDWIDTH, LayerBandwidth, 0); AddKernelArgDim(Name, "In", 4, InFeat, Height, Width, 1); AddKernelArgDim(Name, "Filter", 4, InFeat, Fcx, Fcy, 1); AddKernelArgDim(Name, "Bias", 2, OutFeat, Bias_DataSize); AddKernelArgDim(Name, "Out", 4, OutFeat, Ho, Wo, 1); AddKernelArgDim(Name, "Scale", 2, OutFeat, 1); AddKernelArgDim(Name, "ScaleN", 2, OutFeat, 1); AddKernelArgDim(Name, "Infos", 2, AT_INF_DIM, 1); if (CustomInfos) AddKernelArgDim(Name, "CustomInfos", 2, CustomInfos, 1); } return Kernel; } /********************************************************************************************************************************************************************* Generator for Convolutions with channel centric scaling, followed by an optional pooling (Max or Average), followed by an optional Activation. Template: Name: Name of the generated user kernel Ctrl: Overide generator default options (TileOrientation, Parallel Features, Use HWCE), Def=(TILE_HOR, 1, 0) Bias_DataSize: 1: byte, 2: half word, 4: word Scale_DataSize: 1: byte, 2: half word, 4: word InFeat: Number of input feature's maps OutFeat: Number of output feature's maps Width: Number of columns of a given feature map Height: Number of lines of a given feature map ConvOper: Type of convolution, Regular convolution: KOP_CONV, KOP_CONV_DP, Depth wise convolution: KOP_CONV_DW Fcx: Convolution filter x dimension Fcy: Convolution filter y dimension Dcx: Convolution filter dilation factor, x dimension Dcy: Convolution filter dilation factor, y dimension Scx: Convolution filter stride x dimension Scy: Convolution filter stride y dimension ConvPad: 0: No padding, 1: Zero padding PoolOper: Type of Pooling, KOP_NONE, Max Pooling: KOP_MAXPOOL, Average Pooling: KOP_AVGPOOL Fpx: Pooling filter x dimension Fpy: Pooling filter y dimension Dpx: Pooling filter dilation factor, x dimension Dpy: Pooling filter dilation factor, y dimension Spx: Pooling filter stride x dimension Spy: Pooling filter stride y dimension PoolPad: 0: No padding, 1: Zero padding ActOper: Optional activation function: KOP_NONE, KOP_RELU, KOP_RELUN, KOP_HSWISH, KOP_HSIGMOID, KOP_LEAKYRELU, KOP_SIGMOID, KOP_TANH Signature: Name(In, Filter, Bias, Out, Scale, ScaleN, Infos) CNN_ConvolutionPoolAct_SQ8 *********************************************************************************************************************************************************************/ Kernel_T *CNN_ConvolutionPoolAct_SQ8_Internal( char *Name, CNN_GenControl_T *Ctrl, int Bias_DataSize, int Scale_DataSize, int InFeat, int OutFeat, int Width, int Height, KernelOper_T ConvOper, int Fcx, int Fcy, int Dcx, int Dcy, int Scx, int Scy, int ConvPad, KernelOper_T PoolOper, int Fpx, int Fpy, int Dpx, int Dpy, int Spx, int Spy, int PoolPad, KernelOper_T ActOper ) { int Log=1; int ParFeat = 1, HWC = 0; Tile_Orientation_T TileOrientation = TILE_HOR; AT_PadType PadType = PAD_BALANCED_LEFT; int CustomInfos = 0; unsigned char Compressed[4] = {0, 0, 0, 0}; if (Ctrl) { if (Ctrl->CompressedInputBits) *((int *)&Compressed[0]) = Ctrl->CompressedInputBits; if (Ctrl->TileOrientation != -1) TileOrientation = (Ctrl->TileOrientation==0)?TILE_HOR:TILE_VER; if (Ctrl->ParallelFeatures != -1) ParFeat = Ctrl->ParallelFeatures; if (Ctrl->PadType != -1) PadType = Ctrl->PadType; if (Ctrl->HWC != -1) HWC = Ctrl->HWC; if (ActOper == KOP_CUSTOM) { CustomInfos = Ctrl->CustomActivationInfos; } } if (ConvOper == KOP_CONV && Width == 1 && Fcy > 1 && Fcx == 1) { // It's a 1D so swap x and y dimensions int Temp; Temp = Fcx; Fcx = Fcy; Fcy = Temp; Temp = Scx; Scx = Scy; Scy = Temp; Temp = Dcx; Dcx = Dcy; Dcy = Temp; Temp = Fpx; Fpx = Fpy; Fpy = Temp; Temp = Spx; Spx = Spy; Spy = Temp; Temp = Dpx; Dpx = Dpy; Dpy = Temp; Temp = Width; Width = Height; Height = Temp; } if (ConvOper==KOP_NONE) { if (PoolOper!=KOP_NONE) return CNN_PoolAct_SQ8_Internal(Name, Ctrl, InFeat, Width, Height, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, ActOper); else if (ActOper!=KOP_NONE) return CNN_Act_SQ8_Internal(Name, Ctrl, InFeat, Width, Height, ActOper); else GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, All requested operations are KOP_NONE", Name); } else if (HWC) { if (ConvOper == KOP_CONV_DW) return CNN_HWC_DWConvolutionPoolAct_SQ8_Internal(Name, Ctrl, Bias_DataSize, Scale_DataSize, InFeat, OutFeat, Width, Height, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, ConvPad, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, ActOper); else return CNN_MM_ConvolutionPoolAct_SQ8_Internal(Name, Ctrl, Bias_DataSize, Scale_DataSize, InFeat, OutFeat, Width, Height, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, ConvPad, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, ActOper); } else if (ConvOper==KOP_CONV && ((Fcx > 1 && Fcy == 1))) { // AT_SetKernelCtrl(AT_KERNEL_NOSOLUTION_ERROR, AT_OPT_OFF); Kernel_T *Ok = CNN_MM_ConvolutionPoolAct_SQ8_Internal(Name, Ctrl, Bias_DataSize, Scale_DataSize, InFeat, OutFeat, Width, Height, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, ConvPad, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, ActOper); // AT_SetKernelCtrl(AT_KERNEL_NOSOLUTION_ERROR, AT_OPT_ON); if (Ok!=0) return Ok; if (Log) GenTilingDebug("No solution found for im2col scheme, reverting to standard implementation\n"); } else if (ConvOper == KOP_CONV_DW) return CNN_CHW_DWConvolutionPoolAct_SQ8_Internal(Name, Ctrl, Bias_DataSize, Scale_DataSize, InFeat, OutFeat, Width, Height, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, ConvPad, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, ActOper); if (PoolOper==KOP_NONE) { Fpx=1; Dpx=1; Spx=1; Fpy=1; Dpy=1; Spy=1; } KernelOper_T COper = ConvOper; int OverlapC, OverlapP; int TileCons; int Wo, Ho, Wc, Hc; int PadCw=0, PadCh=0, PadPw=0, PadPh=0; v4s PadInp = (v4s){0,0,0,0}, PadInc = (v4s){0,0,0,0}, PadIncT = (v4s){0,0,0,0}; char *ConvKerName=0, *PoolKerName=0, *ActKerName=0, *SetBiasKerName=0, *DPReductionKerName=0; int DWConv=(ConvOper==KOP_CONV_DW); int NeedFcx, NeedFcy, NeedDcx, NeedDcy, NeedScx, NeedScy, NeedFpx, NeedFpy, NeedDpx, NeedDpy, NeedSpx, NeedSpy; int Os=(DWConv?D0:D1); int UsedWidth, UsedHeight, UsedWc, UsedHc; int InTileCons = 4; int StandAloneAct = (ActOper!=KOP_NONE); unsigned long long int LayerOp = 0; unsigned long long int LayerBandwidth = 0; if (!(ConvOper == KOP_NONE || ConvOper == KOP_CONV || ConvOper == KOP_CONV_DW)) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, ConvOper, expecting KOP_NONE, KOP_CONV or KOP_CONV_DW", Name); if (!(PoolOper == KOP_NONE || PoolOper == KOP_MAXPOOL || PoolOper == KOP_AVGPOOL)) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, PoolOper, expecting KOP_NONE, KOP_MAXPOOL or KOP_AVGPOOL", Name); if (!(ActOper == KOP_NONE || ActOper == KOP_CUSTOM || ActOper == KOP_RELU || ActOper == KOP_RELUN || ActOper == KOP_RELUM || ActOper == KOP_RELUMN || ActOper == KOP_HSIGMOID || ActOper == KOP_HSWISH || ActOper == KOP_LEAKYRELU || ActOper == KOP_SIGMOID || ActOper == KOP_TANH)) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, ActOper, expecting KOP_NONE, KOP_RELU, KOP_RELUN, KOP_RELUM, KOP_RELUMN, KOP_HSIGMOID, KOP_TANH, KOP_HSWISH or KOP_LEAKYRELU", Name); if (DWConv && (InFeat != OutFeat)) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, Depth wise convolution requested with InFeat:%d != OutFeat:%d", Name, InFeat, OutFeat); CNN_LayerOutputDim(Width, Height, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, ConvPad, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PoolPad, &Wc, &Hc, &Wo, &Ho, &PadCw, &PadCh, &PadPw, &PadPh); PadInc = CNN_EdgePaddingValue(PadType, PadCw, PadCh); PadInp = CNN_EdgePaddingValue(PadType, PadPw, PadPh); /* Pad value for tiling, need to accrue phantom values created for Pool padding */ PadIncT = (v4s) {PadInp[0]*Scx+PadInc[0], PadInp[1]*Scx+PadInc[1], PadInp[2]*Scy+PadInc[2], PadInp[3]*Scy+PadInc[3]}; CNN_TileOverlap(TileOrientation, Fcx, Fcy, Dcx, Dcy, Scx, Scy, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &OverlapC, &OverlapP); UsedWc = CNN_UsedInputDimension(Wo, Fpx, Spx, Dpx, PadPw); UsedHc = CNN_UsedInputDimension(Ho, Fpy, Spy, Dpy, PadPh); UsedWidth = CNN_UsedInputDimension(UsedWc, Fcx, Scx, Dcx, PadCw); UsedHeight = CNN_UsedInputDimension(UsedHc, Fcy, Scy, Dcy, PadCh); TileCons = (TileOrientation==TILE_HOR)?CNN_Scm(Scy, Spy):CNN_Scm(Scx, Spx); /* Re evaluate now that we know exactly what is used */ PadInc[1] = Max(0, PadInc[1]-(Width-UsedWidth)); PadInc[3] = Max(0, PadInc[3]-(Height-UsedHeight)); PadInp[1] = Max(0, PadInp[1]-(Wc-UsedWc)); PadInp[3] = Max(0, PadInp[3]-(Hc-UsedHc)); PadIncT = (v4s) {PadInp[0]*Scx+PadInc[0], PadInp[1]*Scx+PadInc[1], PadInp[2]*Scy+PadInc[2], PadInp[3]*Scy+PadInc[3]}; UsedWc = (Wo-1)*Spx+(Dpx*(Fpx-1)+1)-PadInp[0]-PadInp[1]; UsedHc = (Ho-1)*Spy+(Dpy*(Fpy-1)+1)-PadInp[2]-PadInp[3]; UsedWidth = (UsedWc-1)*Scx+(Dcx*(Fcx-1)+1) -PadInc[0]-PadInc[1]; UsedHeight = (UsedHc-1)*Scy+(Dcy*(Fcy-1)+1)-PadInc[2]-PadInc[3]; Wc = UsedWc; Hc = UsedHc; /* Layer number of operations and memory bandwidth requirements */ LayerOp += (int64_t) Wc*Hc*Fcx*Fcy*OutFeat; if (!DWConv) LayerOp *= (int64_t) InFeat; if (PoolOper) LayerOp += (int64_t) OutFeat*Wo*Ho*Fpx*Fpy; if (ActOper) LayerOp += (int64_t) OutFeat*Wo*Ho; LayerBandwidth += (int64_t) Width*Height*1*InFeat*(DWConv?1:OutFeat); LayerBandwidth += (int64_t) Wo*Ho*1*OutFeat; LayerBandwidth += (int64_t) Fcx*Fcy*1*InFeat*(DWConv?1:OutFeat); LayerBandwidth += (int64_t) Bias_DataSize*OutFeat; /* Basic Kernel Matching */ if (!DWConv) { SetBiasKerName = CNN_FindMatchingKernel(KOP_SETBIAS, KOP_NONE, ParFeat, Bias_DataSize, 0, 0, 0, 4, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (SetBiasKerName==0) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Set Bias basic kernel", Name); } if (ConvOper == KOP_CONV && Height == 1 && Fcx != 1 && Fcy == 1) ConvOper = KOP_CONV1D; ConvKerName = CNN_FindMatchingKernel(ConvOper, KOP_NONE, ParFeat, 1, 1, DWConv?Bias_DataSize:0, 0, 4, Fcx, Fcy, Dcx, Dcy, Scx, Scy, &NeedFcx, &NeedFcy, &NeedDcx, &NeedDcy, &NeedScx, &NeedScy, 0); if (ConvKerName==0) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Convolution basic kernel", Name); if (PoolOper != KOP_NONE) { DPReductionKerName = CNN_FindMatchingKernel(KOP_DP_REDUCT_IO, KOP_NONE, ParFeat, 4, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (DPReductionKerName==0) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Reduction basic kernel", Name); } else { DPReductionKerName = CNN_FindMatchingKernel(KOP_DP_REDUCT, ActOper, ParFeat, 4, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (DPReductionKerName==0) DPReductionKerName = CNN_FindMatchingKernel(KOP_DP_REDUCT, KOP_NONE, ParFeat, 4, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); else if (ActOper) StandAloneAct = 0; if (DPReductionKerName==0) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Reduction basic kernel", Name); } if (PoolOper!=KOP_NONE) { PoolKerName = CNN_FindMatchingKernel(PoolOper, ActOper, ParFeat, 1, 0, 0, 0, 1, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &NeedFpx, &NeedFpy, &NeedDpx, &NeedDpy, &NeedSpx, &NeedSpy, 0); if (PoolKerName==0) PoolKerName = CNN_FindMatchingKernel(PoolOper, KOP_NONE, ParFeat, 1, 0, 0, 0, 1, Fpx, Fpy, Dpx, Dpy, Spx, Spy, &NeedFpx, &NeedFpy, &NeedDpx, &NeedDpy, &NeedSpx, &NeedSpy, 0); else if (ActOper) StandAloneAct = 0; if (PoolKerName==0) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Pooling %s basic kernel", Name, ActOper?"with linear rectification":""); } if (ActOper && StandAloneAct) { if (ActOper == KOP_CUSTOM) { if (!Ctrl||!Ctrl->CustomActivationName) GenTilingError("CNN_ConvolutionPoolAct_SQ8: %s, ActOper is KOP_CUSTOM but no kernel name supplied", Name); ActKerName = Ctrl->CustomActivationName; } else { ActKerName = CNN_FindMatchingKernel(ActOper, KOP_NONE, 0, 1, 0, 0, 0, 1, 0,0,0,0,0,0, 0,0,0,0,0,0, 0); if (ActKerName==0) GenTilingError("CNN_ConvolutionPoolAct_SQ8 Kernel: %s, Can't find a matching Activation basic kernel", Name); } } if (Log) { GenTilingDebug("InFeat: %d, OutFeat: %d\n", InFeat, OutFeat); GenTilingDebug("Conv => W: %d, Pad:[%d,%d] PadT:[%d,%d] => Wc: %d, Filter:[%d,%d]\n", Width, PadInc[0], PadInc[1], PadIncT[0], PadIncT[1], Wc, Fcx, Fcy); GenTilingDebug(" => H: %d, Pad:[%d,%d] PadT:[%d,%d] => Hc: %d\n", Height, PadInc[2], PadInc[3], PadIncT[2], PadIncT[3], Hc); GenTilingDebug("Pool => Wc: %d, Pad:[%d,%d] => Wo: %d, Filter:[%d,%d]\n", Wc, PadInp[0], PadInp[1], Wo, Fpx, Fpy); GenTilingDebug(" => Hc: %d, Pad:[%d,%d] => Ho: %d\n", Hc, PadInp[2], PadInp[3], Ho); GenTilingDebug("OverlapC: %d\n", OverlapC); GenTilingDebug("OverlapP: %d\n", OverlapP); GenTilingDebug("TileCons: %d\n", TileCons); GenTilingDebug("UsedIn : [%d x %d]\n", UsedWidth, UsedHeight); GenTilingDebug("UsedC : [%d x %d]\n", UsedWc, UsedHc); if (SetBiasKerName) GenTilingDebug("%20s: %s\n", "SetBiasKerName", SetBiasKerName); if (ConvKerName) GenTilingDebug("%20s: %s\n", "ConvKerName", ConvKerName); if (DPReductionKerName) GenTilingDebug("%20s: %s\n", "DPReductionKerName", DPReductionKerName); if (PoolKerName) GenTilingDebug("%20s: %s\n", "PoolKerName", PoolKerName); if (ActKerName) GenTilingDebug("%20s: %s\n", "ActKerName", ActKerName); GenTilingDebug("Nb Oper : %lld\n", LayerOp); } if (Ctrl && (Ctrl->EnableIm2Col==1) && (ConvOper==KOP_CONV) && (PoolOper==KOP_NONE) && (Fcx==1) && (Fcy==1) && (Dcx==1) && (Dcy==1)) { AT_SetKernelCtrl(AT_KERNEL_NOSOLUTION_ERROR, AT_OPT_OFF); // if ((InFeat+OutFeat)<80) { if ((InFeat+OutFeat)<100 && (Scx==1) && (Scy==1)) { if (Log) GenTilingDebug("Mapping this convolution to matrix multiplication with small first operand\n"); Kernel_T *Ok = CNN_MatMulSmallM1Act_SQ8_Internal(Name, Ctrl, Bias_DataSize, Scale_DataSize, InFeat, OutFeat, Width*Height, InFeat, Width, Height, Scx, Scy, KOP_MATMUL_SM1, ActOper); if (!Ok&&Log) GenTilingDebug("Mapping this convolution to matrix multiplication with small first operand FAILED, trying with standard mult implementation\n"); if (Ok) return Ok; } if (Log) GenTilingDebug("Mapping this convolution to matrix multiplication\n"); Kernel_T *Ok = CNN_MatMulAct_SQ8_Internal(Name, Ctrl, Bias_DataSize, Scale_DataSize, 1, InFeat, OutFeat, Width*Height, InFeat, Width, Height, Scx, Scy, KOP_MATMUL, ActOper, 1); AT_SetKernelCtrl(AT_KERNEL_NOSOLUTION_ERROR, AT_OPT_ON); if (Ok) return Ok; if (Log) GenTilingDebug("Mapping this convolution to matrix multiplication FAILED, reverting to standard implementation\n"); } /* User kernel C arguments */ CKernel_Arg_T **KCArgs = AllocateCArgs((CustomInfos)?8:7); int Ca=0; KCArgs[Ca++] = TCArg(CNN_ArgDataType(1, 1,1), "In"); KCArgs[Ca++] = TCArg(CNN_ArgDataType(1, 1,1), "Filter"); KCArgs[Ca++] = TCArg(CNN_ArgDataType(Bias_DataSize,1,1), "Bias"); KCArgs[Ca++] = TCArg(CNN_ArgDataType(1, 1,1), "Out"); KCArgs[Ca++] = TCArg(CNN_ArgDataTypeUns(1, 1,1), "Scale"); KCArgs[Ca++] = TCArg(CNN_ArgDataType(1, 1,1), "ScaleN"); KCArgs[Ca++] = TCArg(CNN_ArgDataType(1, 1,1), "Infos"); if (CustomInfos) KCArgs[Ca++] = TCArg(CNN_ArgDataType(1, 1,1), "CustomInfos"); /* User kernel kernel arguments */ Object_T **KArgs = AllocateKerArgs((CustomInfos)?9:8); int Ka=0; KArgs[Ka++] = KerArgP("In", KerArgSpace(2,D0,T0), O_IN|O_DB, Width, Height, UsedWidth, UsedHeight, PadIncT, PadInc, 1, OverlapC, 0, TileCons, "In"); KArgs[Ka++] = KerArg ("Bias", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, Bias_DataSize, 0, 0, 0, "Bias"); KArgs[Ka++] = KerArg ("Scale", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "Scale"); KArgs[Ka++] = KerArg ("ScaleN", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, 1, 0, 0, 0, "ScaleN"); if (DWConv) { if (Compressed[1]) KArgs[Ka++] = KerArgC("Filter", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, Fcx*Fcy, LUTInfo(Compressed[1]&0x7f, 1, Compressed[1]&0x80), 0, 0, 0, "Filter"); else; KArgs[Ka++] = KerArg ("Filter", KerArgSpace(1,Os), O_IN|O_DB|O_CONST, 1, 1, Fcx*Fcy, 0, 0, 0, "Filter"); } else { if (Compressed[1]) KArgs[Ka++] = KerArgC("Filter", KerArgSpace(2,Os,D0), O_IN|O_DB|O_CONST, 1, 1, Fcx*Fcy, LUTInfo(Compressed[1]&0x7f, 1, Compressed[1]&0x80), 0, 0, 0, "Filter"); else KArgs[Ka++] = KerArg ("Filter", KerArgSpace(2,Os,D0), O_IN|O_DB|O_CONST, 1, 1, Fcx*Fcy, 0, 0, 0, "Filter"); } KArgs[Ka++] = KerArg ("Out", KerArgSpace(2,Os,T0), O_OUT|O_DB, Wo, Ho, 1, 0, 0, 0, "Out"); if (ParFeat) KArgs[Ka++] = KerArgP("ConvOut",KerArgSpace(2,Os,T0), O_BUFF|O_ONETILE, Wc, Hc, UsedWc, UsedHc, PadInp, PadInp, 4, OverlapP, 0, 0, ""); else KArgs[Ka++] = KerArgP("ConvOut",KerArgSpace(1,T0), O_BUFF|O_ONETILE, Wc, Hc, UsedWc, UsedHc, PadInp, PadInp, 4, OverlapP, 0, 0, ""); KArgs[Ka++] = KerArg ("Infos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED|O_CONST, AT_INF_DIM, 1, 1, 0, 0, 0, "Infos"); if (CustomInfos) KArgs[Ka++] = KerArg ("CustomInfos", KerArgSpace(1,T0), O_IN|O_BUFF|O_NTILED|O_CONST, CustomInfos, 1, 1, 0, 0, 0, "CustomInfos"); Kernel_T *Kernel = UserKernel(Name, ParFeat? (DWConv? KernelIterSpace(2, IterParSpace(D0, InFeat, 8), IterTiledSpace(T0)): KernelIterSpace(3, IterParSpace(D1, OutFeat, 8), IterTiledSpace(T0), IterParSpace(D0, InFeat, InTileCons))): (DWConv? KernelIterSpace(2, IterFixedSpace(D0, InFeat), IterTiledSpace(T0)): KernelIterSpace(3, IterFixedSpace(D1, OutFeat), IterTiledSpace(T0), IterFixedSpace(D0, InFeat))), TileOrientation, KCArgs, Calls(5, (SetBiasKerName==0)?AT_NO_CALL: Call(SetBiasKerName, LOC_D0_PROLOG, Bindings(6, K_Arg("ConvOut", KER_ARG_TILE), /* SetBias output tile */ K_Arg("ConvOut", KER_ARG_TILE_W), /* SetBias output tile width */ K_Arg("ConvOut", KER_ARG_TILE_H), /* SetBias output tile height */ ParFeat?K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, Os):Imm(1), /* Number of output features in this tile */ K_Arg("Bias", KER_ARG_TILE), /* SetBias Bias tile */ K_TileOper("Infos", "char *", '@', AT_INF_BIASN) /* Bias Norm */ )), Call(ConvKerName, DWConv?LOC_LOOP:LOC_D0, Bindings(20, K_Arg("In", KER_ARG_TILE), /* Conv input tile */ K_Arg("In", KER_ARG_TILE_W), /* Conv input tile width */ K_Arg("In", KER_ARG_TILE_USEDW), /* Conv input tile width, used part of it */ K_Arg("In", KER_ARG_TILE_H), /* Conv input tile height */ K_Arg("In", KER_ARG_TILE_USEDH), /* Conv input tile height, used part of it */ K_ArgPar("Filter", KER_ARG_PARTILE_SIZE, D0), /* Number of input features in this tile */ ParFeat?K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, Os):Imm(1), /* Number of output features in this tile */ K_ArgPar("Filter", KER_ARG_LOADEDPARTILE_SIZE, D0), /* Total number of input features currently in L1 memory, argument promotion */ K_Arg("Filter", KER_ARG_TILE), /* Conv filter */ DWConv?K_Arg("Bias", KER_ARG_TILE):AT_IGNORE_ARG_BINDING, /* Conv Bias when depth wise conv*/ K_Arg("ConvOut", KER_ARG_TILE), /* Conv output */ K_Arg("In", KER_ARG_TILE_PAD), /* Conv Padding */ DWConv?K_TileOper("Infos", "char *", '@', AT_INF_BIASN):AT_IGNORE_ARG_BINDING, /* NormBias is depth wise conv */ ParFeat?AT_IGNORE_ARG_BINDING:Imm((TileOrientation==TILE_HOR)?1:0), /* Orientation when feature parallel */ NeedFcx?Imm(Fcx):AT_IGNORE_ARG_BINDING, /* Conv Fx */ NeedScx?Imm(Scx):AT_IGNORE_ARG_BINDING, /* Conv Stridex */ NeedDcx?Imm(Dcx):AT_IGNORE_ARG_BINDING, /* Conv Dx */ NeedFcy?Imm(Fcy):AT_IGNORE_ARG_BINDING, /* Conv Fy */ NeedScy?Imm(Scy):AT_IGNORE_ARG_BINDING, /* Conv Stridey */ NeedDcy?Imm(Dcy):AT_IGNORE_ARG_BINDING /* Conv Dy */ ) ), Call(DPReductionKerName, DWConv?LOC_LOOP:LOC_D0_EPILOG, /* DP Reduction also take care of optional activation */ Bindings(8, K_Arg("ConvOut", KER_ARG_TILE), /* Double precision input tile */ K_Arg(PoolOper?"ConvOut":"Out", KER_ARG_TILE), /* Single precision output tile, warning use IO kernel when In=Out */ ParFeat?K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, Os):Imm(1), /* Input tile Number of features */ K_Arg("ConvOut", KER_ARG_TILE_W), /* Input tile width */ K_Arg("ConvOut", KER_ARG_TILE_H), /* Input tile height */ K_Arg("Scale", KER_ARG_TILE), /* Per channel scale tile */ K_Arg("ScaleN", KER_ARG_TILE), /* Per channel scale normalization tile */ K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ), (PoolKerName==0)?AT_NO_CALL: Call(PoolKerName, DWConv?LOC_LOOP:LOC_D0_EPILOG, Bindings(18, K_Arg("ConvOut", KER_ARG_TILE), /* Pooling input tile */ K_Arg("ConvOut", KER_ARG_TILE_W), /* Pooling input tile width */ K_Arg("ConvOut", KER_ARG_TILE_USEDW), /* Pooling input tile width, used part of it */ K_Arg("ConvOut", KER_ARG_TILE_H), /* Pooling input tile height */ K_Arg("ConvOut", KER_ARG_TILE_USEDH), /* Pooling input tile height, used part of it */ ParFeat?K_ArgPar("ConvOut", KER_ARG_PARTILE_SIZE, Os):Imm(1), /* Number of output features in this tile */ K_Arg("Out", KER_ARG_TILE), /* Pooling output tile */ K_Arg("ConvOut", KER_ARG_TILE_PAD), /* Pooling Pad */ NeedFpx?Imm(Fpx):AT_IGNORE_ARG_BINDING, /* Pooling Fx */ NeedSpx?Imm(Spx):AT_IGNORE_ARG_BINDING, /* Pooling Stridex */ NeedDpx?Imm(Dpx):AT_IGNORE_ARG_BINDING, /* Pooling Dx */ NeedFpy?Imm(Fpy):AT_IGNORE_ARG_BINDING, /* Pooling Fy */ NeedSpy?Imm(Spy):AT_IGNORE_ARG_BINDING, /* Pooling Stridey */ NeedDpy?Imm(Dpy):AT_IGNORE_ARG_BINDING, /* Pooling Dy */ Imm((PoolOper==KOP_MAXPOOL)?1:0), /* PoolMax or PoolAverage */ ParFeat?AT_IGNORE_ARG_BINDING:Imm((TileOrientation==TILE_HOR)?1:0), /* Pooling Orientation when feature parallel */ Imm((ActOper==KOP_NONE)), /* Scaling when no activation */ K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ), (ActKerName==0)?AT_NO_CALL: Call(ActKerName, DWConv?LOC_LOOP:LOC_D0_EPILOG, Bindings(6, K_Arg("Out", KER_ARG_TILE), /* Input tile */ K_Arg("Out", KER_ARG_TILE), /* Output tile */ ParFeat?K_ArgPar("Out", KER_ARG_PARTILE_SIZE, Os):Imm(1), /* Number of features in this tile */ K_Arg("Out", KER_ARG_TILE_W), /* Tile width */ K_Arg("Out", KER_ARG_TILE_H), /* Tile height */ (ActOper==KOP_CUSTOM)?((CustomInfos)?K_Arg("CustomInfos", KER_ARG_TILE):AT_NO_ARG_BINDING):K_Arg("Infos", KER_ARG_TILE) /* Infos */ ) ) ), KArgs ); if (Kernel) { AddKernelInfos(Name, AT_KERINFO_OPER, LayerOp, 0); AddKernelInfos(Name, AT_KERINFO_BANDWIDTH, LayerBandwidth, 0); AddKernelArgDim(Name, "In", 4, InFeat, Height, Width, 1); if (DWConv) AddKernelArgDim(Name, "Filter", 4, InFeat, Fcx, Fcy, 1); else AddKernelArgDim(Name, "Filter", 5, OutFeat, InFeat, Fcx, Fcy, 1); AddKernelArgDim(Name, "Bias", 2, OutFeat, Bias_DataSize); AddKernelArgDim(Name, "Out", 4, OutFeat, Ho, Wo, 1); AddKernelArgDim(Name, "Scale", 2, OutFeat, 1); AddKernelArgDim(Name, "ScaleN", 2, OutFeat, 1); AddKernelArgDim(Name, "Infos", 2, AT_INF_DIM, 1); if (CustomInfos) AddKernelArgDim(Name, "CustomInfos", 2, CustomInfos, 1); if (Ctrl && (Ctrl->In_L3)) SetKerArgInL3(Name, "In"); if (Ctrl && (Ctrl->Filter_L3)) SetKerArgInL3(Name, "Filter"); if (Ctrl && (Ctrl->Bias_L3)) SetKerArgInL3(Name, "Bias"); if (Ctrl && (Ctrl->Out_L3)) SetKerArgInL3(Name, "Out"); if (Ctrl && (Ctrl->Scale_L3)) SetKerArgInL3(Name, "Scale"); if (Ctrl && (Ctrl->ScaleN_L3)) SetKerArgInL3(Name, "ScaleN"); AT_PrepareForTest_SQ8(Name, InFeat, OutFeat, Width, Height, Bias_DataSize, ConvOper, Fcx, Fcy, Dcx, Dcy, Scx, Scy, PadInc, PoolOper, Fpx, Fpy, Dpx, Dpy, Spx, Spy, PadInp, ActOper); } return Kernel; } /********************************************************************************************************************************************************************* Generator for Grouped Convolutions with channel centric scaling, followed by an optional pooling (Max or Average), followed by an optional activation. Template: Name: Name of the generated user kernel Ctrl: Overide generator default options (TileOrientation, Parallel Features, Use double precision convolution, Use HWCE), Def=(TILE_HOR, 1, 0, 0) GroupIn: Size of the group for input features GroupOut: Size of the group for output features Bias_DataSize: 1: byte, 2: half word, 4: word Scale_DataSize: 1: byte, 2: half word, 4: word InFeat: Number of input feature's maps OutFeat: Number of output feature's maps Width: Number of columns of a given feature map Height: Number of lines of a given feature map ConvOper: Type of convolution, Regular convolution: KOP_CONV Fcx: Convolution filter x dimension Fcy: Convolution filter y dimension Dcx: Convolution filter dilation factor, x dimension Dcy: Convolution filter dilation factor, y dimension Scx: Convolution filter stride x dimension Scy: Convolution filter stride y dimension ConvPad: 0: No padding, 1: Zero padding PoolOper: Type of Pooling, KOP_NONE, Max Pooling: KOP_MAXPOOL, Average Pooling: KOP_AVGPOOL Fpx: Pooling filter x dimension Fpy: Pooling filter y dimension Dpx: Pooling filter dilation factor, x dimension Dpy: Pooling filter dilation factor, y dimension Spx: Pooling filter stride x dimension Spy: Pooling filter stride y dimension PoolPad: 0: No padding, 1: Zero padding ActOper: Optional activation function: KOP_NONE, KOP_RELU, KOP_RELUN, KOP_HSWISH, KOP_HSIGMOID, KOP_LEAKYRELU, KOP_SIGMOID, KOP_TANH Signature: Name(In, Filter, Bias, Out, Scale, ScaleN, Infos) CNN_GroupedConvolutionPoolAct_SQ8 *********************************************************************************************************************************************************************/ int CNN_GroupedConvolutionPoolAct_SQ8( char *Name, CNN_GenControl_T *Ctrl, int GroupIn, int GroupOut, int Bias_DataSize, int Scale_DataSize, int InFeat, int OutFeat, int Width, int Height, KernelOper_T ConvOper, int Fcx, int Fcy, int Dcx, int Dcy, int Scx, int Scy, int ConvPad, KernelOper_T PoolOper, int Fpx, int Fpy, int Dpx, int Dpy, int Spx, int Spy, int PoolPad, KernelOper_T ActOper ) { char *BodyName = AppendNames(Name, "Body"); KernelGroup_T *UKGroup; int g, Wc, Hc, Wo, Ho; int NGroups = InFeat/GroupIn; int CustomInfos = 0; if (Ctrl) { if (ActOper == KOP_CUSTOM) { if (!Ctrl->CustomActivationName) GenTilingError("CNN_GroupedConvolutionPoolAct_SQ8: %s, ActOper is KOP_CUSTOM but no kernel name supplied", Name); CustomInfos = Ctrl->CustomActivationInfos; } } if (!(ConvOper == KOP_CONV)) GenTilingError("CNN_GroupedConvolutionPoolAct_SQ8: Kernel: %s, ConvOper, expecting