mirror of
https://github.com/ml-explore/mlx.git
synced 2025-10-22 11:14:32 +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:
@@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user