DriverTrac/venv/lib/python3.12/site-packages/onnx/common/platform_helpers.h
2025-11-28 09:08:33 +05:30

20 lines
383 B
C++

// 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