VTK-m  2.2
Initialize.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_Initialize_h
11 #define vtk_m_cont_Initialize_h
12 
16 
17 #include <string>
18 #include <type_traits>
19 #include <vector>
20 
21 namespace vtkm
22 {
23 namespace cont
24 {
25 
27 {
33 
37  std::string Usage;
38 };
39 
41 {
44  None = 0x00,
45 
47  RequireDevice = 0x01,
48 
51  DefaultAnyDevice = 0x02,
52 
57  AddHelp = 0x04,
58 
62  ErrorOnBadOption = 0x08,
63 
67  ErrorOnBadArgument = 0x10,
68 
73 };
74 
75 // Allow options to be used as a bitfield
77 {
78  using T = std::underlying_type<InitializeOptions>::type;
79  return static_cast<InitializeOptions>(static_cast<T>(lhs) | static_cast<T>(rhs));
80 }
82 {
83  using T = std::underlying_type<InitializeOptions>::type;
84  return static_cast<InitializeOptions>(static_cast<T>(lhs) & static_cast<T>(rhs));
85 }
86 
106 VTKM_CONT
107 InitializeResult Initialize(int& argc,
108  char* argv[],
111 VTKM_CONT
112 InitializeResult Initialize();
114 }
115 } // end namespace vtkm::cont
116 
117 
118 #endif // vtk_m_cont_Initialize_h
vtkm::cont::InitializeOptions
InitializeOptions
Definition: Initialize.h:40
vtkm::cont::InitializeOptions::AddHelp
@ AddHelp
Add a help argument.
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
vtkm::cont::InitializeResult::Usage
std::string Usage
A usage statement for arguments parsed by VTK-m.
Definition: Initialize.h:37
DeviceAdapterTag.h
vtkm::cont::InitializeOptions::Strict
@ Strict
If supplied, Initialize treats its own arguments as the only ones supported by the application and pr...
ExportMacros.h
vtkm::cont::InitializeResult
Definition: Initialize.h:26
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::cont::InitializeOptions::None
@ None
Placeholder used when no options are enabled.
vtkm::cont::DeviceAdapterId
An object used to specify a device.
Definition: DeviceAdapterTag.h:58
vtkm::cont::InitializeOptions::RequireDevice
@ RequireDevice
Issue an error if the device argument is not specified.
vtkm::cont::InitializeOptions::DefaultAnyDevice
@ DefaultAnyDevice
If no device is specified, treat it as if the user gave --vtkm-device=Any.
vtkm::cont::InitializeOptions::ErrorOnBadArgument
@ ErrorOnBadArgument
If an extra argument is encountered, the program terminates with an error and a usage statement is pr...
vtkm::cont::DeviceAdapterTagUndefined
Tag for a device adapter used to avoid specifying a device.
Definition: DeviceAdapterTag.h:187
vtkm::cont::Initialize
InitializeResult Initialize(int &argc, char *argv[], InitializeOptions opts=InitializeOptions::None)
Initialize the VTKm library, parsing arguments when provided:
vtkm::cont::InitializeOptions::ErrorOnBadOption
@ ErrorOnBadOption
If an unknown option is encountered, the program terminates with an error and a usage statement is pr...
vtkm::cont::operator|
InitializeOptions operator|(const InitializeOptions &lhs, const InitializeOptions &rhs)
Definition: Initialize.h:76
vtkm::cont::operator&
InitializeOptions operator&(const InitializeOptions &lhs, const InitializeOptions &rhs)
Definition: Initialize.h:81
vtkm::cont::InitializeResult::Device
DeviceAdapterId Device
The device passed into --vtkm-device argument.
Definition: Initialize.h:32