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

Function StreamRead

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

See http://codearcana.com/posts/2013/05/18/achieving-maximum-memory-bandwidth.html for the usage of stream loads/writes. Or section 6.1, page 47 of https://akkadia.org/drepper/cpumemory.pdf .

Source from the content-addressed store, hash-verified

109// for the usage of stream loads/writes. Or section 6.1, page 47 of
110// https://akkadia.org/drepper/cpumemory.pdf .
111static void StreamRead(void* src, void* dst, size_t size) {
112 auto simd = static_cast<VectorType*>(src);
113 VectorType a, b, c, d;
114 (void)dst;
115
116 memset(&a, 0, sizeof(a));
117 memset(&b, 0, sizeof(b));
118 memset(&c, 0, sizeof(c));
119 memset(&d, 0, sizeof(d));
120
121 for (size_t i = 0; i < size / sizeof(VectorType); i += 4) {
122 VectorStreamLoadAsm(simd[i], a);
123 VectorStreamLoadAsm(simd[i + 1], b);
124 VectorStreamLoadAsm(simd[i + 2], c);
125 VectorStreamLoadAsm(simd[i + 3], d);
126 }
127
128 auto result = a + b + c + d;
129 benchmark::DoNotOptimize(result);
130}
131
132static void StreamWrite(void* src, void* dst, size_t size) {
133 auto simd = static_cast<VectorType*>(dst);

Callers

nothing calls this directly

Calls 1

armv8_stream_load_pairFunction · 0.85

Tested by

no test coverage detected