PandA-2024.02
examples
MachSuite
MachSuite
stencil
stencil2d
stencil.c
Go to the documentation of this file.
1
#include "
stencil.h
"
2
3
void
stencil
(
TYPE
orig[
row_size
*
col_size
],
TYPE
sol[
row_size
* col_size],
TYPE
filter
[
f_size
]){
4
int
r, c, k1, k2;
5
TYPE
temp, mul;
6
7
stencil_label1:
for
(r=0; r<
row_size
-2; r++) {
8
stencil_label2:
for
(c=0; c<col_size-2; c++) {
9
temp = (
TYPE
)0;
10
stencil_label3:
for
(k1=0;k1<3;k1++){
11
stencil_label4:
for
(k2=0;k2<3;k2++){
12
mul =
filter
[k1*3 + k2] * orig[(r+k1)*col_size + c+k2];
13
temp += mul;
14
}
15
}
16
sol[(r*
col_size
) + c] = temp;
17
}
18
}
19
}
filter
void filter(int y, int input[][DIMENSION_X], int *output)
a 3x3 box filter. Filter an entire row of the matrix in one call.
Definition:
boxfilter.c:26
col_size
#define col_size
Definition:
gemm.h:17
stencil.h
TYPE
#define TYPE
Definition:
backprop.h:21
stencil
void stencil(TYPE orig[row_size *col_size], TYPE sol[row_size *col_size], TYPE filter[f_size])
Definition:
stencil.c:3
row_size
#define row_size
Definition:
gemm.h:16
f_size
#define f_size
Definition:
stencil.h:8
Generated on Mon Feb 12 2024 13:02:50 for PandA-2024.02 by
1.8.13