Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions mlx/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ MLX_API PrintFormatter& get_global_formatter();
/** Return whether current thread is the first one that called this function. */
bool is_main_thread();

MLX_API array host_accessible_array(array a);

/** Print the exception and then abort. */
MLX_API void abort_with_exception(const std::exception& error);

/** Holds information about floating-point types. */
struct MLX_API finfo {
explicit finfo(Dtype dtype);
Expand Down
13 changes: 7 additions & 6 deletions python/src/convert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,13 @@ mx::array cpu_nd_array_to_mlx(
std::move(strides),
flags);
if (storage_size > 0) {
dispatch_all_types(dst_dtype, [&](auto type_tag) {
using DstT = MLX_GET_TYPE(type_tag);
auto src = static_cast<const SrcT*>(nd_array.data());
auto dst = out.data<DstT>();
std::copy(src, src + storage_size, dst);
});
dispatch_all_types(
dst_dtype, [&, storage_size = storage_size](auto type_tag) {
using DstT = MLX_GET_TYPE(type_tag);
auto src = static_cast<const SrcT*>(nd_array.data());
auto dst = out.data<DstT>();
std::copy(src, src + storage_size, dst);
});
}
out.set_status(mx::array::Status::available);
return out;
Expand Down
Loading