@@ -32,11 +32,15 @@ static struct xnn_binary_elementwise_config f32_vprelu_config = {0};
32
32
static struct xnn_binary_elementwise_config f32_vsub_config = {0 };
33
33
static struct xnn_binary_elementwise_config f32_vsqrdiff_config = {0 };
34
34
35
+
35
36
static struct xnn_binary_elementwise_config qs8_vadd_config = {0 };
36
37
static struct xnn_binary_elementwise_config qs8_vmul_config = {0 };
38
+ static struct xnn_binary_elementwise_config qs8_vprelu_config = {0 };
39
+
37
40
38
41
static struct xnn_binary_elementwise_config qu8_vadd_config = {0 };
39
42
static struct xnn_binary_elementwise_config qu8_vmul_config = {0 };
43
+ static struct xnn_binary_elementwise_config qu8_vprelu_config = {0 };
40
44
41
45
XNN_INIT_ONCE_GUARD (f16_vadd );
42
46
XNN_INIT_ONCE_GUARD (f16_vdiv );
@@ -57,8 +61,10 @@ XNN_INIT_ONCE_GUARD(f32_vsub);
57
61
XNN_INIT_ONCE_GUARD (f32_vsqrdiff );
58
62
XNN_INIT_ONCE_GUARD (qs8_vadd );
59
63
XNN_INIT_ONCE_GUARD (qs8_vmul );
64
+ XNN_INIT_ONCE_GUARD (qs8_vprelu );
60
65
XNN_INIT_ONCE_GUARD (qu8_vadd );
61
66
XNN_INIT_ONCE_GUARD (qu8_vmul );
67
+ XNN_INIT_ONCE_GUARD (qu8_vprelu );
62
68
63
69
64
70
static void init_f16_vadd_config (void ) {
@@ -1105,6 +1111,30 @@ static void init_qs8_vmul_config(void) {
1105
1111
#endif
1106
1112
}
1107
1113
1114
+ static void init_qs8_vprelu_config (void ) {
1115
+ #if XNN_ARCH_X86 || XNN_ARCH_X86_64
1116
+ const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1117
+ assert (hardware_config != NULL );
1118
+ if (hardware_config -> use_x86_avx2 )
1119
+ {
1120
+ qs8_vprelu_config .op_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vprelu_ukernel__avx2_u16 ;
1121
+ qs8_vprelu_config .opc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vpreluc_ukernel__avx2_u16 ;
1122
+ qs8_vprelu_config .ropc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vpreluc_ukernel__avx2_u16 ;
1123
+ qs8_vprelu_config .init = (xnn_init_binary_params_fn ) xnn_init_qs8_vprelu_scalar_params ;
1124
+ qs8_vprelu_config .element_tile = 16 ;
1125
+ }
1126
+ else
1127
+ {
1128
+ qs8_vprelu_config .op_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vprelu_ukernel__scalar_u8 ;
1129
+ qs8_vprelu_config .opc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vpreluc_ukernel__scalar_u8 ;
1130
+ qs8_vprelu_config .ropc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qs8_vpreluc_ukernel__scalar_u8 ;
1131
+ qs8_vprelu_config .init = (xnn_init_binary_params_fn ) xnn_init_qs8_vprelu_scalar_params ;
1132
+ qs8_vprelu_config .element_tile = 8 ;
1133
+ }
1134
+
1135
+ #endif
1136
+ }
1137
+
1108
1138
static void init_qu8_vadd_config (void ) {
1109
1139
#if XNN_ARCH_ARM
1110
1140
const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
@@ -1246,6 +1276,30 @@ static void init_qu8_vmul_config(void) {
1246
1276
#endif
1247
1277
}
1248
1278
1279
+ static void init_qu8_vprelu_config (void ) {
1280
+ #if XNN_ARCH_X86 || XNN_ARCH_X86_64
1281
+ const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1282
+ assert (hardware_config != NULL );
1283
+ if (hardware_config -> use_x86_avx2 )
1284
+ {
1285
+ qu8_vprelu_config .op_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vprelu_ukernel__avx2_u16 ;
1286
+ qu8_vprelu_config .opc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vpreluc_ukernel__avx2_u16 ;
1287
+ qu8_vprelu_config .ropc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vpreluc_ukernel__avx2_u16 ;
1288
+ qu8_vprelu_config .init = (xnn_init_binary_params_fn ) xnn_init_qu8_vprelu_scalar_params ;
1289
+ qu8_vprelu_config .element_tile = 16 ;
1290
+ }
1291
+ else
1292
+ {
1293
+ qu8_vprelu_config .op_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vprelu_ukernel__scalar_u8 ;
1294
+ qu8_vprelu_config .opc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vpreluc_ukernel__scalar_u8 ;
1295
+ qu8_vprelu_config .ropc_ukernel = (xnn_vbinary_ukernel_fn ) xnn_qu8_vpreluc_ukernel__scalar_u8 ;
1296
+ qu8_vprelu_config .init = (xnn_init_binary_params_fn ) xnn_init_qu8_vprelu_scalar_params ;
1297
+ qu8_vprelu_config .element_tile = 8 ;
1298
+ }
1299
+
1300
+ #endif
1301
+ }
1302
+
1249
1303
const struct xnn_binary_elementwise_config * xnn_init_f16_vadd_config () {
1250
1304
const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1251
1305
if (hardware_config == NULL || !xnn_is_f16_compatible_config (hardware_config )) {
@@ -1417,6 +1471,15 @@ const struct xnn_binary_elementwise_config* xnn_init_qs8_vmul_config() {
1417
1471
return & qs8_vmul_config ;
1418
1472
}
1419
1473
1474
+ const struct xnn_binary_elementwise_config * xnn_init_qs8_vprelu_config () {
1475
+ const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1476
+ if (hardware_config == NULL ) {
1477
+ return NULL ;
1478
+ }
1479
+ XNN_INIT_ONCE (qs8_vprelu );
1480
+ return & qs8_vprelu_config ;
1481
+ }
1482
+
1420
1483
const struct xnn_binary_elementwise_config * xnn_init_qu8_vadd_config () {
1421
1484
const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1422
1485
if (hardware_config == NULL ) {
@@ -1434,3 +1497,12 @@ const struct xnn_binary_elementwise_config* xnn_init_qu8_vmul_config() {
1434
1497
XNN_INIT_ONCE (qu8_vmul );
1435
1498
return & qu8_vmul_config ;
1436
1499
}
1500
+
1501
+ const struct xnn_binary_elementwise_config * xnn_init_qu8_vprelu_config () {
1502
+ const struct xnn_hardware_config * hardware_config = xnn_init_hardware_config ();
1503
+ if (hardware_config == NULL ) {
1504
+ return NULL ;
1505
+ }
1506
+ XNN_INIT_ONCE (qu8_vprelu );
1507
+ return & qu8_vprelu_config ;
1508
+ }
0 commit comments