From 215b16884dd2a0de0ae4b39447b8d5c8e86ad189 Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Sun, 22 Jul 2018 21:33:30 +0200 Subject: [PATCH] disable temporary unsupported features on aarch64 (#96) * remove OpenMP Runtime, move runtime to an own package * remove uneeded dependencies to rdtsc, disable rdtsc based benchmarks on aarch64 * disable temporary go and xray applications on aarch64 --- CMakeLists.txt | 2 ++ usr/benchmarks/CMakeLists.txt | 2 ++ usr/benchmarks/stream.c | 26 -------------------------- usr/tests/CMakeLists.txt | 4 ++++ usr/tests/jacobi.c | 25 +------------------------ 5 files changed, 9 insertions(+), 50 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7c28f8d4..7ff8bb9d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,7 +173,9 @@ endif() ## Tests and benchmarks build_external(tests ${HERMIT_ROOT}/usr/tests hermit) build_external(benchmarks ${HERMIT_ROOT}/usr/benchmarks hermit) +if("${TARGET_ARCH}" STREQUAL "x86_64-hermit") build_external(openmpbench ${HERMIT_ROOT}/usr/openmpbench hermit) +endif() ## relocate the local prefix to our install destination install(DIRECTORY ${LOCAL_PREFIX_DIR}/ diff --git a/usr/benchmarks/CMakeLists.txt b/usr/benchmarks/CMakeLists.txt index 9aae06bcb..3fb9f35d1 100644 --- a/usr/benchmarks/CMakeLists.txt +++ b/usr/benchmarks/CMakeLists.txt @@ -3,6 +3,7 @@ include(../../cmake/HermitCore-Application.cmake) project(hermit_benchmarks C) +if("${TARGET_ARCH}" STREQUAL "x86_64-hermit") add_executable(basic basic.c) target_link_libraries(basic pthread) @@ -12,6 +13,7 @@ add_executable(netio netio.c) add_executable(RCCE_pingpong RCCE_pingpong.c) target_link_libraries(RCCE_pingpong ircce) +endif() add_executable(stream stream.c) target_compile_options(stream PRIVATE -fopenmp) diff --git a/usr/benchmarks/stream.c b/usr/benchmarks/stream.c index acfaf6460..cdc6c8cc7 100644 --- a/usr/benchmarks/stream.c +++ b/usr/benchmarks/stream.c @@ -416,40 +416,14 @@ checktick() #include #include -#ifdef __hermit__ -extern unsigned int get_cpufreq(); -static unsigned long long start_tsc; - -inline static unsigned long long rdtsc(void) -{ - unsigned long lo, hi; - asm volatile ("rdtsc" : "=a"(lo), "=d"(hi) :: "memory"); - return ((unsigned long long) hi << 32ULL | (unsigned long long) lo); -} - -__attribute__((constructor)) static void timer_init() -{ - start_tsc = rdtsc(); -} -#endif - double mysecond() { -#ifndef __hermit__ struct timeval tp; struct timezone tzp; int i; i = gettimeofday(&tp,&tzp); return ( (double) tp.tv_sec + (double) tp.tv_usec * 1.e-6 ); -#else - double ret; - - ret = ((double) (rdtsc() - start_tsc)) / ((double) get_cpufreq() * 1000000.0); - //printf("CPU frequency: %d MHz\n", get_cpufreq()); - - return ret; -#endif } #ifndef abs diff --git a/usr/tests/CMakeLists.txt b/usr/tests/CMakeLists.txt index a447b03bf..730c461b6 100644 --- a/usr/tests/CMakeLists.txt +++ b/usr/tests/CMakeLists.txt @@ -9,7 +9,9 @@ add_executable(jacobi jacobi.c) add_executable(argv_envp argv_envp.c) add_executable(hello++ hello++.cpp) add_executable(hellof hellof.f90) +if("${TARGET_ARCH}" STREQUAL "x86_64-hermit") add_executable(pi pi.go) +endif() add_executable(allocator allocator.c) add_executable(endless endless.c) @@ -21,11 +23,13 @@ add_executable(test-malloc-mt test-malloc-mt.c) target_compile_options(test-malloc-mt PRIVATE -pthread) target_link_libraries(test-malloc-mt pthread) +if("${TARGET_ARCH}" STREQUAL "x86_64-hermit") add_executable(server server.go) target_link_libraries(server netgo) add_executable(RCCE_minimum RCCE_minimum.c) target_link_libraries(RCCE_minimum ircce) +endif() add_executable(thr_hello thr_hello.c) target_compile_options(thr_hello PRIVATE -pthread) diff --git a/usr/tests/jacobi.c b/usr/tests/jacobi.c index 64fc55558..a4d123d4d 100644 --- a/usr/tests/jacobi.c +++ b/usr/tests/jacobi.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -39,38 +40,14 @@ #define CACHE_SIZE (256*1024) #define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) -extern unsigned int get_cpufreq(); -static unsigned long long start_tsc; - -inline static unsigned long long rdtsc(void) -{ - unsigned long lo, hi; - asm volatile ("rdtsc" : "=a"(lo), "=d"(hi) :: "memory"); - return ((unsigned long long) hi << 32ULL | (unsigned long long) lo); -} - -__attribute__((constructor)) static void timer_init() -{ - start_tsc = rdtsc(); -} - double mysecond() { -#if 0 struct timeval tp; struct timezone tzp; int i; i = gettimeofday(&tp,&tzp); return ( (double) tp.tv_sec + (double) tp.tv_usec * 1.e-6 ); -#else - double ret; - - ret = (double) (rdtsc() - start_tsc) / ((double) get_cpufreq() * 1000000.0); - //printf("CPU frequency: %d MHz\n", get_cpufreq()); - - return ret; -#endif }