OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExecutorDeviceType.h File Reference
#include <ostream>
+ Include dependency graph for ExecutorDeviceType.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  ExecutorDeviceType { ExecutorDeviceType::CPU, ExecutorDeviceType::GPU }
 

Functions

std::ostream & operator<< (std::ostream &os, const ExecutorDeviceType device_type)
 
std::string toString (const ExecutorDeviceType device_type)
 

Enumeration Type Documentation

enum ExecutorDeviceType
strong
Enumerator
CPU 
GPU 

Definition at line 23 of file ExecutorDeviceType.h.

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const ExecutorDeviceType  device_type 
)

Definition at line 21 of file ExecutorDeviceType.cpp.

References CHECK_LT.

21  {
22  constexpr size_t array_size{2};
23  constexpr char const* strings[array_size]{"CPU", "GPU"};
24  auto index = static_cast<size_t>(device_type);
25  CHECK_LT(index, array_size);
26  return os << strings[index];
27 }
#define CHECK_LT(x, y)
Definition: Logger.h:303
std::string toString ( const ExecutorDeviceType  device_type)

Definition at line 29 of file ExecutorDeviceType.cpp.

29  {
30  std::stringstream ss;
31  ss << device_type;
32  return ss.str();
33 }