OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExecutorDeviceType.cpp File Reference
#include "ExecutorDeviceType.h"
#include <sstream>
+ Include dependency graph for ExecutorDeviceType.cpp:

Go to the source code of this file.

Functions

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

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
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 ( 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 }