IDS peak IPL  v1.9.2
peak_ipl_library.hpp
Go to the documentation of this file.
1 
11 #pragma once
12 
16 
17 #include <cstddef>
18 #include <cstdint>
19 
23 namespace peak
24 {
25 namespace ipl
26 {
27 
31 struct Version_t
32 {
33  std::uint32_t major;
34  std::uint32_t minor;
35  std::uint32_t subminor;
36 
41  PEAK_IPL_NO_DISCARD std::string ToString() const
42  {
43  return std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(subminor);
44  }
45 };
46 
50 class Library final
51 {
52 public:
53  Library() = delete;
54  ~Library() = delete;
55 
56  Library(const Library&) = delete;
57  Library(Library&&) = delete;
58 
59  Library& operator=(const Library&) = delete;
60  Library& operator=(Library&&) = delete;
61 
71  PEAK_IPL_NO_DISCARD static Version_t Version();
72 
82  PEAK_IPL_NO_DISCARD static size_t MaxConcurrentThreads();
83 
96  static void SetMaxConcurrentThreads(size_t concurrentThreads);
97 
107  PEAK_IPL_NO_DISCARD static bool MultiThreadingEnabled();
108 
118  static void SetMultiThreadingEnabled(bool enabled);
119 
129  PEAK_IPL_NO_DISCARD static bool SIMDEnabled();
130 
142  static void SetSIMDEnabled(bool enabled);
143 };
144 
145 inline Version_t Library::Version()
146 {
147  uint32_t majorVersion{};
148  uint32_t minorVersion{};
149  uint32_t subminorVersion{};
150 
153  });
154 
157  });
158 
161  });
162 
163  return Version_t{majorVersion, minorVersion, subminorVersion};
164 }
165 
166 inline size_t Library::MaxConcurrentThreads()
167 {
168  size_t maxConcurrentThreads = 0;
169 
172  &maxConcurrentThreads);
173  });
174 
175  return maxConcurrentThreads;
176 }
177 
178 inline void Library::SetMaxConcurrentThreads(size_t concurrentThreads)
179 {
182  });
183 }
184 
185 inline bool Library::MultiThreadingEnabled()
186 {
187  PEAK_IPL_BOOL8 multiThreadingEnabled{};
188 
191  });
192 
193  return multiThreadingEnabled != 0;
194 }
195 
196 inline void Library::SetMultiThreadingEnabled(bool enabled)
197 {
200  });
201 }
202 
203 inline bool Library::SIMDEnabled()
204 {
205  PEAK_IPL_BOOL8 simdEnabled{};
206 
209  });
210 
211  return simdEnabled != 0;
212 }
213 
214 inline void Library::SetSIMDEnabled(bool enabled)
215 {
218  });
219 }
220 
221 } /* namespace ipl */
222 } /* namespace peak */
#define PEAK_IPL_NO_DISCARD
Definition: peak_ipl_backend.h:26
static void SetMaxConcurrentThreads(size_t concurrentThreads)
Sets the maximum number of concurrent threads used by the library.
Definition: peak_ipl_library.hpp:178
#define PEAK_IPL_C_ABI_PREFIX
Definition: peak_ipl_dll_defines.h:16
PEAK_IPL_C_API PEAK_IPL_Library_GetMultiThreadingEnabled(PEAK_IPL_BOOL8 *enabled)
Disables/Enables multithreading in the library.
PEAK_IPL_C_API PEAK_IPL_Library_GetVersionMinor(uint32_t *libraryVersionMinor)
Queries the library minor version.
The "peak::ipl" namespace contains the whole image processing library.
Definition: peak_ipl_binning.hpp:22
PEAK_IPL_C_API PEAK_IPL_Library_SetMaxConcurrentThreads(size_t concurrentThreads)
Sets the maximum number of concurrent threads used by the library.
void ExecuteAndMapReturnCodes(const CallableType &callableObject)
Definition: peak_ipl_exception.hpp:182
Definition: peak_ipl_library.hpp:31
static void SetMultiThreadingEnabled(bool enabled)
Disables/Enables multithreading in the library.
Definition: peak_ipl_library.hpp:196
PEAK_IPL_C_API PEAK_IPL_Library_SetSIMDEnabled(PEAK_IPL_BOOL8 enabled)
Disables/Enables SIMD in the library.
std::uint32_t subminor
Minor.
Definition: peak_ipl_library.hpp:35
PEAK_IPL_C_API PEAK_IPL_Library_GetMaxConcurrentThreads(size_t *concurrentThreads)
Queries the maximum number of concurrent threads used by the library.
std::uint32_t minor
Major.
Definition: peak_ipl_library.hpp:34
int8_t PEAK_IPL_BOOL8
Definition: peak_ipl_backend.h:41
PEAK_IPL_C_API PEAK_IPL_Library_GetSIMDEnabled(PEAK_IPL_BOOL8 *enabled)
Disables/Enables SIMD in the library.
PEAK_IPL_C_API PEAK_IPL_Library_SetMultiThreadingEnabled(PEAK_IPL_BOOL8 enabled)
Disables/Enables multithreading in the library.
std::uint32_t major
Definition: peak_ipl_library.hpp:33
PEAK_IPL_C_API PEAK_IPL_Library_GetVersionMajor(uint32_t *libraryVersionMajor)
Queries the library major version.
Library related functions.
Definition: peak_ipl_library.hpp:50
PEAK_IPL_C_API PEAK_IPL_Library_GetVersionSubminor(uint32_t *libraryVersionSubminor)
Queries the library subminor version.
static void SetSIMDEnabled(bool enabled)
Disables/Enables SIMD in the library.
Definition: peak_ipl_library.hpp:214