mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-10-05 09:59:12 +00:00
4f9fa08fa1
The `ArrayHandleStreaming` class stems from an old research project experimenting with bringing data from an `ArrayHandle` in parts and overlapping device transfer and execution. It works, but only in very limited contexts. Thus, it is not actually used today. Plus, the feature requires global indexing to be permutated throughout the worklet dispatching classes of VTK-m for no further reason. Because it is not really used, there are other more promising approaches on the horizon, and it makes further scheduling improvements difficult, we are removing this functionality.
78 lines
2.4 KiB
C++
78 lines
2.4 KiB
C++
//============================================================================
|
|
// 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_exec_internal_TaskSingular_h
|
|
#define vtk_m_exec_internal_TaskSingular_h
|
|
|
|
#include <vtkm/internal/Invocation.h>
|
|
|
|
#include <vtkm/exec/TaskBase.h>
|
|
|
|
#include <vtkm/exec/arg/Fetch.h>
|
|
|
|
//Todo: rename this header to TaskSingularDetail.h
|
|
#include <vtkm/exec/internal/WorkletInvokeFunctorDetail.h>
|
|
|
|
namespace vtkm
|
|
{
|
|
namespace exec
|
|
{
|
|
namespace internal
|
|
{
|
|
|
|
// TaskSingular represents an execution pattern for a worklet
|
|
// that is best expressed in terms of single dimension iteration space. Inside
|
|
// this single dimension no order is preferred.
|
|
//
|
|
//
|
|
template <typename WorkletType, typename InvocationType>
|
|
class TaskSingular : public vtkm::exec::TaskBase
|
|
{
|
|
public:
|
|
VTKM_CONT
|
|
TaskSingular(const WorkletType& worklet, const InvocationType& invocation)
|
|
: Worklet(worklet)
|
|
, Invocation(invocation)
|
|
{
|
|
}
|
|
|
|
VTKM_CONT
|
|
void SetErrorMessageBuffer(const vtkm::exec::internal::ErrorMessageBuffer& buffer)
|
|
{
|
|
this->Worklet.SetErrorMessageBuffer(buffer);
|
|
}
|
|
VTKM_SUPPRESS_EXEC_WARNINGS
|
|
template <typename T>
|
|
VTKM_EXEC void operator()(T index) const
|
|
{
|
|
//Todo: rename this function to DoTaskSingular
|
|
detail::DoWorkletInvokeFunctor(
|
|
this->Worklet,
|
|
this->Invocation,
|
|
this->Worklet.GetThreadIndices(index,
|
|
this->Invocation.OutputToInputMap,
|
|
this->Invocation.VisitArray,
|
|
this->Invocation.ThreadToOutputMap,
|
|
this->Invocation.GetInputDomain()));
|
|
}
|
|
|
|
private:
|
|
typename std::remove_const<WorkletType>::type Worklet;
|
|
// This is held by by value so that when we transfer the invocation object
|
|
// over to CUDA it gets properly copied to the device. While we want to
|
|
// hold by reference to reduce the number of copies, it is not possible
|
|
// currently.
|
|
const InvocationType Invocation;
|
|
};
|
|
}
|
|
}
|
|
} // vtkm::exec::internal
|
|
|
|
#endif //vtk_m_exec_internal_TaskSingular_h
|