Skip to content

Commit

Permalink
Merge Pull Request #13459 from etphipp/Trilinos/stokhos_deprecate_pce
Browse files Browse the repository at this point in the history
Automatically Merged using Trilinos Pull Request AutoTester
PR Title: b'Stokhos:  Deprecate the PCE scalar type'
PR Author: etphipp
  • Loading branch information
trilinos-autotester authored Sep 20, 2024
2 parents 850242f + 3f9c2cc commit 84de08d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/stokhos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ TRIBITS_PACKAGE(Stokhos)

TRIBITS_ADD_EXPLICIT_INSTANTIATION_OPTION()

TRIBITS_ADD_SHOW_DEPRECATED_WARNINGS_OPTION()

TRIBITS_ADD_OPTION_AND_DEFINE(${PACKAGE_NAME}_ENABLE_DEBUG
STOKHOS_DEBUG
"Enable debug code in stokhos"
Expand Down Expand Up @@ -48,8 +50,12 @@ IF(HAVE_STOKHOS_ENSEMBLE_GEMV)
ENDIF()

SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default OFF)
SET(Stokhos_ENABLE_PCE_Scalar_Type_Default OFF)
IF(Stokhos_ENABLE_Sacado)
SET(Stokhos_ENABLE_Ensemble_Scalar_Type_Default ON)
IF(NOT Stokhos_HIDE_DEPRECATED_CODE)
SET(Stokhos_ENABLE_PCE_Scalar_Type_Default ON)
ENDIF()
ENDIF()

TRIBITS_ADD_OPTION_AND_DEFINE(Stokhos_ENABLE_Ensemble_Scalar_Type
Expand All @@ -60,7 +66,15 @@ TRIBITS_ADD_OPTION_AND_DEFINE(Stokhos_ENABLE_Ensemble_Scalar_Type
TRIBITS_ADD_OPTION_AND_DEFINE(Stokhos_ENABLE_PCE_Scalar_Type
HAVE_STOKHOS_PCE_SCALAR_TYPE
"Enable use of the PCE UQ scalar type in stokhos"
${Stokhos_ENABLE_Ensemble_Scalar_Type_Default} )
${Stokhos_ENABLE_PCE_Scalar_Type_Default} )

IF(Stokhos_ENABLE_PCE_Scalar_Type)
IF(Stokhos_HIDE_DEPRECATED_CODE)
MESSAGE(FATAL_ERROR "The PCE scalar type is deprecated in Stokhos but Stokhos_HIDE_DEPRECATED_CODE=ON. You must set Stokhos_ENABLE_PCE_Scalar_Type=OFF or Stokhos_HIDE_DEPRECATED_CODE=OFF.")
ELSE()
MESSAGE(WARNING "The PCE scalar type is deprecated in Stokhos but Stokhos_HIDE_DEPRECATED_CODE=OFF.")
ENDIF()
ENDIF()

IF(Stokhos_ENABLE_Ensemble_Scalar_Type AND NOT Stokhos_ENABLE_Sacado)
MESSAGE(FATAL_ERROR "Ensemble scalar type cannot be enabled unless Sacado is enabled!")
Expand Down
4 changes: 4 additions & 0 deletions packages/stokhos/cmake/Stokhos_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,7 @@
#define STOKHOS_GEMV_CACHE_SIZE @Stokhos_Ensemble_GEMV_Cache_Size@
#define STOKHOS_GEMV_TEAM_SIZE @Stokhos_Ensemble_GEMV_Team_Size@
#endif // HAVE_STOKHOS_ENSEMBLE_GEMV

@STOKHOS_DEPRECATED_DECLARATIONS@

#cmakedefine Stokhos_SHOW_DEPRECATED_WARNINGS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@

#include "Stokhos_ConfigDefs.h"

#if defined(Stokhos_SHOW_DEPRECATED_WARNINGS)
#ifdef __GNUC__
#warning "The PCE scalar type is deprecated."
#endif
#endif

#include "Kokkos_Macros.hpp"

#include "Stokhos_Sacado_Kokkos_MathFunctions.hpp"
Expand Down

0 comments on commit 84de08d

Please sign in to comment.