From f92b20580a21663c5db9eb8608f8cabd7adbeb10 Mon Sep 17 00:00:00 2001
From: AlexeyAB <alexeyab84@gmail.com>
Date: Mon, 13 Aug 2018 22:51:31 +0000
Subject: [PATCH] Some fixes for AVX support on CPU
---
src/convolutional_layer.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/convolutional_layer.c b/src/convolutional_layer.c
index 927eb99..e7c8e3f 100644
--- a/src/convolutional_layer.c
+++ b/src/convolutional_layer.c
@@ -621,7 +621,7 @@
free(align_weights);
}
-
+// further optimizations: im2col_bin() for XNOR, and then transpose_aling_bin()
size_t binary_transpose_align_input(int k, int n, float *b, char **t_bit_input, size_t ldb_align)
{
size_t new_ldb = k + (ldb_align - k%ldb_align); // (k / 8 + 1) * 8;
@@ -690,7 +690,8 @@
//}
//if (l.xnor && l.size == 3 && l.stride == 1 && l.pad == 1) {}
//else
- im2col_cpu_custom(state.input, l.c, l.h, l.w, l.size, l.stride, l.pad, b);
+ // further optimizations: im2col_bin() for XNOR, and then transpose_aling_bin()
+ im2col_cpu_custom(state.input, l.c, l.h, l.w, l.size, l.stride, l.pad, b);
//gemm(0,0,m,n,k,1,a,k,b,n,1,c,n);
@@ -793,6 +794,8 @@
//char *t_bit_input = calloc(new_ldb * n, sizeof(char)); // for im2col_cpu_custom_transpose() only
//float_to_bit(t_input, t_bit_input, new_ldb * n); // for im2col_cpu_custom_transpose() only
+ // 5x times faster than gemm()-float32
+ // further optimizations: accelerate maxpool-layer with OpenMP/AVX
gemm_nn_custom_bin_mean_transposed(m, n, k, 1, l.align_bit_weights, new_ldb, t_bit_input, new_ldb, c, n, l.mean_arr);
//gemm_nn_custom_bin_mean_transposed(m, n, k, 1, bit_weights, k, t_bit_input, new_ldb, c, n, mean_arr);
--
Gitblit v1.10.0