diff --git a/cmake/TaichiCXXFlags.cmake b/cmake/TaichiCXXFlags.cmake index 7e7725d208577..7971bc3a14178 100644 --- a/cmake/TaichiCXXFlags.cmake +++ b/cmake/TaichiCXXFlags.cmake @@ -59,6 +59,9 @@ if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" OR "${CMAKE_SYSTEM_PROCESSOR}" elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "aarch64" OR "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "arm64") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTI_ARCH_ARM") set(ARCH "arm64") +elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTI_ARCH_x86") + set(ARCH "x86") else() message(FATAL_ERROR "Unknown processor type ${CMAKE_SYSTEM_PROCESSOR}") endif() diff --git a/taichi/common/serialization.h b/taichi/common/serialization.h index f9c4cbfd92afd..11228e71e86bd 100644 --- a/taichi/common/serialization.h +++ b/taichi/common/serialization.h @@ -163,10 +163,11 @@ serialize_kv_impl(SER &ser, (std::is_same::type, \ T>()) +#if !defined(TI_ARCH_x86) static_assert( sizeof(std::size_t) == sizeof(uint64_t), "sizeof(std::size_t) should be 8. Try compiling with 64bit mode."); - +#endif template struct IO { using implemented = std::false_type;