sizes.cpp

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#include <felspar/memory/sizes.hpp>
#include <felspar/test.hpp>


namespace {


    auto const suite = felspar::testsuite("sizes");


    auto const bs = suite.test("block_size", [](auto check) {

Whole multiples

13
14
        check(felspar::memory::block_size(8, 8)) == 8u;
        check(felspar::memory::block_size(16, 8)) == 16u;

Over-aligned

16
17
18
19
20
21
22
23
        check(felspar::memory::block_size(2, 8)) == 8u;
        check(felspar::memory::block_size(4, 8)) == 8u;
        check(felspar::memory::block_size(10, 8)) == 16u;
        check(felspar::memory::block_size(58, 8)) == 64u;
    });


}