VTK-m  2.2
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 
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 SetDeviceInstance(const vtkm::Id& value);
58 
61  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetThreads(vtkm::Id& value) const;
62  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetDeviceInstance(vtkm::Id& value) const;
63 
66  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetMaxThreads(vtkm::Id& value) const;
67  VTKM_CONT virtual RuntimeDeviceConfigReturnCode GetMaxDevices(vtkm::Id& value) const;
68 
69 protected:
75  VTKM_CONT virtual void ParseExtraArguments(int& argc, char* argv[]);
76 
81  VTKM_CONT virtual void InitializeSubsystem();
82 };
83 
84 template <typename DeviceAdapterTag>
85 class RuntimeDeviceConfiguration;
86 
87 } // namespace vtkm::cont::internal
88 } // namespace vtkm::cont
89 } // namespace vtkm
90 
91 #endif // vtk_m_cont_internal_RuntimeDeviceConfiguration_h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
DeviceAdapterTag.h
VTKM_CONT_EXPORT
#define VTKM_CONT_EXPORT
Definition: vtkm_cont_export.h:44
vtkm_cont_export.h
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::Id
vtkm::Int64 Id
Base type to use to index arrays.
Definition: Types.h:227
vtkm::cont::Initialize
InitializeResult Initialize(int &argc, char *argv[], InitializeOptions opts=InitializeOptions::None)
Initialize the VTKm library, parsing arguments when provided:
RuntimeDeviceConfigurationOptions.h