Skip to content
Snippets Groups Projects
Commit faadf709 authored by Nicolas Pfeiffer's avatar Nicolas Pfeiffer
Browse files

clean up in benchmarks

parent b0894831
Branches
Tags
No related merge requests found
...@@ -37,3 +37,17 @@ target_link_libraries(rectmul_emper_continuation Threads::Threads emper) ...@@ -37,3 +37,17 @@ target_link_libraries(rectmul_emper_continuation Threads::Threads emper)
add_executable(strassen_emper_continuation ../strassen.cpp) add_executable(strassen_emper_continuation ../strassen.cpp)
target_link_libraries(strassen_emper_continuation Threads::Threads emper) target_link_libraries(strassen_emper_continuation Threads::Threads emper)
add_test(cholesky cholesky_emper_continuation)
add_test(fft fft_emper_continuation)
add_test(fib fib_emper_continuation)
add_test(heat heat_emper_continuation)
add_test(integrate integrate_emper_continuation)
add_test(knapsack knapsack_emper_continuation)
add_test(lu lu_emper_continuation)
add_test(matmul matmul_emper_continuation)
add_test(nqueens nqueens_emper_continuation)
add_test(quicksort quicksort_emper_continuation)
add_test(rectmul rectmul_emper_continuation)
add_test(strassen strassen_emper_continuation)
...@@ -40,47 +40,20 @@ public: ...@@ -40,47 +40,20 @@ public:
#include "fork.h" #include "fork.h"
#ifndef EMPER_LOCKED_FIBRIL #ifdef EMPER_LOCKED_FIBRIL
#define _fibril_inc_count(f)
#define fibril_fork_nrt(fp, fn, ag) do { \ #else
auto _fibril_##fn##_fork = [](_fibril_defs ag fibril_t * f) __attribute__((noinline, hot, optimize(3))) { \ #define _fibril_inc_count(f) \
(*f)->cont.ip = __builtin_return_address(0); \
if (!(*f)->incremented) { \
(*f)->incremented = 1; \
(*f)->count.fetch_add(1, std::memory_order_relaxed); \
} \
Runtime* runtime = Runtime::getRuntime(); \
runtime->pushBottom(**f); \
fn(_fibril_args ag); \
if (!runtime->popBottom()) { \
(*f)->resume(); \
} \
}; \
membar(_fibril_##fn##_fork(_fibril_expand ag fp)); \
} while (0);
#define fibril_fork_wrt(fp, rt, fn, ag) do { \
auto _fibril_##fn##_fork = [](_fibril_defs ag fibril_t * f, __typeof__(rt) p) __attribute__((noinline, hot, optimize(3))) { \
(*f)->cont.ip = __builtin_return_address(0); \
if (!(*f)->incremented) { \ if (!(*f)->incremented) { \
(*f)->incremented = 1; \ (*f)->incremented = 1; \
(*f)->count.fetch_add(1, std::memory_order_relaxed); \ (*f)->count.fetch_add(1, std::memory_order_relaxed); \
} \ }
Runtime* runtime = Runtime::getRuntime(); \ #endif
runtime->pushBottom(**f); \
*p = fn(_fibril_args ag); \
if (!runtime->popBottom()) { \
(*f)->resume(); \
} \
}; \
membar(_fibril_##fn##_fork(_fibril_expand ag fp, rt)); \
} while (0);
#else
#define fibril_fork_nrt(fp, fn, ag) do { \ #define fibril_fork_nrt(fp, fn, ag) do { \
auto _fibril_##fn##_fork = [](_fibril_defs ag fibril_t * f) __attribute__((noinline, hot, optimize(3))) { \ auto _fibril_##fn##_fork = [](_fibril_defs ag fibril_t * f) __attribute__((noinline, hot, optimize(3))) { \
(*f)->cont.ip = __builtin_return_address(0); \ (*f)->cont.ip = __builtin_return_address(0); \
_fibril_inc_count(f); \
Runtime* runtime = Runtime::getRuntime(); \ Runtime* runtime = Runtime::getRuntime(); \
runtime->pushBottom(**f); \ runtime->pushBottom(**f); \
fn(_fibril_args ag); \ fn(_fibril_args ag); \
...@@ -94,6 +67,7 @@ public: ...@@ -94,6 +67,7 @@ public:
#define fibril_fork_wrt(fp, rt, fn, ag) do { \ #define fibril_fork_wrt(fp, rt, fn, ag) do { \
auto _fibril_##fn##_fork = [](_fibril_defs ag fibril_t * f, __typeof__(rt) p) __attribute__((noinline, hot, optimize(3))) { \ auto _fibril_##fn##_fork = [](_fibril_defs ag fibril_t * f, __typeof__(rt) p) __attribute__((noinline, hot, optimize(3))) { \
(*f)->cont.ip = __builtin_return_address(0); \ (*f)->cont.ip = __builtin_return_address(0); \
_fibril_inc_count(f); \
Runtime* runtime = Runtime::getRuntime(); \ Runtime* runtime = Runtime::getRuntime(); \
runtime->pushBottom(**f); \ runtime->pushBottom(**f); \
*p = fn(_fibril_args ag); \ *p = fn(_fibril_args ag); \
...@@ -104,7 +78,6 @@ public: ...@@ -104,7 +78,6 @@ public:
membar(_fibril_##fn##_fork(_fibril_expand ag fp, rt)); \ membar(_fibril_##fn##_fork(_fibril_expand ag fp, rt)); \
} while (0); } while (0);
#endif
#define fibril_rt_init(n) Runtime runtime; runtime.executeAndWait([&] () { #define fibril_rt_init(n) Runtime runtime; runtime.executeAndWait([&] () {
//#define fibril_rt_init(n) Runtime runtime(2); runtime.executeAndWait([&] () { //#define fibril_rt_init(n) Runtime runtime(2); runtime.executeAndWait([&] () {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment