Skip to content

Commit 9448b12

Browse files
committed
feat[shared_lib]: small opti for input buffer to vector
1 parent d9c0370 commit 9448b12

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

hls4ml/templates/vitis_accelerator/libs/DataBatcher.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,7 @@ template <class T, class U> class DataBatcher {
8383

8484
std::cout << "Loading data from memory buffer" << std::endl;
8585
originalSampleCount = size / _sampleInputSize;
86-
inputData.resize(size);
87-
for (uint64_t i = 0; i < size; i++) {
88-
inputData[i] = static_cast<T>(data[i]);
89-
}
86+
inputData = std::vector<T>(data, data + size);
9087

9188
// Zero-pad
9289
numBatches = std::ceil(static_cast<double>(originalSampleCount) / _batchsize);

0 commit comments

Comments
 (0)