Skip to content

Commit

Permalink
Merge pull request #5131 from trilinos/Fix-4951
Browse files Browse the repository at this point in the history
Tpetra: Fix #4951 (remove normImpl ETI)
  • Loading branch information
prwolfe authored May 8, 2019
2 parents 7b60bc6 + 906d25e commit 37a1f89
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 227 deletions.
43 changes: 24 additions & 19 deletions packages/stokhos/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -800,21 +800,23 @@ IF (Stokhos_ENABLE_Sacado)
TripleMatrixMultiply
)
SET(TPETRA_SD_ETI_CLASSES
Details::normImpl
)
IF(Stokhos_ENABLE_Ensemble_Scalar_Type)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/sacado/kokkos/vector/tpetra)
APPEND_GLOB(TPETRA_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/sacado/kokkos/vector/tpetra/*.hpp)
IF(TpetraCore_ENABLE_EXPLICIT_INSTANTIATION)
PROCESS_ENSEMBLE_ETI(
"${Stokhos_ETI_Ensemble_Sizes}"
"${TPETRA_SD_ETI_CLASSES}"
"sacado/kokkos/vector/tpetra"
"Tpetra_SD"
TRUE
"${STOKHOS_DEPLIBS}"
DEPLIBS_OUT)
LIST(APPEND STOKHOS_TPETRA_DEPLIBS ${DEPLIBS_OUT})
IF (NOT ("${TPETRA_SD_ETI_CLASSES}" STREQUAL ""))
PROCESS_ENSEMBLE_ETI(
"${Stokhos_ETI_Ensemble_Sizes}"
"${TPETRA_SD_ETI_CLASSES}"
"sacado/kokkos/vector/tpetra"
"Tpetra_SD"
TRUE
"${STOKHOS_DEPLIBS}"
DEPLIBS_OUT)
LIST(APPEND STOKHOS_TPETRA_DEPLIBS ${DEPLIBS_OUT})
ENDIF()

# Tpetra depends on Tpetra_SD
SET(STOKHOS_TPETRA_DEPS ${STOKHOS_DEPLIBS} ${STOKHOS_TPETRA_DEPLIBS})
PROCESS_ENSEMBLE_ETI(
Expand Down Expand Up @@ -848,15 +850,18 @@ IF (Stokhos_ENABLE_Sacado)
SET(EXTRA_TPETRA_ETI_CLASSES
CrsMatrix
)
PROCESS_PCE_ETI(
"${TPETRA_SD_ETI_CLASSES}"
""
"sacado/kokkos/pce/tpetra"
"Tpetra_SD"
TRUE
"${STOKHOS_DEPLIBS}"
DEPLIBS_OUT)
LIST(APPEND STOKHOS_TPETRA_DEPLIBS ${DEPLIBS_OUT})
IF (NOT ("${TPETRA_SD_ETI_CLASSES}" STREQUAL ""))
PROCESS_PCE_ETI(
"${TPETRA_SD_ETI_CLASSES}"
""
"sacado/kokkos/pce/tpetra"
"Tpetra_SD"
TRUE
"${STOKHOS_DEPLIBS}"
DEPLIBS_OUT)
LIST(APPEND STOKHOS_TPETRA_DEPLIBS ${DEPLIBS_OUT})
ENDIF()

# Tpetra depends on Tpetra_SD
SET(STOKHOS_TPETRA_DEPS ${STOKHOS_DEPLIBS} ${STOKHOS_TPETRA_DEPLIBS})
PROCESS_PCE_ETI(
Expand Down
2 changes: 1 addition & 1 deletion packages/tpetra/core/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -414,5 +414,5 @@ SET_PROPERTY(
# / from this directory, or to / from the 'impl' subdirectory. That ensures
# that running "make" will also rerun CMake in order to regenerate Makefiles.
#
# Here is another such change. Verily, I make yet another change.
# Here is another such change. Verily, I make yet another change. Another!
#
91 changes: 0 additions & 91 deletions packages/tpetra/core/src/Tpetra_Details_normImpl.cpp

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,69 @@
// ************************************************************************
// @HEADER

#ifndef TPETRA_DETAILS_NORMIMPL_DEF_HPP
#define TPETRA_DETAILS_NORMIMPL_DEF_HPP
#ifndef TPETRA_DETAILS_NORMIMPL_HPP
#define TPETRA_DETAILS_NORMIMPL_HPP

/// \file Tpetra_Details_normImpl_def.hpp
/// \brief Definition of the Tpetra::Details::normImpl function
/// \file Tpetra_Details_normImpl.hpp
/// \brief Declaration and definition of Tpetra::Details::normImpl,
/// which is an implementation detail of Tpetra::MultiVector.
///
/// \warning This file is an implementation detail of Tpetra. Do not
/// include this header file directly in your code. Do not depend
/// on the contents of this file; they may change or disappear at
/// any time.

#include "Tpetra_Details_normImpl_decl.hpp" // for the enum
// #include "Tpetra_Details_Behavior.hpp"
// #include "Tpetra_Details_isInterComm.hpp"
// #include "Tpetra_Details_Profiling.hpp"
#include "TpetraCore_config.h"
#include "Kokkos_Core.hpp"
#include "Teuchos_ArrayView.hpp"
#include "Teuchos_CommHelpers.hpp"
#include "KokkosBlas.hpp"
#include "Kokkos_ArithTraits.hpp"

#ifndef DOXYGEN_SHOULD_SKIP_THIS
namespace Teuchos {
template<class T>
class ArrayView; // forward declaration
template<class OrdinalType>
class Comm; // forward declaration
}
#endif // DOXYGEN_SHOULD_SKIP_THIS

////////////////////////////////////////////////////////////
// Declarations start here
////////////////////////////////////////////////////////////

namespace Tpetra {
namespace Details {

//! Input argument for normImpl() (which see).
enum EWhichNorm {
NORM_ONE, //<! Use the one-norm
NORM_TWO, //<! Use the two-norm
NORM_INF //<! Use the infinity-norm
};

//! Implementation of MultiVector norms.
template <class ValueType,
class ArrayLayout,
class DeviceType,
class MagnitudeType>
void
normImpl (MagnitudeType norms[],
const Kokkos::View<const ValueType**, ArrayLayout, DeviceType>& X,
const EWhichNorm whichNorm,
const Teuchos::ArrayView<const size_t>& whichVecs,
const bool isConstantStride,
const bool isDistributed,
const Teuchos::Comm<int>* comm);

} // namespace Details
} // namespace Tpetra

////////////////////////////////////////////////////////////
// Definitions start here
////////////////////////////////////////////////////////////

namespace Tpetra {
namespace Details {
namespace Impl {
Expand Down Expand Up @@ -277,24 +325,4 @@ normImpl (MagnitudeType norms[],
} // namespace Details
} // namespace Tpetra

#define TPETRA_DETAILS_NORMIMPL_INSTANT( SC, NT ) \
namespace Details { \
template void \
normImpl< \
Kokkos::ArithTraits<SC>::val_type, \
Kokkos::LayoutLeft, \
NT::device_type, \
Kokkos::ArithTraits<SC>::mag_type \
> (Kokkos::ArithTraits<SC>::mag_type[], \
const Kokkos::View< \
const Kokkos::ArithTraits<SC>::val_type**, \
Kokkos::LayoutLeft, \
NT::device_type>&, \
const EWhichNorm, \
const Teuchos::ArrayView<const size_t>&, \
const bool, \
const bool, \
const Teuchos::Comm<int>* ); \
}

#endif // TPETRA_DETAILS_NORMIMPL_DEF_HPP
#endif // TPETRA_DETAILS_NORMIMPL_HPP
87 changes: 0 additions & 87 deletions packages/tpetra/core/src/Tpetra_Details_normImpl_decl.hpp

This file was deleted.

0 comments on commit 37a1f89

Please sign in to comment.