- Notifications
You must be signed in to change notification settings - Fork 1.6k
/
Copy pathbf16dot.c
52 lines (37 loc) · 957 Bytes
/
bf16dot.c
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
#include<stdio.h>
#include"common.h"
#ifdefFUNCTION_PROFILE
#include"functable.h"
#endif
#ifndefCBLAS
floatNAME(blasint*N, bfloat16*x, blasint*INCX, bfloat16*y, blasint*INCY){
BLASLONGn=*N;
BLASLONGincx=*INCX;
BLASLONGincy=*INCY;
floatret;
PRINT_DEBUG_NAME;
if (n <= 0) return0.;
IDEBUG_START;
FUNCTION_PROFILE_START();
if (incx<0) x-= (n-1) *incx;
if (incy<0) y-= (n-1) *incy;
ret=BF16_DOT_K(n, x, incx, y, incy);
FUNCTION_PROFILE_END(1, 2*n, 2*n);
IDEBUG_END;
returnret;
}
#else
floatCNAME(blasintn, bfloat16*x, blasintincx, bfloat16*y, blasintincy){
floatret;
PRINT_DEBUG_CNAME;
if (n <= 0) return0.;
IDEBUG_START;
FUNCTION_PROFILE_START();
if (incx<0) x-= (n-1) *incx;
if (incy<0) y-= (n-1) *incy;
ret=BF16_DOT_K(n, x, incx, y, incy);
FUNCTION_PROFILE_END(1, 2*n, 2*n);
IDEBUG_END;
returnret;
}
#endif