mirror of
https://github.com/ml-explore/mlx.git
synced 2025-07-05 00:31:15 +08:00
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:
parent
11a9fd40f0
commit
ebfd3618b0
@ -3,7 +3,7 @@
|
|||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#ifdef ACCELERATE_NEW_LAPACK
|
#ifdef ACCELERATE_NEW_LAPACK
|
||||||
#include <vecLib/cblas_new.h>
|
#include <Accelerate/Accelerate.h>
|
||||||
#else
|
#else
|
||||||
#include <cblas.h>
|
#include <cblas.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Copyright © 2023-2024 Apple Inc.
|
// Copyright © 2023-2024 Apple Inc.
|
||||||
|
|
||||||
#ifdef ACCELERATE_NEW_LAPACK
|
#ifdef ACCELERATE_NEW_LAPACK
|
||||||
#include <vecLib/cblas_new.h>
|
#include <Accelerate/Accelerate.h>
|
||||||
#else
|
#else
|
||||||
#include <cblas.h>
|
#include <cblas.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
#include "mlx/primitives.h"
|
#include "mlx/primitives.h"
|
||||||
|
|
||||||
#ifdef ACCELERATE_NEW_LAPACK
|
#ifdef ACCELERATE_NEW_LAPACK
|
||||||
#include <vecLib/lapack.h>
|
#include <Accelerate/Accelerate.h>
|
||||||
#else
|
#else
|
||||||
#include <lapack.h>
|
#include <lapack.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -26,7 +26,8 @@ static constexpr const char* default_mtllib_path = METAL_PATH;
|
|||||||
|
|
||||||
auto load_device() {
|
auto load_device() {
|
||||||
auto devices = MTL::CopyAllDevices();
|
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) {
|
if (!device) {
|
||||||
throw std::runtime_error("Failed to load device");
|
throw std::runtime_error("Failed to load device");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user