Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Kokkos_BufferMacros.hpp
00001 #ifndef KOKKOS_BUFFER_MACROS
00002 #define KOKKOS_BUFFER_MACROS
00003 
00004 #include <Teuchos_TestForException.hpp>
00005 #include <Teuchos_TypeNameTraits.hpp>
00006 #include <string>
00007 #include <stdexcept>
00008 
00009 #ifdef HAVE_KOKKOS_DEBUG
00010 #define MARK_COMPUTE_BUFFER(buff) \
00011   { \
00012     std::string ptrtype("compute"); \
00013     Teuchos::set_extra_data(ptrtype, "BufferType", Teuchos::inOutArg(buff)); \
00014   }
00015 #define CHECK_COMPUTE_BUFFER(buff) \
00016   { \
00017     TEST_FOR_EXCEPTION( Teuchos::get_extra_data<std::string>(buff, "BufferType") != "compute", std::logic_error, \
00018         Teuchos::typeName(*this) << ": argument buffer is not a compute buffer as expected." ); \
00019   }
00020 #else
00021 #define MARK_COMPUTE_BUFFER(buff)
00022 #define CHECK_COMPUTE_BUFFER(buff)
00023 #endif
00024 
00025 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends