Viskores  1.0
RuntimeDeviceConfiguration.h
Go to the documentation of this file.
1 //============================================================================
2 // The contents of this file are covered by the Viskores license. See
3 // LICENSE.txt for details.
4 //
5 // By contributing to this file, all contributors agree to the Developer
6 // Certificate of Origin Version 1.1 (DCO 1.1) as stated in DCO.txt.
7 //============================================================================
8 
9 //============================================================================
10 // Copyright (c) Kitware, Inc.
11 // All rights reserved.
12 // See LICENSE.txt for details.
13 //
14 // This software is distributed WITHOUT ANY WARRANTY; without even
15 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
16 // PURPOSE. See the above copyright notice for more information.
17 //============================================================================
18 #ifndef viskores_cont_internal_RuntimeDeviceConfiguration_h
19 #define viskores_cont_internal_RuntimeDeviceConfiguration_h
20 
22 
25 
26 #include <vector>
27 
28 namespace viskores
29 {
30 namespace cont
31 {
32 namespace internal
33 {
34 
35 enum class RuntimeDeviceConfigReturnCode
36 {
37  SUCCESS,
38  OUT_OF_BOUNDS,
39  INVALID_FOR_DEVICE,
40  INVALID_VALUE,
41  NOT_APPLIED
42 };
43 
44 class VISKORES_CONT_EXPORT RuntimeDeviceConfigurationBase
45 {
46 public:
47  VISKORES_CONT virtual ~RuntimeDeviceConfigurationBase() noexcept;
48  VISKORES_CONT virtual viskores::cont::DeviceAdapterId GetDevice() const = 0;
49 
56  VISKORES_CONT void Initialize(const RuntimeDeviceConfigurationOptions& configOptions);
57  VISKORES_CONT void Initialize(const RuntimeDeviceConfigurationOptions& configOptions,
58  int& argc,
59  char* argv[]);
60 
64  VISKORES_CONT virtual RuntimeDeviceConfigReturnCode SetThreads(const viskores::Id& value);
65  VISKORES_CONT virtual RuntimeDeviceConfigReturnCode SetDeviceInstance(const viskores::Id& value);
66 
69  VISKORES_CONT virtual RuntimeDeviceConfigReturnCode GetThreads(viskores::Id& value) const;
70  VISKORES_CONT virtual RuntimeDeviceConfigReturnCode GetDeviceInstance(viskores::Id& value) const;
71 
74  VISKORES_CONT virtual RuntimeDeviceConfigReturnCode GetMaxThreads(viskores::Id& value) const;
75  VISKORES_CONT virtual RuntimeDeviceConfigReturnCode GetMaxDevices(viskores::Id& value) const;
76 
77 protected:
83  VISKORES_CONT virtual void ParseExtraArguments(int& argc, char* argv[]);
84 
89  VISKORES_CONT virtual void InitializeSubsystem();
90 };
91 
92 template <typename DeviceAdapterTag>
93 class RuntimeDeviceConfiguration;
94 
95 } // namespace viskores::cont::internal
96 } // namespace viskores::cont
97 } // namespace viskores
98 
99 #endif // viskores_cont_internal_RuntimeDeviceConfiguration_h
DeviceAdapterTag.h
viskores::Id
viskores::Int64 Id
Base type to use to index arrays.
Definition: Types.h:235
VISKORES_CONT
#define VISKORES_CONT
Definition: ExportMacros.h:65
viskores
Groups connected points that have the same field value.
Definition: Atomic.h:27
viskores::cont::Initialize
InitializeResult Initialize(int &argc, char *argv[], InitializeOptions opts=InitializeOptions::None)
Initialize the Viskores library, parsing arguments when provided:
viskores_cont_export.h
RuntimeDeviceConfigurationOptions.h