2020-03-26 23:34:18 +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.
|
|
|
|
//============================================================================
|
|
|
|
#ifndef vtk_m_cont_internal_DeviceAdapterMemoryManagerShared_h
|
|
|
|
#define vtk_m_cont_internal_DeviceAdapterMemoryManagerShared_h
|
|
|
|
|
|
|
|
#include <vtkm/cont/internal/DeviceAdapterMemoryManager.h>
|
|
|
|
|
|
|
|
namespace vtkm
|
|
|
|
{
|
|
|
|
namespace cont
|
|
|
|
{
|
|
|
|
namespace internal
|
|
|
|
{
|
|
|
|
|
|
|
|
/// \brief An implementation of DeviceAdapterMemoryManager for devices that share memory with the
|
|
|
|
/// host.
|
|
|
|
///
|
|
|
|
/// Device adapters that have shared memory with the host can implement their
|
|
|
|
/// `DeviceAdapterMemoryManager` as a simple subclass of this.
|
|
|
|
///
|
|
|
|
class VTKM_CONT_EXPORT DeviceAdapterMemoryManagerShared : public DeviceAdapterMemoryManagerBase
|
|
|
|
{
|
|
|
|
public:
|
2020-04-22 19:58:59 +00:00
|
|
|
VTKM_CONT BufferInfo Allocate(vtkm::BufferSizeType size) const override;
|
2020-03-26 23:34:18 +00:00
|
|
|
|
2023-05-05 16:08:36 +00:00
|
|
|
VTKM_CONT vtkm::cont::internal::BufferInfo CopyHostToDevice(
|
2020-04-22 19:58:59 +00:00
|
|
|
const vtkm::cont::internal::BufferInfo& src) const override;
|
2020-03-26 23:34:18 +00:00
|
|
|
|
2023-05-05 16:08:36 +00:00
|
|
|
VTKM_CONT void CopyHostToDevice(const vtkm::cont::internal::BufferInfo& src,
|
|
|
|
const vtkm::cont::internal::BufferInfo& dest) const override;
|
2020-06-24 23:27:36 +00:00
|
|
|
|
2023-05-05 16:08:36 +00:00
|
|
|
VTKM_CONT vtkm::cont::internal::BufferInfo CopyDeviceToHost(
|
2020-04-22 19:58:59 +00:00
|
|
|
const vtkm::cont::internal::BufferInfo& src) const override;
|
2020-03-26 23:34:18 +00:00
|
|
|
|
2023-05-05 16:08:36 +00:00
|
|
|
VTKM_CONT void CopyDeviceToHost(const vtkm::cont::internal::BufferInfo& src,
|
|
|
|
const vtkm::cont::internal::BufferInfo& dest) const override;
|
2020-06-24 23:27:36 +00:00
|
|
|
|
2023-05-05 16:08:36 +00:00
|
|
|
VTKM_CONT vtkm::cont::internal::BufferInfo CopyDeviceToDevice(
|
2020-04-22 19:58:59 +00:00
|
|
|
const vtkm::cont::internal::BufferInfo& src) const override;
|
2020-06-24 23:27:36 +00:00
|
|
|
|
2023-05-05 16:08:36 +00:00
|
|
|
VTKM_CONT void CopyDeviceToDevice(const vtkm::cont::internal::BufferInfo& src,
|
|
|
|
const vtkm::cont::internal::BufferInfo& dest) const override;
|
2023-03-22 23:14:21 +00:00
|
|
|
|
2023-05-05 16:08:36 +00:00
|
|
|
VTKM_CONT void DeleteRawPointer(void* mem) const override;
|
2020-03-26 23:34:18 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // namespace vtkm::cont::internal
|
|
|
|
|
|
|
|
#endif //vtk_m_cont_internal_DeviceAdapterMemoryManagerShared_h
|