Xpetra  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Xpetra_DefaultPlatform.cpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Xpetra: A linear algebra interface package
4 //
5 // Copyright 2012 NTESS and the Xpetra contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #include "Xpetra_ConfigDefs.hpp"
12 
13 Teuchos::RCP<Xpetra::DefaultPlatform::DefaultPlatformType> Xpetra::DefaultPlatform::platform_ = Teuchos::null;
14 
15 namespace Xpetra {
16 
18  XPETRA_MONITOR("DefaultPlatform::getDefaultPlatform");
19 
20  if (!platform_.get()) {
21  using node_type = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType;
22  Teuchos::RCP<node_type> node; // null
23 #ifdef HAVE_MPI
24  platform_ = Teuchos::rcp(new MpiPlatform<node_type>(node));
25 #else
26  platform_ = Teuchos::rcp(new SerialPlatform<node_type>(node));
27 #endif
28  }
29  return *platform_;
30 }
31 
32 } // namespace Xpetra
A implementation of the Platform class for MPI-based platforms.
A implementation of the Platform class for serial platforms.
static DefaultPlatformType & getDefaultPlatform()
Return the default platform.
#define XPETRA_MONITOR(funcName)
static Teuchos::RCP< DefaultPlatformType > platform_