From b9b0df5deb792df9a671690874f259bd21f38058 Mon Sep 17 00:00:00 2001 From: jatin Date: Sat, 25 Nov 2023 10:48:45 -0800 Subject: [PATCH] Small fixes and compiler wrangling --- modules/JUCE | 2 +- modules/cmake/WarningFlags.cmake | 3 +++ src/CMakeLists.txt | 2 +- src/jai/SharedJaiContext.h | 2 +- src/pch.h | 4 ++++ .../drive/neural_utils/RNNAccelerated.cpp | 14 ++++++-------- src/processors/drive/neural_utils/RNNAccelerated.h | 2 +- 7 files changed, 17 insertions(+), 12 deletions(-) diff --git a/modules/JUCE b/modules/JUCE index 69795dc8..d054f0d1 160000 --- a/modules/JUCE +++ b/modules/JUCE @@ -1 +1 @@ -Subproject commit 69795dc8e589a9eb5df251b6dd994859bf7b3fab +Subproject commit d054f0d14dcac387aebda44ce5d792b5e7a625b3 diff --git a/modules/cmake/WarningFlags.cmake b/modules/cmake/WarningFlags.cmake index 2bed2b1f..eab2290b 100644 --- a/modules/cmake/WarningFlags.cmake +++ b/modules/cmake/WarningFlags.cmake @@ -40,6 +40,9 @@ if(WIN32) -Wno-cast-function-type -Wno-range-loop-bind-reference -Wno-sign-conversion + -Wno-implicit-int-float-conversion + -Wno-implicit-const-int-float-conversion + -Wno-header-hygiene ) elseif((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")) message(STATUS "Setting MSVC compiler flags") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4d0fbb55..d1f78446 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -167,11 +167,11 @@ if (NOT(${JAI_COMPILER} STREQUAL "JAI_COMPILER-NOTFOUND")) endif() # AVX/SSE files for accelerated neural nets -make_lib_simd_runtime(rnn_accelerated processors/drive/neural_utils/RNNAccelerated.cpp) if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../modules/math_approx") message(STATUS "Using RTNeural with math_approx") add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../modules/math_approx" math_approx) endif() +make_lib_simd_runtime(rnn_accelerated processors/drive/neural_utils/RNNAccelerated.cpp) foreach(target IN ITEMS rnn_accelerated_sse_or_arm rnn_accelerated_avx) target_link_libraries(${target} PRIVATE config_flags juce::juce_recommended_lto_flags warning_flags) target_include_directories(${target} diff --git a/src/jai/SharedJaiContext.h b/src/jai/SharedJaiContext.h index 92e2462e..b22193bb 100644 --- a/src/jai/SharedJaiContext.h +++ b/src/jai/SharedJaiContext.h @@ -11,7 +11,7 @@ struct JaiContextWrapper JaiContextWrapper(); ~JaiContextWrapper(); - operator jai::Context*() { return internal; }; // NOLINT + operator jai::Context*() { return internal; } // NOLINT private: jai::Context* internal = nullptr; diff --git a/src/pch.h b/src/pch.h index 85677e88..e6b37cfc 100644 --- a/src/pch.h +++ b/src/pch.h @@ -22,7 +22,11 @@ JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wzero-as-null-pointer-constant", #include JUCE_END_IGNORE_WARNINGS_GCC_LIKE +JUCE_BEGIN_IGNORE_WARNINGS_GCC_LIKE ("-Wshadow-field-in-constructor") #include +JUCE_END_IGNORE_WARNINGS_GCC_LIKE + + #include #include diff --git a/src/processors/drive/neural_utils/RNNAccelerated.cpp b/src/processors/drive/neural_utils/RNNAccelerated.cpp index cf2a9518..d5270827 100644 --- a/src/processors/drive/neural_utils/RNNAccelerated.cpp +++ b/src/processors/drive/neural_utils/RNNAccelerated.cpp @@ -26,6 +26,9 @@ struct ApproxMathsProvider return math_approx::sigmoid<9> (x); } }; +using RNNMathsProvider = ApproxMathsProvider; +#else +using RNNMathsProvider = RTNEURAL_NAMESPACE::DefaultMathsProvider; #endif #include "model_loaders.h" @@ -34,7 +37,7 @@ struct ApproxMathsProvider #pragma GCC diagnostic pop #endif -#if __AVX__ // Intel/AVX +#if (__MMX__ || __SSE__ || __amd64__) && BYOD_COMPILING_WITH_AVX // INTEL + AVX namespace rnn_avx #else namespace rnn_sse_arm @@ -47,13 +50,8 @@ template struct RNNAccelerated::Internal { using RecurrentLayerTypeComplete = std::conditional_t, - RTNEURAL_NAMESPACE::GRULayerT>; -#else - RTNEURAL_NAMESPACE::LSTMLayerT, - RTNEURAL_NAMESPACE::GRULayerT>; -#endif + RTNEURAL_NAMESPACE::LSTMLayerT, + RTNEURAL_NAMESPACE::GRULayerT>; using DenseLayerType = RTNEURAL_NAMESPACE::DenseT; RTNEURAL_NAMESPACE::ModelT model; }; diff --git a/src/processors/drive/neural_utils/RNNAccelerated.h b/src/processors/drive/neural_utils/RNNAccelerated.h index f623994b..3400fea0 100644 --- a/src/processors/drive/neural_utils/RNNAccelerated.h +++ b/src/processors/drive/neural_utils/RNNAccelerated.h @@ -42,7 +42,7 @@ class RNNAccelerated }; } // namespace rnn_sse_arm -#if __AVX__ // Intel/AVX +#if __MMX__ || __SSE__ || __amd64__ // INTEL namespace rnn_avx { template