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

Function AlignedBufferBytes

tensorflow/compiler/xla/cpu_function_runtime.cc:58–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56
57namespace cpu_function_runtime {
58size_t AlignedBufferBytes(const BufferInfo* buffer_infos, size_t n,
59 bool allocate_entry_params) {
60 size_t total = 0;
61 for (size_t i = 0; i < n; ++i) {
62 bool should_allocate =
63 buffer_infos[i].is_temp_buffer() ||
64 (buffer_infos[i].is_entry_parameter() && allocate_entry_params);
65
66 if (should_allocate) {
67 total += align_to(buffer_infos[i].size(), kAlign);
68 }
69 }
70 return total;
71}
72
73void* MallocContiguousBuffers(const BufferInfo* buffer_infos, size_t n,
74 bool allocate_entry_params, void** bufs,

Callers 3

GenerateHeaderFunction · 0.85
MallocContiguousBuffersFunction · 0.85

Calls 4

align_toFunction · 0.85
is_temp_bufferMethod · 0.80
is_entry_parameterMethod · 0.80
sizeMethod · 0.45

Tested by 1