Move kraken,scheme,python,cpp fib tests over to koka_bench, add WAVM as a tested compiler backend for the Kraken benchmarks

This commit is contained in:
Nathan Braswell
2022-06-28 00:38:37 -04:00
parent 999d21746e
commit 4663982f1b
18 changed files with 248 additions and 8 deletions

View File

@@ -0,0 +1,22 @@
set(copy_wrapper "../../copy_wrapper.sh")
set(sources python-fib.py python-fib-let.py)
foreach (source IN LISTS sources)
get_filename_component(name "${source}" NAME_WE)
set(out_dir "${CMAKE_CURRENT_BINARY_DIR}/out/bench")
set(out_path "${out_dir}/${name}")
add_custom_command(
OUTPUT ${out_path}
COMMAND ${copy_wrapper} "${CMAKE_CURRENT_SOURCE_DIR}/${source}" ${out_dir} ${name}
DEPENDS ${source}
VERBATIM)
add_custom_target(update-${name} ALL DEPENDS "${out_path}")
add_executable(${name}-exe IMPORTED)
set_target_properties(${name}-exe PROPERTIES IMPORTED_LOCATION "${out_path}")
endforeach ()

View File

@@ -0,0 +1,13 @@
#!/usr/bin/env python3
import sys
def fib(n):
if n == 0:
return 1
elif n == 1:
return 1
else:
r1 = fib(n-1)
r2 = fib(n-2)
return r1 + r2
print(fib(int(sys.argv[1])))

11
koka_bench/python/python-fib.py Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env python3
import sys
def fib(n):
if n == 0:
return 1
elif n == 1:
return 1
else:
return fib(n-1) + fib(n-2)
print(fib(int(sys.argv[1])))