Caffe2 - C++ API
A deep learning, cross platform ML framework
byte_order.h
1 #ifndef THP_BYTE_ORDER_H
2 #define THP_BYTE_ORDER_H
3 
4 #include <cstdint>
5 #include <cstddef>
6 #include <THHalf.h>
7 
8 enum THPByteOrder {
9  THP_LITTLE_ENDIAN = 0,
10  THP_BIG_ENDIAN = 1
11 };
12 
13 THPByteOrder THP_nativeByteOrder();
14 
15 void THP_decodeInt16Buffer(int16_t* dst, const uint8_t* src, THPByteOrder order, size_t len);
16 void THP_decodeInt32Buffer(int32_t* dst, const uint8_t* src, THPByteOrder order, size_t len);
17 void THP_decodeInt64Buffer(int64_t* dst, const uint8_t* src, THPByteOrder order, size_t len);
18 void THP_decodeHalfBuffer(THHalf* dst, const uint8_t* src, THPByteOrder order, size_t len);
19 void THP_decodeFloatBuffer(float* dst, const uint8_t* src, THPByteOrder order, size_t len);
20 void THP_decodeDoubleBuffer(double* dst, const uint8_t* src, THPByteOrder order, size_t len);
21 void THP_decodeBoolBuffer(bool* dst, const uint8_t* src, THPByteOrder order, size_t len);
22 
23 void THP_encodeInt16Buffer(uint8_t* dst, const int16_t* src, THPByteOrder order, size_t len);
24 void THP_encodeInt32Buffer(uint8_t* dst, const int32_t* src, THPByteOrder order, size_t len);
25 void THP_encodeInt64Buffer(uint8_t* dst, const int64_t* src, THPByteOrder order, size_t len);
26 void THP_encodeFloatBuffer(uint8_t* dst, const float* src, THPByteOrder order, size_t len);
27 void THP_encodeDoubleBuffer(uint8_t* dst, const double* src, THPByteOrder order, size_t len);
28 
29 #endif