Skip to content
Snippets Groups Projects
Commit 99a91584 authored by auphelia's avatar auphelia
Browse files

[CustomOp] Fix setting of NumReps in Thresholding and N in Eltwise node

parent 79493efb
No related branches found
No related tags found
No related merge requests found
...@@ -398,7 +398,7 @@ class StreamingEltwise(HLSCustomOp): ...@@ -398,7 +398,7 @@ class StreamingEltwise(HLSCustomOp):
"StreamingEltwise", "StreamingEltwise",
self.get_nodeattr("NumChannels"), self.get_nodeattr("NumChannels"),
self.get_nodeattr("PE"), self.get_nodeattr("PE"),
self.get_number_output_values(), int(np.prod(self.get_folded_output_shape()[:-2])),
slice_in0, slice_in0,
slice_in1, slice_in1,
slice_out, slice_out,
......
...@@ -600,8 +600,12 @@ class Thresholding_Batch(HLSCustomOp): ...@@ -600,8 +600,12 @@ class Thresholding_Batch(HLSCustomOp):
# TODO check and add whatever missing # TODO check and add whatever missing
def defines(self, var): def defines(self, var):
numInputVectors = list(self.get_nodeattr("numInputVectors")) if self.get_nodeattr("mem_mode") == "const":
numReps = int(np.prod(numInputVectors)) numReps = 1
else:
numInputVectors = list(self.get_nodeattr("numInputVectors"))
numReps = int(np.prod(numInputVectors))
self.code_gen_dict["$DEFINES$"] = [ self.code_gen_dict["$DEFINES$"] = [
"""#define NumChannels1 {}\n #define PE1 {}\n #define numReps {}""".format( """#define NumChannels1 {}\n #define PE1 {}\n #define numReps {}""".format(
self.get_nodeattr("NumChannels"), self.get_nodeattr("NumChannels"),
......
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