Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ling0322 committed Mar 6, 2024
1 parent 0950ef6 commit 32b8e8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ if(UNIX)
set(CMAKE_C_FLAGS "-O3 -g")
endif(UNIX)

if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
message("CMAKE_HOST_SYSTEM_PROCESSOR=" ${CMAKE_HOST_SYSTEM_PROCESSOR})

if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)")
add_compile_definitions(LIBLLM_ARCH_X86_64)
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
set(LIBLLM_KERNEL_X86_64 ON)
endif()
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "(aarch64)|(arm64)")
add_compile_definitions(LIBLLM_ARCH_AARCH64)
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
endif()

add_subdirectory("src/libllm")
4 changes: 2 additions & 2 deletions src/libllm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ if(UNIX AND NOT APPLE)
endif()

# CPU specific code
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
if(LIBLLM_KERNEL_X86_64)
set(libllm_SOURCES
${libllm_SOURCES}
"cpu/kernel/kernel_avx2.cc"
Expand All @@ -163,7 +163,7 @@ if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
"cpu/kernel/kernel_avx2.cc"
PROPERTIES COMPILE_FLAGS "-mavx2 -mfma -mf16c")
endif(UNIX)
endif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
endif()

add_library(lut STATIC ${lut_SOURCES})
set_target_properties(lut PROPERTIES CXX_VISIBILITY_PRESET hidden)
Expand Down

0 comments on commit 32b8e8e

Please sign in to comment.