File tree Expand file tree Collapse file tree 6 files changed +9
-81
lines changed
Expand file tree Collapse file tree 6 files changed +9
-81
lines changed Original file line number Diff line number Diff line change @@ -85,13 +85,12 @@ elseif (MLX_BUILD_METAL)
8585
8686 message (STATUS "Building with SDK for macOS version ${MACOS_VERSION} " )
8787
88- if (${MACOS_VERSION} GREATER_EQUAL 14.2)
89- set (METAL_CPP_PATCH ${CMAKE_CURRENT_SOURCE_DIR} /cmake/metal.14.2.diff)
90- set (METAL_CPP_URL https://developer.apple .com/metal/cpp/files /metal-cpp_macOS14.2_iOS17.2.zip)
88+ set (METAL_CPP_URL https://developer.apple .com/metal/cpp/files /metal-cpp_macOS15_iOS18-beta.zip)
89+ if (${MACOS_VERSION} GREATER_EQUAL 15.0)
90+ set (MLX_METAL_VERSION METAL_3_2)
91+ elseif (${MACOS_VERSION} GREATER_EQUAL 14.2)
9192 set (MLX_METAL_VERSION METAL_3_1)
9293 elseif (${MACOS_VERSION} GREATER_EQUAL 14.0)
93- set (METAL_CPP_PATCH ${CMAKE_CURRENT_SOURCE_DIR} /cmake/metal.14.0.diff)
94- set (METAL_CPP_URL https://developer.apple .com/metal/cpp/files /metal-cpp_macOS14_iOS17-beta.zip)
9594 set (MLX_METAL_VERSION METAL_3_0)
9695 else ()
9796 message (FATAL_ERROR "MLX requires macOS SDK >= 14.0 to be built with MLX_BUILD_METAL=ON" )
@@ -100,7 +99,6 @@ elseif (MLX_BUILD_METAL)
10099 FetchContent_Declare(
101100 metal_cpp
102101 URL ${METAL_CPP_URL}
103- PATCH_COMMAND /usr/bin/patch -N -i ${METAL_CPP_PATCH} || true
104102 )
105103
106104 FetchContent_MakeAvailable(metal_cpp)
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -30,7 +30,9 @@ constexpr int MAX_DISPATCHES_PER_ENCODER = 2;
3030constexpr const char * default_mtllib_path = METAL_PATH;
3131
3232constexpr auto get_metal_version () {
33- #if defined METAL_3_1
33+ #if defined METAL_3_2
34+ return MTL::LanguageVersion3_2;
35+ #elif defined METAL_3_1
3436 return MTL::LanguageVersion3_1;
3537#else
3638 return MTL::LanguageVersion3_0;
Original file line number Diff line number Diff line change 66
77using namespace metal ;
88
9- #if defined METAL_3_1 || (__METAL_VERSION__ >= 310)
9+ #if defined METAL_3_1 || defined METAL_3_2 || (__METAL_VERSION__ >= 310)
1010
1111typedef bfloat bfloat16_t ;
1212
Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ instantiate_metal_math_funcs(
369369 return static_cast <otype>(__metal_simd_xor (static_cast <ctype>(data))); \
370370 }
371371
372- #if defined METAL_3_1 || (__METAL_VERSION__ >= 310)
372+ #if defined METAL_3_1 || defined METAL_3_2 || (__METAL_VERSION__ >= 310)
373373
374374#define bfloat16_to_uint16 (x ) as_type<uint16_t >(x)
375375#define uint16_to_bfloat16 (x ) as_type<bfloat16_t >(x)
You can’t perform that action at this time.
0 commit comments