PandA-2024.02
examples
mm
module.c
Go to the documentation of this file.
1
#define A_ROWS 16
2
#define A_COLS 16
3
#define B_ROWS 16
4
#define B_COLS 16
5
// matrix multiplication of a A*B matrix
6
void
mm
(
int
in_a[
A_ROWS
][
A_COLS
],
int
in_b[A_COLS][
B_COLS
],
int
out_c[
A_ROWS
][B_COLS])
7
{
8
int
i,j,
k
;
9
#ifdef UNROLL_LOOPS1
10
#if defined(__clang__)
11
#pragma clang loop unroll(full)
12
#endif
13
#endif
14
for
(i = 0; i <
A_ROWS
; i++)
15
{
16
#ifdef UNROLL_LOOPS2
17
#if defined(__clang__)
18
#pragma clang loop unroll(full)
19
#endif
20
#endif
21
for
(j = 0; j <
B_COLS
; j++)
22
{
23
int
sum_mult = 0;
24
#ifdef UNROLL_LOOPS3
25
#if defined(__clang__)
26
#pragma clang loop unroll(full)
27
#endif
28
#endif
29
for
(k = 0; k <
A_COLS
; k++)
30
{
31
sum_mult += in_a[i][
k
] * in_b[
k
][j];
32
}
33
out_c[i][j] = sum_mult;
34
}
35
}
36
}
A_COLS
#define A_COLS
Definition:
module.c:2
mm
void mm(int in_a[A_ROWS][A_COLS], int in_b[A_COLS][B_COLS], int out_c[A_ROWS][B_COLS])
Definition:
module.c:6
k
static const uint32_t k[]
Definition:
sha-256.c:22
A_ROWS
#define A_ROWS
Definition:
module.c:1
B_COLS
#define B_COLS
Definition:
module.c:4
Generated on Mon Feb 12 2024 13:02:48 for PandA-2024.02 by
1.8.13