MCPcopy Create free account
hub / github.com/apache/arrow / Read

Function Read

cpp/src/arrow/io/memory_benchmark.cc:87–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85# endif // ARROW_HAVE_AVX512
86
87static void Read(void* src, void* dst, size_t size) {
88 const auto simd = static_cast<VectorType*>(src);
89 VectorType a, b, c, d;
90 (void)dst;
91
92 for (size_t i = 0; i < size / sizeof(VectorType); i += 4) {
93 VectorLoadAsm(simd[i], a);
94 VectorLoadAsm(simd[i + 1], b);
95 VectorLoadAsm(simd[i + 2], c);
96 VectorLoadAsm(simd[i + 3], d);
97 }
98
99 memset(&a, 0, sizeof(a));
100 memset(&b, 0, sizeof(b));
101 memset(&c, 0, sizeof(c));
102 memset(&d, 0, sizeof(d));
103
104 auto result = a + b + c + d;
105 benchmark::DoNotOptimize(result);
106}
107
108// See http://codearcana.com/posts/2013/05/18/achieving-maximum-memory-bandwidth.html
109// for the usage of stream loads/writes. Or section 6.1, page 47 of

Callers 7

ReadAtMethod · 0.70
ReadMethod · 0.70
AdvanceMethod · 0.70
ReadAtMethod · 0.70
TESTFunction · 0.50
ReadMethod · 0.50
ReadAsyncMethod · 0.50

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.40