MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Init

Method Init

tensorflow/lite/experimental/ruy/test.h:1808–1817  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1806 public:
1807 RepeatedBuffer() = default;
1808 void Init(const T* elems, std::size_t num_elems, int num_repeats) {
1809 buffers_.clear();
1810 allocator_.FreeAll();
1811 for (int i = 0; i < num_repeats; i++) {
1812 T* p;
1813 allocator_.Allocate(num_elems, &p);
1814 memcpy(p, elems, num_elems * sizeof(T));
1815 buffers_.push_back(p);
1816 }
1817 }
1818 T* Next() {
1819 T* ret = buffers_[current_];
1820 current_ = (current_ + 1) % buffers_.size();

Callers 1

BenchmarkMethod · 0.45

Calls 4

clearMethod · 0.45
FreeAllMethod · 0.45
AllocateMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected