mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-16 17:22:55 +00:00
Refactor ExecutionArrayInterfaceBasic to use inheriting constructors
This commit is contained in:
parent
51e6f07550
commit
86b9ab9969
@ -29,12 +29,6 @@ namespace cont
|
||||
namespace internal
|
||||
{
|
||||
|
||||
ExecutionArrayInterfaceBasic<DeviceAdapterTagCuda>::ExecutionArrayInterfaceBasic(
|
||||
StorageBasicBase& storage)
|
||||
: Superclass(storage)
|
||||
{
|
||||
}
|
||||
|
||||
DeviceAdapterId ExecutionArrayInterfaceBasic<DeviceAdapterTagCuda>::GetDeviceId() const
|
||||
{
|
||||
return VTKM_DEVICE_ADAPTER_CUDA;
|
||||
|
@ -32,9 +32,9 @@ template <>
|
||||
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagCuda> final
|
||||
: public ExecutionArrayInterfaceBasicBase
|
||||
{
|
||||
using Superclass = ExecutionArrayInterfaceBasicBase;
|
||||
//inherit our parents constructor
|
||||
using ExecutionArrayInterfaceBasicBase::ExecutionArrayInterfaceBasicBase;
|
||||
|
||||
VTKM_CONT ExecutionArrayInterfaceBasic(StorageBasicBase& storage);
|
||||
VTKM_CONT DeviceAdapterId GetDeviceId() const final;
|
||||
VTKM_CONT void Allocate(TypelessExecutionArray& execArray,
|
||||
vtkm::Id numberOfValues,
|
||||
|
@ -75,7 +75,7 @@ static PortalConstType CreatePortalConst(const ValueType* start, const ValueType
|
||||
/// Typeless interface for interacting with a execution memory buffer when using basic storage.
|
||||
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasicBase
|
||||
{
|
||||
VTKM_CONT ExecutionArrayInterfaceBasicBase(StorageBasicBase& storage);
|
||||
VTKM_CONT explicit ExecutionArrayInterfaceBasicBase(StorageBasicBase& storage);
|
||||
VTKM_CONT virtual ~ExecutionArrayInterfaceBasicBase();
|
||||
|
||||
VTKM_CONT
|
||||
|
@ -27,12 +27,6 @@ namespace cont
|
||||
namespace internal
|
||||
{
|
||||
|
||||
ExecutionArrayInterfaceBasicShareWithControl::ExecutionArrayInterfaceBasicShareWithControl(
|
||||
vtkm::cont::internal::StorageBasicBase& storage)
|
||||
: Superclass(storage)
|
||||
{
|
||||
}
|
||||
|
||||
void ExecutionArrayInterfaceBasicShareWithControl::Allocate(TypelessExecutionArray& execArray,
|
||||
vtkm::Id numberOfValues,
|
||||
vtkm::UInt64 sizeOfValue) const
|
||||
|
@ -135,9 +135,8 @@ struct ExecutionPortalFactoryBasicShareWithControl
|
||||
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasicShareWithControl
|
||||
: public ExecutionArrayInterfaceBasicBase
|
||||
{
|
||||
using Superclass = ExecutionArrayInterfaceBasicBase;
|
||||
|
||||
VTKM_CONT ExecutionArrayInterfaceBasicShareWithControl(StorageBasicBase& storage);
|
||||
//inherit our parents constructor
|
||||
using ExecutionArrayInterfaceBasicBase::ExecutionArrayInterfaceBasicBase;
|
||||
|
||||
VTKM_CONT void Allocate(TypelessExecutionArray& execArray,
|
||||
vtkm::Id numberOfValues,
|
||||
|
@ -26,16 +26,7 @@ namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
ExecutionArrayInterfaceBasic<DeviceAdapterTagOpenMP>::ExecutionArrayInterfaceBasic(
|
||||
StorageBasicBase& storage)
|
||||
: Superclass(storage)
|
||||
{
|
||||
}
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
VTKM_INSTANTIATE_ARRAYHANDLES_FOR_DEVICE_ADAPTER(DeviceAdapterTagOpenMP)
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <vtkm/cont/internal/ArrayExportMacros.h>
|
||||
#include <vtkm/cont/internal/ArrayManagerExecution.h>
|
||||
#include <vtkm/cont/internal/ArrayManagerExecutionShareWithControl.h>
|
||||
#include <vtkm/cont/openmp/internal/ExecutionArrayInterfaceBasicOpenMP.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
@ -85,19 +86,6 @@ struct ExecutionPortalFactoryBasic<T, DeviceAdapterTagOpenMP>
|
||||
using Superclass::CreatePortalConst;
|
||||
};
|
||||
|
||||
template <>
|
||||
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagOpenMP> final
|
||||
: public ExecutionArrayInterfaceBasicShareWithControl
|
||||
{
|
||||
using Superclass = ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
ExecutionArrayInterfaceBasic(StorageBasicBase& storage);
|
||||
|
||||
VTKM_CONT
|
||||
DeviceAdapterId GetDeviceId() const final { return VTKM_DEVICE_ADAPTER_OPENMP; }
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
||||
#ifndef vtk_m_cont_openmp_internal_ArrayManagerExecutionOpenMP_cxx
|
||||
|
@ -23,6 +23,7 @@ set(headers
|
||||
DeviceAdapterAlgorithmOpenMP.h
|
||||
DeviceAdapterRuntimeDetectorOpenMP.h
|
||||
DeviceAdapterTagOpenMP.h
|
||||
ExecutionArrayInterfaceBasicOpenMP.h
|
||||
FunctorsOpenMP.h
|
||||
ParallelQuickSortOpenMP.h
|
||||
ParallelRadixSortOpenMP.h
|
||||
@ -45,5 +46,6 @@ endif()
|
||||
target_sources(vtkm_cont PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ArrayManagerExecutionOpenMP.cxx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DeviceAdapterAlgorithmOpenMP.cxx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ExecutionArrayInterfaceBasicOpenMP.cxx
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ParallelRadixSortOpenMP.cxx
|
||||
)
|
||||
|
@ -0,0 +1,36 @@
|
||||
//============================================================================
|
||||
// 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 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
||||
// Copyright 2014 UT-Battelle, LLC.
|
||||
// Copyright 2014 Los Alamos National Security.
|
||||
//
|
||||
// Under the terms of Contract DE-NA0003525 with NTESS,
|
||||
// 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.
|
||||
//============================================================================
|
||||
#include <vtkm/cont/openmp/internal/ExecutionArrayInterfaceBasicOpenMP.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
DeviceAdapterId ExecutionArrayInterfaceBasic<DeviceAdapterTagOpenMP>::GetDeviceId() const
|
||||
{
|
||||
return VTKM_DEVICE_ADAPTER_OPENMP;
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
}
|
||||
} // namespace vtkm::cont
|
@ -0,0 +1,48 @@
|
||||
//============================================================================
|
||||
// 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 2014 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
|
||||
// Copyright 2014 UT-Battelle, LLC.
|
||||
// Copyright 2014 Los Alamos National Security.
|
||||
//
|
||||
// Under the terms of Contract DE-NA0003525 with NTESS,
|
||||
// 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_openmp_internal_ExecutionArrayInterfaceBasicOpenMP_h
|
||||
#define vtk_m_cont_openmp_internal_ExecutionArrayInterfaceBasicOpenMP_h
|
||||
|
||||
#include <vtkm/cont/internal/ArrayManagerExecutionShareWithControl.h>
|
||||
#include <vtkm/cont/openmp/internal/DeviceAdapterTagOpenMP.h>
|
||||
|
||||
namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
template <>
|
||||
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagOpenMP> final
|
||||
: public ExecutionArrayInterfaceBasicShareWithControl
|
||||
{
|
||||
//inherit our parents constructor
|
||||
using ExecutionArrayInterfaceBasicShareWithControl::ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
DeviceAdapterId GetDeviceId() const final;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
}
|
||||
} // namespace vtkm::cont
|
||||
|
||||
#endif //vtk_m_cont_serial_internal_ExecutionArrayInterfaceBasicSerial_h
|
@ -26,16 +26,6 @@ namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
ExecutionArrayInterfaceBasic<DeviceAdapterTagSerial>::ExecutionArrayInterfaceBasic(
|
||||
StorageBasicBase& storage)
|
||||
: Superclass(storage)
|
||||
{
|
||||
}
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
VTKM_INSTANTIATE_ARRAYHANDLES_FOR_DEVICE_ADAPTER(DeviceAdapterTagSerial)
|
||||
}
|
||||
|
@ -25,8 +25,7 @@ namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
vtkm::cont::DeviceAdapterId ExecutionArrayInterfaceBasic<DeviceAdapterTagSerial>::GetDeviceId()
|
||||
const
|
||||
DeviceAdapterId ExecutionArrayInterfaceBasic<DeviceAdapterTagSerial>::GetDeviceId() const
|
||||
{
|
||||
return VTKM_DEVICE_ADAPTER_SERIAL;
|
||||
}
|
||||
|
@ -34,10 +34,8 @@ template <>
|
||||
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagSerial> final
|
||||
: public ExecutionArrayInterfaceBasicShareWithControl
|
||||
{
|
||||
using Superclass = ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
ExecutionArrayInterfaceBasic(StorageBasicBase& storage);
|
||||
//inherit our parents constructor
|
||||
using ExecutionArrayInterfaceBasicShareWithControl::ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
DeviceAdapterId GetDeviceId() const final;
|
||||
|
@ -26,16 +26,6 @@ namespace vtkm
|
||||
{
|
||||
namespace cont
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
|
||||
ExecutionArrayInterfaceBasic<DeviceAdapterTagTBB>::ExecutionArrayInterfaceBasic(
|
||||
StorageBasicBase& storage)
|
||||
: Superclass(storage)
|
||||
{
|
||||
}
|
||||
|
||||
} // end namespace internal
|
||||
|
||||
VTKM_INSTANTIATE_ARRAYHANDLES_FOR_DEVICE_ADAPTER(DeviceAdapterTagTBB)
|
||||
}
|
||||
|
@ -37,10 +37,8 @@ template <>
|
||||
struct VTKM_CONT_EXPORT ExecutionArrayInterfaceBasic<DeviceAdapterTagTBB> final
|
||||
: public ExecutionArrayInterfaceBasicShareWithControl
|
||||
{
|
||||
using Superclass = ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
ExecutionArrayInterfaceBasic(StorageBasicBase& storage);
|
||||
//inherit our parents constructor
|
||||
using ExecutionArrayInterfaceBasicShareWithControl::ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
DeviceAdapterId GetDeviceId() const final;
|
||||
|
@ -126,13 +126,8 @@ template <>
|
||||
struct ExecutionArrayInterfaceBasic<DeviceAdapterTagTestAlgorithmGeneral>
|
||||
: public ExecutionArrayInterfaceBasicShareWithControl
|
||||
{
|
||||
using Superclass = ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
ExecutionArrayInterfaceBasic(StorageBasicBase& storage)
|
||||
: Superclass(storage)
|
||||
{
|
||||
}
|
||||
//inherit our parents constructor
|
||||
using ExecutionArrayInterfaceBasicShareWithControl::ExecutionArrayInterfaceBasicShareWithControl;
|
||||
|
||||
VTKM_CONT
|
||||
DeviceAdapterId GetDeviceId() const final { return -3; }
|
||||
|
Loading…
Reference in New Issue
Block a user