Build for macOS 15 (#1208)

* Build for macos 15

* metal32 as well

* comment

---------

Co-authored-by: Awni Hannun <Awni Hannun>
This commit is contained in:
Awni Hannun
2024-06-13 13:31:44 -07:00
committed by GitHub
parent e84ba8056d
commit 31e134be35
6 changed files with 9 additions and 81 deletions

View File

@@ -30,7 +30,9 @@ constexpr int MAX_DISPATCHES_PER_ENCODER = 2;
constexpr const char* default_mtllib_path = METAL_PATH;
constexpr auto get_metal_version() {
#if defined METAL_3_1
#if defined METAL_3_2
return MTL::LanguageVersion3_2;
#elif defined METAL_3_1
return MTL::LanguageVersion3_1;
#else
return MTL::LanguageVersion3_0;

View File

@@ -6,7 +6,7 @@
using namespace metal;
#if defined METAL_3_1 || (__METAL_VERSION__ >= 310)
#if defined METAL_3_1 || defined METAL_3_2 || (__METAL_VERSION__ >= 310)
typedef bfloat bfloat16_t;

View File

@@ -369,7 +369,7 @@ instantiate_metal_math_funcs(
return static_cast<otype>(__metal_simd_xor(static_cast<ctype>(data))); \
}
#if defined METAL_3_1 || (__METAL_VERSION__ >= 310)
#if defined METAL_3_1 || defined METAL_3_2 || (__METAL_VERSION__ >= 310)
#define bfloat16_to_uint16(x) as_type<uint16_t>(x)
#define uint16_to_bfloat16(x) as_type<bfloat16_t>(x)