Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tools/kokoro/tests/test_kokoro_layer_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,19 @@ int main() {
detail::KokoroLayerOptionsScope s(opts(true));
snake1d_forward(x1.data(), 4, 1000, a.data());
}
// Both paths round the final x + sin^2(a x) / a to float, so each
// can be up to half an ulp of the output away from the exact value.
// Subtract that one-ulp allowance, then scale by |a| so the result
// is in sin^2 units and comparable to the fast_sin2 bound.
double e = 0;
for (int c = 0; c < 4; ++c)
for (int t = 0; t < 1000; ++t)
e = std::max(e, std::fabs((double) x[c * 1000 + t] - x1[c * 1000 + t]) * std::fabs(a[c]));
for (int t = 0; t < 1000; ++t) {
const float r = x[c * 1000 + t];
const double ulp = (double) std::nextafter(std::fabs(r), INFINITY) - std::fabs(r);
const double d = std::fabs((double) r - x1[c * 1000 + t]);
e = std::max(e, std::max(0.0, d - ulp) * std::fabs(a[c]));
}
std::printf("snake1d fast vs libm: max excess over output rounding %.3g\n", e);
CHECK(e < 1e-6, "snake mismatch %.3g", e);
}

Expand Down
1 change: 1 addition & 0 deletions tools/misaki-g2p/src/espeak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ u32 EspeakFallback::phonemize_line(const u32 & text) {
return out;
#else
(void) text;
(void) data_dir_;
return u32();
#endif
}
Expand Down
3 changes: 2 additions & 1 deletion tools/misaki-g2p/src/lexicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Reader for misaki-en-us.lex (written by convert_misaki_lexicon.py).
#include "misaki-internal.h"

#include <algorithm>
#include <cerrno>
#include <cstdio>
#include <cstring>
Expand Down Expand Up @@ -124,7 +125,7 @@ std::unique_ptr<LexFile> LexFile::open(const std::string & path, std::string & e

LexFile::~LexFile() {
#if !defined(MISAKI_NO_MMAP)
if (mapped_ && base_) munmap((void *) base_, size_);
if (mapped_ && base_) munmap(const_cast<uint8_t *>(base_), size_);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion tools/misaki-g2p/src/misaki-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class EspeakFallback {
u32 phonemize_line(const u32 & text);
// libespeak-ng is process-global: another handle may have re-initialised
// it with a different data directory since this one was opened.
[[maybe_unused]] std::string data_dir_;
std::string data_dir_;
};
bool espeak_linked();

Expand Down
1 change: 1 addition & 0 deletions tools/misaki-g2p/src/tagger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
// so the rules aim at those decisions, not at full tagging accuracy.
#include "misaki-internal.h"

#include <algorithm>
#include <unordered_map>
#include <unordered_set>

Expand Down
1 change: 1 addition & 0 deletions tools/misaki-g2p/tests/test_agreement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "misaki-g2p.h"
#include "misaki-internal.h"

#include <algorithm>
#include <cstdint>
#include <cstdio>
#include <cstring>
Expand Down
1 change: 1 addition & 0 deletions tools/parakeet/tests/test_parakeet_kernels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "pk-ops.h"
#include "pk-pool.h"

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
Expand Down
1 change: 1 addition & 0 deletions tools/parakeet/tools/parakeet-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include "parakeet.h"
#include "pk-wav.h"

#include <algorithm>
#include <chrono>
#include <cstdio>
#include <cstdlib>
Expand Down
1 change: 1 addition & 0 deletions tools/parakeet/tools/pk-wav.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// windowed-sinc resampler to 16 kHz.
#pragma once

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
Expand Down
Loading