| 28 | namespace { |
| 29 | template <typename T> |
| 30 | inline void CopyToBuffer(const T& value, uint8* output) { |
| 31 | // Memcpy to string is endian-dependent. We choose little-endian as |
| 32 | // standard. On big-endian machines, bytes should be reversed. |
| 33 | #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
| 34 | static_assert(port::kLittleEndian, ""); |
| 35 | std::memcpy(output, &value, sizeof(value)); |
| 36 | #else |
| 37 | static_assert(!port::kLittleEndian, ""); |
| 38 | std::reverse_copy(reinterpret_cast<const uint8*>(&value), |
| 39 | reinterpret_cast<const uint8*>(&value + 1), output); |
| 40 | #endif |
| 41 | } |
| 42 | |
| 43 | void FarmhashFingerprint64(TTypes<uint8, 2>::ConstTensor input, |
| 44 | TTypes<uint8, 2>::Matrix output) { |
no outgoing calls
no test coverage detected