Skip to content
Snippets Groups Projects
Commit ce4d70c9 authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[StreamingFC] fix pragmas for array partitioning

parent d54b5fc4
No related branches found
No related tags found
No related merge requests found
......@@ -628,18 +628,27 @@ class StreamingFCLayer_Batch(HLSCustomOp):
self.code_gen_dict["$PRAGMAS$"].append(
"#pragma HLS INTERFACE ap_ctrl_none port=return"
)
# the weight tensor is ap_uint<simd*prec> [PE][WMEM]
# partition for parallel access along the PE dimension (dim 1)
self.code_gen_dict["$PRAGMAS$"].append(
"DO_PRAGMA(HLS ARRAY_PARTITION variable=weights complete dim=1)"
)
self.code_gen_dict["$PRAGMAS$"].append(
"DO_PRAGMA(HLS ARRAY_PARTITION variable=weights complete dim=2)"
(
"DO_PRAGMA(HLS ARRAY_PARTITION "
"variable=weights.m_weights complete dim=1)"
)
)
# the threshold tensor is acc_type [PE][TMEM][N_THRES]
# partition for parallel access along PE and N_THRES dimensions (dims 1 and 3)
if self.calc_tmem() != 0:
# TODO find a better way of checking for no pregenerated thresholds
self.code_gen_dict["$PRAGMAS$"].append(
"DO_PRAGMA(HLS ARRAY_PARTITION variable=threshs complete dim=1)"
(
"DO_PRAGMA(HLS ARRAY_PARTITION variable=threshs.m_thresholds "
"complete dim=1)"
)
)
self.code_gen_dict["$PRAGMAS$"].append(
"DO_PRAGMA(HLS ARRAY_PARTITION variable=threshs complete dim=3)"
(
"DO_PRAGMA(HLS ARRAY_PARTITION variable=threshs.m_thresholds "
"complete dim=3)"
)
)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment