Skip to content

Commit 3b8e6d6

Browse files
committed
Enable c++17 support in tests and fix saxpy calls
1 parent b2b5c06 commit 3b8e6d6

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

examples/autopoint/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ project( VolEsti )
1212
option(DISABLE_NLP_ORACLES "Disable non-linear oracles (used in collocation)" ON)
1313
option(BUILTIN_EIGEN "Use eigen from ../external" OFF)
1414
option(BUILTIN_AUTODIFF "Use eigen from ../external" OFF)
15-
option(USE_MKL "Use MKL library to build eigen" ON)
15+
option(USE_MKL "Use MKL library to build eigen" OFF)
1616

1717
CMAKE_MINIMUM_REQUIRED(VERSION 3.17)
1818

@@ -141,7 +141,7 @@ endif()
141141
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") # enable C++14 standard
142142
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
143143
add_definitions(${CMAKE_CXX_FLAGS} "-pthread") # optimization of the compiler
144-
144+
145145
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
146146
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
147147
add_definitions(${CMAKE_CXX_FLAGS} "-DMKL_ILP64")

include/preprocess/crhmc/crhmc_utils.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ void set(MatrixType &a, std::vector<IndexType>const & idx, const Type c){
375375
}
376376
}
377377
template<typename MatrixType, typename IndexType>
378-
void saxpy(MatrixType &a,MatrixType const &b,MatrixType const& c, std::vector<IndexType>const & a_idx, std::vector<IndexType>const & b_idx){
378+
void volesti_saxpy(MatrixType &a,MatrixType const &b,MatrixType const& c, std::vector<IndexType>const & a_idx, std::vector<IndexType>const & b_idx){
379379
for(int i=0;i<b_idx.size();i++){
380380
a(a_idx[i])=b(b_idx[i])+c(i);
381381
}

include/preprocess/crhmc/two_sided_barrier.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ template <typename Point> class two_sided_barrier {
7373

7474
VT c = (ub + lb) / 2;
7575
VT bias1=VT::Ones(x2, 1) * unbounded_center_coord;
76-
saxpy(c,lb,bias1,lowerIdx,lowerIdx);
76+
volesti_saxpy(c,lb,bias1,lowerIdx,lowerIdx);
7777
VT bias2=-VT::Ones(x1, 1) * unbounded_center_coord;
78-
saxpy(c,ub,bias2,upperIdx,upperIdx);
78+
volesti_saxpy(c,ub,bias2,upperIdx,upperIdx);
7979
set(c, freeIdx, 0.0);
8080

8181
center = c;

include/preprocess/crhmc/weighted_two_sided_barrier.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,9 @@ template <class Point> class weighted_two_sided_barrier {
143143

144144
VT c = (ub + lb) / 2;
145145
VT bias1=VT::Ones(x2, 1) * unbounded_center_coord;
146-
saxpy(c,lb,bias1,lowerIdx,lowerIdx);
146+
volesti_saxpy(c,lb,bias1,lowerIdx,lowerIdx);
147147
VT bias2=-VT::Ones(x1, 1) * unbounded_center_coord;
148-
saxpy(c,ub,bias2,upperIdx,upperIdx);
148+
volesti_saxpy(c,ub,bias2,upperIdx,upperIdx);
149149
set(c, freeIdx, 0.0);
150150

151151
center = c;

test/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ add_definitions(${CMAKE_CXX_FLAGS} "-g") # enable debuger
191191
#add_definitions(${CMAKE_CXX_FLAGS} "-Wall")
192192

193193
add_definitions(${CMAKE_CXX_FLAGS} "-O3") # optimization of the compiler
194+
add_definitions(${CMAKE_CXX_FLAGS} "-std=c++17") #enable the c++17 support needed by autodiff
194195
#add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lgsl")
195196
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-lm")
196197
add_definitions(${CXX_COVERAGE_COMPILE_FLAGS} "-ldl")

0 commit comments

Comments
 (0)