8#ifndef NO_MULTITHREADING
20 std::vector<uint8_t>
data(1024);
23 std::for_each(
data.begin(),
data.end(), [](
auto& i) { i = i & 0x80; });
24 std::for_each(
data.begin(),
data.end(), [](
auto& i) { i = i | 0x01; });
25 std::for_each(
data.begin(),
data.end(), [](
auto& i) { i = static_cast<uint8_t>(i << 3); });
33 info(
"thread_test_abort aborting");
39 info(
"test starting...");
41 size_t NUM_THREADS = ntohl(*thread_num);
42 std::vector<std::thread> threads(NUM_THREADS);
44 test_data.
iterations = ntohl(*iterations) / NUM_THREADS;
46 for (
size_t i = 0; i < NUM_THREADS; i++) {
51 for (
size_t i = 0; i < NUM_THREADS; i++) {
55 info(
"test complete with counter at: ",
static_cast<size_t>(test_data.
counter),
" ", t.
seconds(),
"s");
56 *out = htonl(test_data.
counter);
67 info(
"test_abort aborting");
77 static_cast<void>(fprintf(stdout,
"c: hello stdout!"));
78 static_cast<void>(fflush(stdout));
79 static_cast<void>(fprintf(stderr,
"c: hello stderr!"));
Get the execution between a block of code.
double seconds() const
Return the number of seconds elapsed since the start of the timer.
void thread_test_abort_entry_point(void *)
WASM_EXPORT void test_threads(uint32_t const *thread_num, uint32_t const *iterations, uint32_t *out)
WASM_EXPORT void common_init_slab_allocator(uint32_t const *circuit_size)
WASM_EXPORT void test_stdout_stderr()
void thread_test_entry_point(test_threads_data *v)
WASM_EXPORT void test_thread_abort()
WASM_EXPORT void test_abort()
const std::vector< FF > data
void init_slab_allocator(size_t circuit_subgroup_size)
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
std::atomic< uint32_t > counter