Commit 7193b3a3 authored by Christophe Geuzaine's avatar Christophe Geuzaine

HAVE_SMALL_STACK option for ios/android

parent c368aeac
Pipeline #1653 passed with stage
in 9 minutes and 48 seconds
......@@ -807,7 +807,7 @@ if(ENABLE_BUILD_IOS)
if(NOT CMAKE_TOOLCHAIN_FILE)
message(FATAL_ERROR "Cannot compile GetDP for iOS without a toolchain")
endif(NOT CMAKE_TOOLCHAIN_FILE)
add_definitions(-DBUILD_IOS)
add_definitions(-DBUILD_IOS -DHAVE_SMALL_STACK)
endif(ENABLE_BUILD_IOS)
if(ENABLE_BUILD_ANDROID)
......@@ -818,7 +818,7 @@ if(ENABLE_BUILD_ANDROID)
set(CMAKE_BUILD_TYPE Release)
set(LIBRARY_OUTPUT_PATH_ROOT ${CMAKE_CURRENT_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/libs/)
add_definitions(-DBUILD_ANDROID)
add_definitions(-DBUILD_ANDROID -DHAVE_SMALL_STACK)
add_library(androidGetdp SHARED ${GETDP_SRC})
set_target_properties(androidGetdp PROPERTIES OUTPUT_NAME getdp)
target_link_libraries(androidGetdp ${LINK_LIBRARIES} ${LIBRARY_DEPS})
......
......@@ -51,14 +51,18 @@
// equals 8 by default (tensors), reduced to 2 in multiharmonic case for allowing to go up
// in the number of harmonics... Put back to 8 if you need tensors!
#if !defined(HAVE_MULTIHARMONIC)
#if defined(HAVE_SMALL_STACK)
#define NBR_MAX_HARMONIC 2
#define MAX_STACK_SIZE0 8
#define MAX_STACK_SIZE 40
#else
#define MAX_STACK_SIZE 20
#elif defined(HAVE_MULTIHARMONIC)
#define NBR_MAX_HARMONIC 40
#define MAX_STACK_SIZE0 2
#define MAX_STACK_SIZE 40
#else
#define NBR_MAX_HARMONIC 2
#define MAX_STACK_SIZE0 8
#define MAX_STACK_SIZE 40
#endif
// Hereafter, values used for NL circuit + homog (a bit too much for other cases)
......@@ -1618,7 +1622,11 @@ struct CurrentData {
// FIXME: this should be made dynamic (with std::vector in Element) ; setting a
// static too large can easily lead to stack overflows
#define NBR_MAX_GROUPS_IN_ELEMENT 100 // 600
#if defined(HAVE_SMALL_STACK)
#define NBR_MAX_GROUPS_IN_ELEMENT 30
#else
#define NBR_MAX_GROUPS_IN_ELEMENT 200
#endif
struct IntxList { int Int ; List_T * List ; } ;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment