vtk-m/vtkm/cont/internal/VirtualObjectTransfer.h

65 lines
2.4 KiB
C
Raw Normal View History

2017-03-29 14:48:43 +00:00
//============================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//
// Copyright 2017 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
2017-03-29 14:48:43 +00:00
// Copyright 2017 UT-Battelle, LLC.
// Copyright 2017 Los Alamos National Security.
//
// Under the terms of Contract DE-NA0003525 with NTESS,
2017-03-29 14:48:43 +00:00
// the U.S. Government retains certain rights in this software.
//
// Under the terms of Contract DE-AC52-06NA25396 with Los Alamos National
// Laboratory (LANL), the U.S. Government retains certain rights in
// this software.
//============================================================================
#ifndef vtk_m_cont_internal_VirtualObjectTransfer_h
#define vtk_m_cont_internal_VirtualObjectTransfer_h
2017-10-23 13:38:33 +00:00
#include <vtkm/VirtualObjectBase.h>
2017-05-18 14:29:41 +00:00
namespace vtkm
{
namespace cont
{
namespace internal
{
2017-03-29 14:48:43 +00:00
2017-10-23 13:38:33 +00:00
template <typename VirtualDerivedType, typename DeviceAdapter>
2017-03-29 14:48:43 +00:00
struct VirtualObjectTransfer
#ifdef VTKM_DOXYGEN_ONLY
{
2017-10-23 13:38:33 +00:00
/// A VirtualObjectTransfer is constructed with a pointer to the derived type that (eventually)
/// gets transferred to the execution environment of the given DeviceAdapter.
2017-03-29 14:48:43 +00:00
///
2017-10-23 13:38:33 +00:00
VTKM_CONT VirtualObjectTransfer(const VirtualDerivedType* virtualObject);
2017-03-29 14:48:43 +00:00
2017-10-23 13:38:33 +00:00
/// \brief Transfers the virtual object to the execution environment.
///
/// This method transfers the virtual object to the execution environment and returns a pointer
/// to the object that can be used in the execution environment (but not necessarily the control
/// environment). If the \c updateData flag is true, then the data is always copied to the
/// execution environment (such as if the data were updated since the last call to \c
/// PrepareForExecution). If the \c updateData flag is false and the object was already
/// transferred previously, the previously created object is returned.
2017-03-29 14:48:43 +00:00
///
2017-10-23 13:38:33 +00:00
VTKM_CONT const VirtualDerivedType* PrepareForExecution(bool updateData);
2017-03-29 14:48:43 +00:00
2017-10-23 13:38:33 +00:00
/// \brief Frees up any resources in the execution environment.
///
/// Any previously returned virtual object from \c PrepareForExecution becomes invalid.
///
VTKM_CONT void ReleaseResources();
2017-03-29 14:48:43 +00:00
}
#endif
;
}
}
} // vtkm::cont::internal
#endif // vtkm_cont_internal_VirtualObjectTransfer_h