mirror of
https://github.com/openai/gpt-oss.git
synced 2025-08-06 00:55:46 +03:00
Initial commit
Co-authored-by: Zhuohan Li <zhuohan@openai.com> Co-authored-by: Maratyszcza <marat@openai.com> Co-authored-by: Volodymyr Kyrylov <vol@wilab.org.ua>
This commit is contained in:
23
CMakeLists.txt
Normal file
23
CMakeLists.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
project(gpt_oss LANGUAGES C CXX)
|
||||
|
||||
# If not defined externally, auto-detect
|
||||
if(NOT DEFINED GPTOSS_BUILD_METAL)
|
||||
if(APPLE AND CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
|
||||
message(STATUS "Apple Silicon detected → enabling GPTOSS_BUILD_METAL")
|
||||
set(GPTOSS_BUILD_METAL ON)
|
||||
else()
|
||||
message(STATUS "Non-Apple Silicon → disabling GPTOSS_BUILD_METAL")
|
||||
set(GPTOSS_BUILD_METAL OFF)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "GPTOSS_BUILD_METAL manually set to: ${GPTOSS_BUILD_METAL}")
|
||||
endif()
|
||||
|
||||
# Now declare it as a cache variable (respects user-provided value)
|
||||
set(GPTOSS_BUILD_METAL "${GPTOSS_BUILD_METAL}" CACHE BOOL "Enable Metal backend")
|
||||
|
||||
if(GPTOSS_BUILD_METAL)
|
||||
enable_language(OBJC)
|
||||
add_subdirectory(gpt_oss/metal)
|
||||
endif()
|
||||
Reference in New Issue
Block a user