18 #include "glog/logging.h"    19 #include "scanner/engine/rpc.pb.h"    20 #include "scanner/metadata.pb.h"    21 #include "scanner/types.pb.h"    42 using proto::DeviceType;
    43 using proto::ImageEncodingType;
    44 using proto::ImageColorSpace;
    45 using proto::ColumnType;
    46 using proto::LoadWorkEntry;
    48 using proto::MemoryPoolConfig;
    49 using proto::BoundingBox;
    54   DeviceHandle(DeviceType type_, i32 id_) : type(type_), id(id_) {}
    60     return type == other.type && 
id == other.id;
    63   bool operator!=(
const DeviceHandle& other) { 
return !(*
this == other); }
    66     return type < other.type && 
id < other.id;
    70     return !(this->type == DeviceType::GPU && other.type == DeviceType::GPU &&
    71              this->
id != other.id);
    75     return this->type == other.type &&
    76            ((this->type == DeviceType::CPU) ||
    77             (this->type == DeviceType::GPU && this->
id == other.id));
    84 std::ostream& operator<<(std::ostream& os, 
const DeviceHandle& handle);
    86 static const DeviceHandle CPU_DEVICE = {DeviceType::CPU, 0};
   104 bool string_to_image_encoding_type(
const std::string& s,
   105                                    proto::ImageEncodingType& t);
   106 std::string image_encoding_type_to_string(proto::ImageEncodingType d);
   108 #define RESULT_ERROR(result__, str__, ...)          \   110     char errstr__[1024];                            \   111     snprintf(errstr__, 1024, str__, ##__VA_ARGS__); \   112     LOG(ERROR) << errstr__;                         \   113     (result__)->set_success(false);                 \   114     (result__)->set_msg(errstr__);                  \   119 extern i32 NUM_CUDA_STREAMS;       
 
Definition: database.cpp:36