Skip to content

Commit 12386b2

Browse files
committed
Prepare for CoDiPack v3.
1 parent 876bded commit 12386b2

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/c/cores/controlvalidation_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void simul_stoptrace2(){/*{{{*/
9797

9898
#elif defined(_HAVE_CODIPACK_)
9999

100-
#if _CODIPACK_MAJOR_==2
100+
#if _CODIPACK_MAJOR_>=2
101101
auto& tape_codi = IssmDouble::getTape();
102102
#elif _CODIPACK_MAJOR_==1
103103
auto& tape_codi = IssmDouble::getGlobalTape();

src/c/toolkits/codipack/CoDiPackCommon.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ inline void setVectorPrimal(Real* vec, const Passive* pasVec, int n) {
3434
template<typename Real, typename Data>
3535
inline void getVectorGradData(const Real* vec, Data* dataVec, int n) {
3636
for(int i = 0; i < n; ++i) {
37-
#if _CODIPACK_MAJOR_==2
37+
#if _CODIPACK_MAJOR_>=2
3838
dataVec[i]=vec[i].getIdentifier();
3939
#elif _CODIPACK_MAJOR_==1
4040
dataVec[i]=vec[i].getGradientData();
@@ -48,7 +48,7 @@ template<typename Real, typename Passive, typename Data>
4848
inline void getVectorPrimalAndGradData(const Real* vec, Passive* pasVec, Data* dataVec, int n) {
4949
for(int i = 0; i < n; ++i) {
5050
pasVec[i]=vec[i].getValue();
51-
#if _CODIPACK_MAJOR_==2
51+
#if _CODIPACK_MAJOR_>=2
5252
dataVec[i]=vec[i].getIdentifier();
5353
#elif _CODIPACK_MAJOR_==1
5454
dataVec[i]=vec[i].getGradientData();
@@ -61,7 +61,7 @@ inline void getVectorPrimalAndGradData(const Real* vec, Passive* pasVec, Data* d
6161
template<typename Real, typename Passive, typename Data>
6262
inline void getPrimalAndGradData(const Real& value, Passive& pas, Data& data) {
6363
pas=value.getValue();
64-
#if _CODIPACK_MAJOR_==2
64+
#if _CODIPACK_MAJOR_>=2
6565
data=value.getIdentifier();
6666
#elif _CODIPACK_MAJOR_==1
6767
data=value.getGradientData();
@@ -72,7 +72,7 @@ inline void getPrimalAndGradData(const Real& value, Passive& pas, Data& data) {
7272

7373
template<typename Real, typename Data>
7474
inline void registerVector(Real* vec, Data* dataVec, int n) {
75-
#if _CODIPACK_MAJOR_==2
75+
#if _CODIPACK_MAJOR_>=2
7676
typename Real::Tape& tape = Real::getTape();
7777
#elif _CODIPACK_MAJOR_==1
7878
typename Real::TapeType& tape = Real::getGlobalTape();
@@ -82,7 +82,7 @@ inline void registerVector(Real* vec, Data* dataVec, int n) {
8282

8383
for(int i = 0; i < n; ++i) {
8484
tape.registerInput(vec[i]);
85-
#if _CODIPACK_MAJOR_==2
85+
#if _CODIPACK_MAJOR_>=2
8686
dataVec[i]=vec[i].getIdentifier();
8787
#elif _CODIPACK_MAJOR_==1
8888
dataVec[i]=vec[i].getGradientData();

src/c/toolkits/gsl/DenseGslSolve.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ void SolverxSeq(IssmDouble *X,IssmDouble *A,IssmDouble *B,int n, Parameters* par
253253
#endif
254254

255255
#ifdef _HAVE_CODIPACK_
256-
#if _CODIPACK_MAJOR_==2
256+
#if _CODIPACK_MAJOR_>=2
257257
using Tape = typename IssmDouble::Tape;
258258
using AccessInterface = codi::VectorAccessInterface<typename Tape::Real, typename Tape::Identifier>;
259259
void SolverxSeq_codi_b(Tape* tape,void* data_in, AccessInterface* ra) {/*{{{*/

src/c/toolkits/mpi/issmmpi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
//#include <codi/externals/codiMpiTypes.hpp>
3434
//using MpiTypes = CoDiMpiTypes<IssmDouble>;
3535
/*New implementation*/
36-
#if _CODIPACK_MAJOR_==2
36+
#if _CODIPACK_MAJOR_>=2
3737
#include <codi/tools/mpi/codiMpiTypes.hpp>
3838
using MpiTypes = codi::CoDiMpiTypes<IssmDouble>;
3939

src/c/toolkits/mumps/MumpsSolve.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ int fos_reverse_mumpsSolveEDF(int iArrLength, int* iArr, int m, IssmPDouble *dp_
484484
#endif
485485

486486
#ifdef _HAVE_CODIPACK_
487-
#if _CODIPACK_MAJOR_==2
487+
#if _CODIPACK_MAJOR_>=2
488488
using Tape = typename IssmDouble::Tape;
489489
using AccessInterface = codi::VectorAccessInterface<typename Tape::Real, typename Tape::Identifier>;
490490
void MumpsSolve_codi_b(Tape* tape, void* data_in, AccessInterface* ra) {/*{{{*/

0 commit comments

Comments
 (0)