Skip to content

Commit e91141f

Browse files
alexmalyshevmeta-codesync[bot]
authored andcommitted
Add Arch enum class and kBuildArch constexpr to detection.h
Summary: Expose the build target architecture as a typed enum and compile-time constant so codegen code can query it without preprocessor guards. Reviewed By: yoney Differential Revision: D99491341 fbshipit-source-id: ead21b6a575b8e5bf1255d9ddd5963c45594cb10
1 parent 761445c commit e91141f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

cinderx/Jit/codegen/arch/detection.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,33 @@
22

33
#pragma once
44

5+
namespace jit::codegen::arch {
6+
7+
// The CPU architecture targeted by the current build.
8+
enum class Arch {
9+
kX86_64,
10+
kAarch64,
11+
kUnknown,
12+
};
13+
514
// This macro is a marker for places that need platform-specific code.
615
#define CINDER_UNSUPPORTED
716

817
#if defined(__x86_64__)
918

1019
#define CINDER_X86_64
20+
constexpr Arch kBuildArch = Arch::kX86_64;
1121

1222
#elif defined(__aarch64__)
1323

1424
#define CINDER_AARCH64
25+
constexpr Arch kBuildArch = Arch::kAarch64;
1526

1627
#else
1728

1829
#define CINDER_UNKNOWN
30+
constexpr Arch kBuildArch = Arch::kUnknown;
1931

2032
#endif
33+
34+
} // namespace jit::codegen::arch

0 commit comments

Comments
 (0)