@@ -34,9 +34,11 @@ static struct xnn_binary_elementwise_config f32_vsqrdiff_config = {0};
34
34
35
35
static struct xnn_binary_elementwise_config qs8_vadd_config = {0 };
36
36
static struct xnn_binary_elementwise_config qs8_vmul_config = {0 };
37
+ static struct xnn_binary_elementwise_config qs8_vprelu_config = {0 };
37
38
38
39
static struct xnn_binary_elementwise_config qu8_vadd_config = {0 };
39
40
static struct xnn_binary_elementwise_config qu8_vmul_config = {0 };
41
+ static struct xnn_binary_elementwise_config qu8_vprelu_config = {0 };
40
42
41
43
XNN_INIT_ONCE_GUARD (f16_vadd );
42
44
XNN_INIT_ONCE_GUARD (f16_vdiv );
@@ -57,9 +59,10 @@ XNN_INIT_ONCE_GUARD(f32_vsub);
57
59
XNN_INIT_ONCE_GUARD (f32_vsqrdiff );
58
60
XNN_INIT_ONCE_GUARD (qs8_vadd );
59
61
XNN_INIT_ONCE_GUARD (qs8_vmul );
62
+ XNN_INIT_ONCE_GUARD (qs8_vprelu );
60
63
XNN_INIT_ONCE_GUARD (qu8_vadd );
61
64
XNN_INIT_ONCE_GUARD (qu8_vmul );
62
-
65
+ XNN_INIT_ONCE_GUARD ( qu8_vprelu );
63
66
64
67
static void init_f16_vadd_config (void ) {
65
68
#if XNN_ARCH_ARM && XNN_ENABLE_ARM_FP16_VECTOR && XNN_ENABLE_ARM_FP16_SCALAR
@@ -1105,6 +1108,26 @@ static void init_qs8_vmul_config(void) {
1105
1108
#endif
1106
1109
}
1107
1110
1111
+ static void init_qs8_vprelu_config (void ) {
1112
+ #if XNN_ARCH_X86 || XNN_ARCH_X86_64
1113
+ const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1114
+ assert (hardware_config != NULL );
1115
+ if (hardware_config -> use_x86_avx2 ) {
1116
+ qs8_vprelu_config .op_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vprelu_ukernel__avx2_u16 ;
1117
+ qs8_vprelu_config .opc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vpreluc_ukernel__avx2_u16 ;
1118
+ qs8_vprelu_config .ropc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vpreluc_ukernel__avx2_u16 ;
1119
+ qs8_vprelu_config .init = (xnn_init_binary_params_fn ) xnn_init_qs8_vprelu_scalar_params ;
1120
+ qs8_vprelu_config .element_tile = 16 ;
1121
+ } else {
1122
+ qs8_vprelu_config .op_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vprelu_ukernel__scalar_u8 ;
1123
+ qs8_vprelu_config .opc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vpreluc_ukernel__scalar_u8 ;
1124
+ qs8_vprelu_config .ropc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vpreluc_ukernel__scalar_u8 ;
1125
+ qs8_vprelu_config .init = (xnn_init_binary_params_fn ) xnn_init_qs8_vprelu_scalar_params ;
1126
+ qs8_vprelu_config .element_tile = 8 ;
1127
+ }
1128
+ #endif
1129
+ }
1130
+
1108
1131
static void init_qu8_vadd_config (void ) {
1109
1132
#if XNN_ARCH_ARM
1110
1133
const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
@@ -1246,6 +1269,26 @@ static void init_qu8_vmul_config(void) {
1246
1269
#endif
1247
1270
}
1248
1271
1272
+ static void init_qu8_vprelu_config (void ) {
1273
+ #if XNN_ARCH_X86 || XNN_ARCH_X86_64
1274
+ const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1275
+ assert (hardware_config != NULL );
1276
+ if (hardware_config -> use_x86_avx2 ) {
1277
+ qu8_vprelu_config .op_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vprelu_ukernel__avx2_u16 ;
1278
+ qu8_vprelu_config .opc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vpreluc_ukernel__avx2_u16 ;
1279
+ qu8_vprelu_config .ropc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vpreluc_ukernel__avx2_u16 ;
1280
+ qu8_vprelu_config .init = (xnn_init_binary_params_fn ) xnn_init_qu8_vprelu_scalar_params ;
1281
+ qu8_vprelu_config .element_tile = 16 ;
1282
+ } else {
1283
+ qu8_vprelu_config .op_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vprelu_ukernel__scalar_u8 ;
1284
+ qu8_vprelu_config .opc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vpreluc_ukernel__scalar_u8 ;
1285
+ qu8_vprelu_config .ropc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vpreluc_ukernel__scalar_u8 ;
1286
+ qu8_vprelu_config .init = (xnn_init_binary_params_fn ) xnn_init_qu8_vprelu_scalar_params ;
1287
+ qu8_vprelu_config .element_tile = 8 ;
1288
+ }
1289
+ #endif
1290
+ }
1291
+
1249
1292
const struct xnn_binary_elementwise_config * xnn_init_f16_vadd_config () {
1250
1293
const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1251
1294
if (hardware_config == NULL || !xnn_is_f16_compatible_config (hardware_config )) {
@@ -1417,6 +1460,15 @@ const struct xnn_binary_elementwise_config* xnn_init_qs8_vmul_config() {
1417
1460
return & qs8_vmul_config ;
1418
1461
}
1419
1462
1463
+ const struct xnn_binary_elementwise_config * xnn_init_qs8_vprelu_config () {
1464
+ const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1465
+ if (hardware_config == NULL ) {
1466
+ return NULL ;
1467
+ }
1468
+ XNN_INIT_ONCE (qs8_vprelu );
1469
+ return & qs8_vprelu_config ;
1470
+ }
1471
+
1420
1472
const struct xnn_binary_elementwise_config * xnn_init_qu8_vadd_config () {
1421
1473
const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1422
1474
if (hardware_config == NULL ) {
@@ -1434,3 +1486,12 @@ const struct xnn_binary_elementwise_config* xnn_init_qu8_vmul_config() {
1434
1486
XNN_INIT_ONCE (qu8_vmul );
1435
1487
return & qu8_vmul_config ;
1436
1488
}
1489
+
1490
+ const struct xnn_binary_elementwise_config * xnn_init_qu8_vprelu_config () {
1491
+ const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1492
+ if (hardware_config == NULL ) {
1493
+ return NULL ;
1494
+ }
1495
+ XNN_INIT_ONCE (qu8_vprelu );
1496
+ return & qu8_vprelu_config ;
1497
+ }
0 commit comments