Add optional microbenchmarks for rezero/scan avx512
All checks were successful
Tests / Clang total: 2879, passed: 2879
Clang |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / 64 bit versions total: 2879, passed: 2879
Tests / Debug total: 2877, passed: 2877
Tests / SIMD fallback total: 2879, passed: 2879
Tests / Release [gcc] total: 2879, passed: 2879
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 2146, passed: 2146
Tests / Coverage total: 2163, passed: 2163
Code Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 98.92% (1834/1854)
* Branch Coverage: 66.85% (1496/2238)
* Complexity Density: 0.00
* Lines of Code: 1854
#### Quality Gates Summary
Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
All checks were successful
Tests / Clang total: 2879, passed: 2879
Clang |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / 64 bit versions total: 2879, passed: 2879
Tests / Debug total: 2877, passed: 2877
Tests / SIMD fallback total: 2879, passed: 2879
Tests / Release [gcc] total: 2879, passed: 2879
GNU C Compiler (gcc) |Total|New|Outstanding|Fixed|Trend
|:-:|:-:|:-:|:-:|:-:
|0|0|0|0|:clap:
Tests / Release [gcc,aarch64] total: 2146, passed: 2146
Tests / Coverage total: 2163, passed: 2163
Code Coverage #### Project Overview
No changes detected, that affect the code coverage.
* Line Coverage: 98.92% (1834/1854)
* Branch Coverage: 66.85% (1496/2238)
* Complexity Density: 0.00
* Lines of Code: 1854
#### Quality Gates Summary
Output truncated.
weaselab/conflict-set/pipeline/head This commit looks good
This commit is contained in:
@@ -4073,6 +4073,62 @@ struct __attribute__((visibility("default"))) PeakPrinter {
|
|||||||
|
|
||||||
#ifdef ENABLE_MAIN
|
#ifdef ENABLE_MAIN
|
||||||
|
|
||||||
|
#define ANKERL_NANOBENCH_IMPLEMENT
|
||||||
|
#include "third_party/nanobench.h"
|
||||||
|
|
||||||
|
template <int kN> void benchRezero() {
|
||||||
|
static_assert(kN % 16 == 0);
|
||||||
|
ankerl::nanobench::Bench bench;
|
||||||
|
InternalVersionT vs[kN];
|
||||||
|
InternalVersionT zero;
|
||||||
|
bench.run("rezero" + std::to_string(kN), [&]() {
|
||||||
|
bench.doNotOptimizeAway(vs);
|
||||||
|
bench.doNotOptimizeAway(zero);
|
||||||
|
for (int i = 0; i < kN; i += 16) {
|
||||||
|
rezero16(vs + i, zero);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
template <int kN> void benchScan1() {
|
||||||
|
static_assert(kN % 16 == 0);
|
||||||
|
ankerl::nanobench::Bench bench;
|
||||||
|
InternalVersionT vs[kN];
|
||||||
|
uint8_t is[kN];
|
||||||
|
uint8_t begin;
|
||||||
|
uint8_t end;
|
||||||
|
InternalVersionT v;
|
||||||
|
bench.run("scan" + std::to_string(kN), [&]() {
|
||||||
|
bench.doNotOptimizeAway(vs);
|
||||||
|
bench.doNotOptimizeAway(is);
|
||||||
|
bench.doNotOptimizeAway(begin);
|
||||||
|
bench.doNotOptimizeAway(end);
|
||||||
|
bench.doNotOptimizeAway(v);
|
||||||
|
for (int i = 0; i < kN; i += 16) {
|
||||||
|
scan16</*kAVX512=*/true>(vs + i, is + i, begin, end, v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
template <int kN> void benchScan2() {
|
||||||
|
static_assert(kN % 16 == 0);
|
||||||
|
ankerl::nanobench::Bench bench;
|
||||||
|
InternalVersionT vs[kN];
|
||||||
|
uint8_t is[kN];
|
||||||
|
uint8_t begin;
|
||||||
|
uint8_t end;
|
||||||
|
InternalVersionT v;
|
||||||
|
bench.run("scan" + std::to_string(kN), [&]() {
|
||||||
|
bench.doNotOptimizeAway(vs);
|
||||||
|
bench.doNotOptimizeAway(begin);
|
||||||
|
bench.doNotOptimizeAway(end);
|
||||||
|
bench.doNotOptimizeAway(v);
|
||||||
|
for (int i = 0; i < kN; i += 16) {
|
||||||
|
scan16</*kAVX512=*/true>(vs + i, begin, end, v);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void printTree() {
|
void printTree() {
|
||||||
int64_t writeVersion = 0;
|
int64_t writeVersion = 0;
|
||||||
ConflictSet::Impl cs{writeVersion};
|
ConflictSet::Impl cs{writeVersion};
|
||||||
@@ -4094,7 +4150,7 @@ void printTree() {
|
|||||||
debugPrintDot(stdout, cs.root, &cs);
|
debugPrintDot(stdout, cs.root, &cs);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(void) { printTree(); }
|
int main(void) { benchScan1<16>(); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ENABLE_FUZZ
|
#ifdef ENABLE_FUZZ
|
||||||
|
Reference in New Issue
Block a user