Kano001's picture
Upload 2707 files
dc2106c verified
raw
history blame
402 Bytes
// Copyright (c) ONNX Project Contributors
/*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once
#include <cstdint>
namespace ONNX_NAMESPACE {
// Determine if the processor is little endian or not
inline bool is_processor_little_endian() {
constexpr std::int32_t value = 1;
return reinterpret_cast<const std::uint8_t*>(&value)[0] == 1;
}
} // namespace ONNX_NAMESPACE