| | |
| | | #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,
|
| | |
| | |
|
| | | return _mm256_sad_epu8(total, _mm256_setzero_si256());
|
| | | }
|
| | | |
| | | static inline int popcnt256_custom(__m256i n) {
|
| | | __m256i val = count256(n);
|
| | |
|
| | |
| | | {
|
| | | 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)
|
| | |
| | | #ifndef GEMM_H |
| | | #define GEMM_H |
| | | #include "activations.h" |
| | | #include <stdint.h> |
| | | |
| | | static inline void set_bit(unsigned char *const dst, size_t index) { |
| | | size_t dst_i = index / 8; |