Skip to content

Commit

Permalink
Support compiling taichi in x86
Browse files Browse the repository at this point in the history
  • Loading branch information
AmesingFlank committed Jan 25, 2022
1 parent 92408e9 commit 13658d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cmake/TaichiCXXFlags.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
3 changes: 2 additions & 1 deletion taichi/common/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,11 @@ serialize_kv_impl(SER &ser,
(std::is_same<typename std::remove_reference<decltype(serializer)>::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 <typename T, typename S>
struct IO {
using implemented = std::false_type;
Expand Down

0 comments on commit 13658d1

Please sign in to comment.