File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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. */
7373bool 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. */
8176struct MLX_API finfo {
8277 explicit finfo (Dtype dtype);
Original file line number Diff line number Diff 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;
You can’t perform that action at this time.
0 commit comments