fixes for building and running on iOS (#619)

* fixes for building and running on iOS

* per suggestion just use Accelerate
This commit is contained in:
David Koski 2024-02-04 12:29:17 -08:00 committed by GitHub
parent 11a9fd40f0
commit ebfd3618b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 4 deletions

View File

@ -3,7 +3,7 @@
#include <cassert>
#ifdef ACCELERATE_NEW_LAPACK
#include <vecLib/cblas_new.h>
#include <Accelerate/Accelerate.h>
#else
#include <cblas.h>
#endif

View File

@ -1,7 +1,7 @@
// Copyright © 2023-2024 Apple Inc.
#ifdef ACCELERATE_NEW_LAPACK
#include <vecLib/cblas_new.h>
#include <Accelerate/Accelerate.h>
#else
#include <cblas.h>
#endif

View File

@ -5,7 +5,7 @@
#include "mlx/primitives.h"
#ifdef ACCELERATE_NEW_LAPACK
#include <vecLib/lapack.h>
#include <Accelerate/Accelerate.h>
#else
#include <lapack.h>
#endif

View File

@ -26,7 +26,8 @@ static constexpr const char* default_mtllib_path = METAL_PATH;
auto load_device() {
auto devices = MTL::CopyAllDevices();
auto device = static_cast<MTL::Device*>(devices->object(0));
auto device = static_cast<MTL::Device*>(devices->object(0))
?: MTL::CreateSystemDefaultDevice();
if (!device) {
throw std::runtime_error("Failed to load device");
}