AlexeyAB
2018-08-09 3baf534a2d603f6b20a06ca45c29350e52a859fb
src/gemm.c
@@ -6,6 +6,10 @@
#include <stdio.h>
#include <math.h>
#if defined(_OPENMP)
#include <omp.h>
#endif
void gemm_bin(int M, int N, int K, float ALPHA,
        char  *A, int lda,
        float *B, int ldb,
@@ -458,6 +462,7 @@
    return _mm256_sad_epu8(total, _mm256_setzero_si256());
}
static inline int popcnt256_custom(__m256i n) {
    __m256i val = count256(n);
@@ -474,11 +479,13 @@
{
    int i;
#if defined(_OPENMP)
    static int max_num_threads = 0;
    if (max_num_threads == 0) {
        max_num_threads = omp_get_max_threads();
        omp_set_num_threads(max_num_threads / 2);
    }
#endif
    #pragma omp parallel for
    for (i = 0; i < M; ++i)