Architecture.h#

Fully qualified name: carb/Architecture.h

File members: carb/Architecture.h

// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: LicenseRef-NvidiaProprietary
//
// NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
// property and proprietary rights in and to this material, related
// documentation and any modifications thereto. Any use, reproduction,
// disclosure or distribution of this material and related documentation
// without an express license agreement from NVIDIA CORPORATION or
// its affiliates is strictly prohibited.

#pragma once

#define CARB_UNSUPPORTED_ARCHITECTURE() static_assert(false, "Unsupported architecture!")

// Architecture defines
#ifdef DOXYGEN_BUILD
#    define CARB_AARCH64 0
#    define CARB_X86_64 1
#    define CARB_ARCH_NAME
#elif defined(__aarch64__) /*GCC*/ || defined(_M_ARM64) /*MSVC*/
#    define CARB_AARCH64 1
#    define CARB_X86_64 0
#elif defined(__x86_64__) /*GCC*/ || defined(_M_X64) /*MSVC*/
#    define CARB_X86_64 1
#    define CARB_AARCH64 0
#endif

#if CARB_X86_64
#    define CARB_ARCH_NAME "x86_64"
#elif CARB_AARCH64
#    define CARB_ARCH_NAME "aarch64"
#endif

#ifdef DOXYGEN_BUILD
#    define CARB_TEGRA 0
#elif !defined(CARB_TEGRA)
#    if defined(__aarch64__) && defined(__LINARO_RELEASE__)
#        define CARB_TEGRA 1
#    else
#        define CARB_TEGRA 0
#    endif
#endif