-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBLAS.h
64 lines (50 loc) · 2.4 KB
/
BLAS.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// BLAS.h
// ConvNet
//
// Created by Márton Szemenyei on 2017. 09. 28..
// Copyright © 2017. Márton Szemenyei. All rights reserved.
//
#ifndef BLAS_h
#define BLAS_h
#include <cstdint>
#include "Utils.h"
void im2col(const float* data_im,
int32_t channels, int32_t height, int32_t width,
Tuple ksize, Tuple stride, Tuple pad, Tuple dilation, float* data_col);
void im2colLUT(const float* data_im, int32_t size, int32_t *lut, float* data_col);
void getim2colLUT(int32_t channels, int32_t height, int32_t width,
Tuple ksize, Tuple stride, Tuple pad, Tuple dilation, int32_t* data_col);
void col2im(const float* data_col,
int32_t channels, int32_t height, int32_t width,
Tuple ksize, Tuple stride, Tuple pad, float* data_im);
void reorg(const float *x, int32_t w, int32_t h, int32_t c, Tuple stride, bool forward, float *out);
void concat(const float *x, const float *y, int32_t n1, int32_t n2, float *out);
void shortcut( int32_t w, int32_t h, int32_t ch, const float *add, float *out);
void addBias( float *inout, const float* bias, int32_t ch, int32_t n);
void fill(int32_t N, float ALPHA, float *X);
void gemm(bool TA, bool TB, int32_t M, int32_t N, int32_t K,
const float *A, int32_t lda,
const float *B, int32_t ldb,
float BETA,
float *C, int32_t ldc);
void gemm_nn(int32_t M, int32_t N, int32_t K,
const float *A, int32_t lda,
const float *B, int32_t ldb,
float *C, int32_t ldc);
void gemm_nt(int32_t M, int32_t N, int32_t K,
const float *A, int32_t lda,
const float *B, int32_t ldb,
float *C, int32_t ldc);
void gemm_tn(int32_t M, int32_t N, int32_t K,
const float *A, int32_t lda,
const float *B, int32_t ldb,
float *C, int32_t ldc);
void gemm_tt(int32_t M, int32_t N, int32_t K,
const float *A, int32_t lda,
const float *B, int32_t ldb,
float *C, int32_t ldc);
void batchNorm(float *x, const float *mean, const float *variance, const float *gamma, const float *beta, int32_t filters, int32_t spatial);
void batchNormNaive(float *x, const float *mean, const float *variance, const float *gamma, const float *beta, int32_t filters, int32_t spatial);
void batchNorm(float *x, const float *mean, const float *variance, int32_t filters, int32_t spatial);
#endif /* BLAS_h */