From 2ad04ce5e88cc59ff5618cb794a984b2680dcf78 Mon Sep 17 00:00:00 2001 From: Florian Fritz Date: Thu, 20 Jun 2019 22:55:52 +0800 Subject: [PATCH] Add minor changes for ARM platform. --- app/benchmark_fft/main.cpp | 2 +- lib/pls/include/pls/internal/base/system_details.h | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/app/benchmark_fft/main.cpp b/app/benchmark_fft/main.cpp index aa21658..6b41c52 100644 --- a/app/benchmark_fft/main.cpp +++ b/app/benchmark_fft/main.cpp @@ -80,7 +80,7 @@ int main() { pls::internal::helpers::run_mini_benchmark([&] { complex_vector input = initial_input; fft(input.begin(), input.size()); - }, 8, 1000); + }, 7, 30000); PROFILE_SAVE("test_profile.prof") } diff --git a/lib/pls/include/pls/internal/base/system_details.h b/lib/pls/include/pls/internal/base/system_details.h index 17b51d7..01543c0 100644 --- a/lib/pls/include/pls/internal/base/system_details.h +++ b/lib/pls/include/pls/internal/base/system_details.h @@ -2,10 +2,19 @@ #ifndef PLS_SYSTEM_DETAILS_H #define PLS_SYSTEM_DETAILS_H -#include -#if (COMPILER == MVCC) -#include +#if MSVC +#ifdef _M_X86 +#define ARCH_X86 +#endif +#endif + +#if GCC +#ifdef __i386__ +#define ARCH_X86 #endif +#endif + +#include namespace pls { namespace internal { @@ -53,7 +62,9 @@ constexpr pointer_t CACHE_LINE_SIZE = 64; * Choose the implementation appropriate for your compiler-cpu combination. */ inline void relax_cpu() { +#ifdef ARCH_X86 asm volatile("pause":: : "memory"); +#endif } } -- libgit2 0.26.0