VTK-m  2.0
RuntimeDeviceConfiguration.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_internal_RuntimeDeviceConfiguration_h
11 #define vtk_m_cont_internal_RuntimeDeviceConfiguration_h
12 
13 #include <vtkm/cont/vtkm_cont_export.h>
14 
17 
18 #include <vector>
19 
20 namespace vtkm
21 {
22 namespace cont
23 {
24 namespace internal
25 {
26 
27 enum class RuntimeDeviceConfigReturnCode
28 {
29  SUCCESS,
30  OUT_OF_BOUNDS,
31  INVALID_FOR_DEVICE,
32  INVALID_VALUE,
33  NOT_APPLIED
34 };
35 
36 class VTKM_CONT_EXPORT RuntimeDeviceConfigurationBase
37 {
38 public:
39  VTKM_CONT virtual ~RuntimeDeviceConfigurationBase() noexcept;
40  VTKM_CONT virtual vtkm::cont::DeviceAdapterId GetDevice() const = 0;
41 
48  VTKM_CONT void Initialize(const RuntimeDeviceConfigurationOptions& configOptions);
49  VTKM_CONT void Initialize(const RuntimeDeviceConfigurationOptions& configOptions,
50  int& argc,
51  char* argv[]);
52 
56  VTKM_CONT virtual RuntimeDeviceConfigReturnCode SetThreads(const vtkm::Id& value);
57  VTKM_CONT virtual RuntimeDeviceConfigReturnCode SetNumaRegions(const vtkm::Id& value);
58  VTKM_CONT virtual RuntimeDeviceConfigReturnCode SetDeviceInstance(const vtkm::Id& value);
59 
62  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetThreads(vtkm::Id& value) const;
63  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetNumaRegions(vtkm::Id& value) const;
64  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetDeviceInstance(vtkm::Id& value) const;
65 
68  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetMaxThreads(vtkm::Id& value) const;
69  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetMaxDevices(vtkm::Id& value) const;
70 
71 protected:
77  VTKM_CONT virtual void ParseExtraArguments(int& argc, char* argv[]);
78 
83  VTKM_CONT virtual void InitializeSubsystem();
84 };
85 
86 template <typename DeviceAdapterTag>
87 class RuntimeDeviceConfiguration;
88 
89 } // namespace vtkm::cont::internal
90 } // namespace vtkm::cont
91 } // namespace vtkm
92 
93 #endif // vtk_m_cont_internal_RuntimeDeviceConfiguration_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
DeviceAdapterTag.h
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::Initialize
VTKM_CONT_EXPORT VTKM_CONT InitializeResult Initialize(int &argc, char *argv[], InitializeOptions opts=InitializeOptions::None)
Initialize the VTKm library, parsing arguments when provided:
RuntimeDeviceConfigurationOptions.h