Skip to content

Commit b410f6c

Browse files
obchainzcbenz
andauthored
Fix build on Apple clang 15 in cpu_nd_array_to_mlx (#3751)
Co-authored-by: Cheng <git@zcbenz.com>
1 parent 2bad04f commit b410f6c

2 files changed

Lines changed: 7 additions & 11 deletions

File tree

mlx/utils.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ MLX_API PrintFormatter& get_global_formatter();
7272
/** Return whether current thread is the first one that called this function. */
7373
bool is_main_thread();
7474

75-
MLX_API array host_accessible_array(array a);
76-
77-
/** Print the exception and then abort. */
78-
MLX_API void abort_with_exception(const std::exception& error);
79-
8075
/** Holds information about floating-point types. */
8176
struct MLX_API finfo {
8277
explicit finfo(Dtype dtype);

python/src/convert.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,13 @@ mx::array cpu_nd_array_to_mlx(
160160
std::move(strides),
161161
flags);
162162
if (storage_size > 0) {
163-
dispatch_all_types(dst_dtype, [&](auto type_tag) {
164-
using DstT = MLX_GET_TYPE(type_tag);
165-
auto src = static_cast<const SrcT*>(nd_array.data());
166-
auto dst = out.data<DstT>();
167-
std::copy(src, src + storage_size, dst);
168-
});
163+
dispatch_all_types(
164+
dst_dtype, [&, storage_size = storage_size](auto type_tag) {
165+
using DstT = MLX_GET_TYPE(type_tag);
166+
auto src = static_cast<const SrcT*>(nd_array.data());
167+
auto dst = out.data<DstT>();
168+
std::copy(src, src + storage_size, dst);
169+
});
169170
}
170171
out.set_status(mx::array::Status::available);
171172
return out;

0 commit comments

Comments
 (0)