Skip to content

Commit

Permalink
Adapt new interface for get_cache
Browse files Browse the repository at this point in the history
  • Loading branch information
jk-jeon committed May 7, 2024
1 parent c10c340 commit bac7171
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions subproject/test/source/verify_compressed_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool verify_compressed_cache(GetCache&& get_cache, ConvertToBigUInt&& convert_to
e <= format::max_exponent - format::significand_bits; ++e) {
int const k = impl::kappa - jkj::dragonbox::detail::log::floor_log10_pow2(e);

auto const real_cache = jkj::dragonbox::policy::cache::full.get_cache<format>(k);
auto const real_cache = jkj::dragonbox::policy::cache::full.get_cache<format, int>(k);

auto const recovered_cache = get_cache(k);
if (!recovered_cache.success) {
Expand Down Expand Up @@ -141,7 +141,7 @@ int main() {
jkj::dragonbox::ieee754_binary32, std::uint_least32_t>>(
[](int k) {
return recovered_cache_t<cache_holder_type::cache_entry_type>{
cache_holder_type::get_cache(k), true};
cache_holder_type::get_cache<int>(k), true};
},
[](cache_holder_type::cache_entry_type value) { return jkj::big_uint{value}; }, 7)) {
std::cout << "Verification succeeded. No error detected.\n\n";
Expand Down
4 changes: 2 additions & 2 deletions subproject/test/source/verify_fast_multiplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static bool verify_fast_multiplication_xz(CachePolicy&& cache_policy) {
int const beta = e + floor_log2_pow10(k);

// Load cache.
auto const cache = cache_policy.template get_cache<format>(k);
auto const cache = cache_policy.template get_cache<format, int>(k);

// Compute the endpoints using the fast method.
auto x_fast =
Expand Down Expand Up @@ -106,7 +106,7 @@ static bool verify_fast_multiplication_yru(CachePolicy&& cache_policy) {
bool success = true;

for (int k = impl::min_k; k <= impl::max_k; ++k) {
auto const cache = cache_policy.template get_cache<format>(k);
auto const cache = cache_policy.template get_cache<format, int>(k);

// Since Q - p - beta - 2 >= q, it suffices to check that the lower half of the cache is not
// 0.
Expand Down

0 comments on commit bac7171

Please sign in to comment.