Get metal version from xcode (#1228)

* get metal version from xcode

* typo

* fix
This commit is contained in:
Awni Hannun
2024-06-26 07:02:11 -07:00
committed by GitHub
parent 4eef1e8a3e
commit 56c8a33439
6 changed files with 15 additions and 16 deletions

View File

@@ -30,9 +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_2
#if (MLX_METAL_VERSION >= 320)
return MTL::LanguageVersion3_2;
#elif defined METAL_3_1
#elif (MLX_METAL_VERSION >= 310)
return MTL::LanguageVersion3_1;
#else
return MTL::LanguageVersion3_0;