Skip to main content Crate safemlx_sys Copy item path Source pub use self::mlx_dtype_ as mlx_dtype;pub use self::mlx_device_type_ as mlx_device_type;pub use self::mlx_compile_mode_ as mlx_compile_mode;pub use self::mlx_submission_activity_ as mlx_submission_activity;pub use self::mlx_event_backend_ as mlx_event_backend;pub use self::mlx_host_transfer_policy_ as mlx_host_transfer_policy;pub use self::mlx_host_transfer_storage_kind_ as mlx_host_transfer_storage_kind;pub use self::mlx_fft_norm_ as mlx_fft_norm;__BindgenComplex __BindgenFloat16 mlx_array_ A N-dimensional array object. mlx_closure_ \defgroup mlx_closure Closures
MLX closure objects.
/
/**@{ mlx_closure_custom_ mlx_closure_custom_jvp_ mlx_closure_custom_vmap_ mlx_closure_kwargs_ mlx_closure_value_and_grad_ mlx_device_ A MLX device object. mlx_device_info_ A MLX device info object.
Contains key-value pairs with device properties.
Keys vary by backend but common keys include: mlx_distributed_group_ A MLX distributed group object. mlx_event_ An owning opaque completion event. mlx_fast_cuda_kernel_ mlx_fast_cuda_kernel_config_ \defgroup fast Fast custom operations
/
/**@{ mlx_fast_metal_kernel_ mlx_fast_metal_kernel_config_ mlx_function_exporter_ mlx_host_transfer_buffer_ An owning, host-addressable transfer allocation. mlx_host_transfer_memory_stats_ Process-wide physical allocation telemetry for one storage kind. mlx_imported_function_ mlx_io_reader_ A MLX IO reader object. mlx_io_vtable_ Virtual table for custom IO reader and writer objects. mlx_io_writer_ A MLX IO writer object. mlx_map_string_to_array_ A string-to-array map mlx_map_string_to_array_iterator_ An iterator over a string-to-array map. mlx_map_string_to_string_ A string-to-string map mlx_map_string_to_string_iterator_ An iterator over a string-to-string map. mlx_node_namer_ \defgroup graph_utils Graph Utils
/
/**@{ mlx_optional_dtype_ A dtype optional. mlx_optional_float_ A float optional. mlx_optional_int_ A int optional. mlx_stream_ A MLX stream object. mlx_string_ A MLX string object. mlx_submission_scope_ Owning thread-affine submission recovery scope. mlx_submission_status_ Native lifetime evidence independent of textual errors. mlx_vector_array_ A vector of array. mlx_vector_int_ A vector of int. mlx_vector_string_ A vector of string. mlx_vector_vector_array_ A vector of vector_array. MLX_METALLIB_PATH Path to the uncompressed mlx.metallib build artifact. mlx_compile_mode__MLX_COMPILE_MODE_DISABLED mlx_compile_mode__MLX_COMPILE_MODE_ENABLED mlx_compile_mode__MLX_COMPILE_MODE_NO_FUSE mlx_compile_mode__MLX_COMPILE_MODE_NO_SIMPLIFY mlx_device_type__MLX_CPU mlx_device_type__MLX_GPU mlx_dtype__MLX_BFLOAT16 mlx_dtype__MLX_BOOL mlx_dtype__MLX_COMPLEX64 mlx_dtype__MLX_FLOAT16 mlx_dtype__MLX_FLOAT32 mlx_dtype__MLX_FLOAT64 mlx_dtype__MLX_INT8 mlx_dtype__MLX_INT16 mlx_dtype__MLX_INT32 mlx_dtype__MLX_INT64 mlx_dtype__MLX_UINT8 mlx_dtype__MLX_UINT16 mlx_dtype__MLX_UINT32 mlx_dtype__MLX_UINT64 mlx_event_backend__MLX_EVENT_BACKEND_CPU mlx_event_backend__MLX_EVENT_BACKEND_CUDA mlx_event_backend__MLX_EVENT_BACKEND_METAL mlx_event_backend__MLX_EVENT_BACKEND_NONE mlx_fft_norm__MLX_FFT_NORM_BACKWARD mlx_fft_norm__MLX_FFT_NORM_FORWARD mlx_fft_norm__MLX_FFT_NORM_ORTHO mlx_host_transfer_policy__MLX_HOST_TRANSFER_POLICY_MANAGED mlx_host_transfer_policy__MLX_HOST_TRANSFER_POLICY_TRANSFER mlx_host_transfer_storage_kind__MLX_HOST_TRANSFER_STORAGE_CPU mlx_host_transfer_storage_kind__MLX_HOST_TRANSFER_STORAGE_CUDA_MANAGED mlx_host_transfer_storage_kind__MLX_HOST_TRANSFER_STORAGE_CUDA_PINNED mlx_host_transfer_storage_kind__MLX_HOST_TRANSFER_STORAGE_METAL_SHARED mlx_submission_activity__MLX_SUBMISSION_ACTIVITY_NONE mlx_submission_activity__MLX_SUBMISSION_ACTIVITY_PENDING mlx_submission_activity__MLX_SUBMISSION_ACTIVITY_TERMINAL mlx_array_empty ⚠ mlx_abs ⚠ \defgroup ops Core array operations
/
/**@{ mlx_add ⚠ mlx_addmm ⚠ mlx_all ⚠ mlx_all_axes ⚠ mlx_all_axis ⚠ mlx_allclose ⚠ mlx_any ⚠ mlx_any_axes ⚠ mlx_any_axis ⚠ mlx_arange ⚠ mlx_arccos ⚠ mlx_arccosh ⚠ mlx_arcsin ⚠ mlx_arcsinh ⚠ mlx_arctan ⚠ mlx_arctan2 ⚠ mlx_arctanh ⚠ mlx_argmax ⚠ mlx_argmax_axis ⚠ mlx_argmin ⚠ mlx_argmin_axis ⚠ mlx_argpartition ⚠ mlx_argpartition_axis ⚠ mlx_argsort ⚠ mlx_argsort_axis ⚠ mlx_array_data_bfloat16 ⚠ Returns a pointer to the array data, cast to bfloat16_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_bool ⚠ Returns a pointer to the array data, cast to bool*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_complex64 ⚠ Returns a pointer to the array data, cast to _Complex*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_float16 ⚠ Returns a pointer to the array data, cast to float16_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_float32 ⚠ Returns a pointer to the array data, cast to float32*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_float64 ⚠ Returns a pointer to the array data, cast to float64*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_int8 ⚠ Returns a pointer to the array data, cast to int8_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_int16 ⚠ Returns a pointer to the array data, cast to int16_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_int32 ⚠ Returns a pointer to the array data, cast to int32_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_int64 ⚠ Returns a pointer to the array data, cast to int64_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_uint8 ⚠ Returns a pointer to the array data, cast to uint8_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_uint16 ⚠ Returns a pointer to the array data, cast to uint16_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_uint32 ⚠ Returns a pointer to the array data, cast to uint32_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_data_uint64 ⚠ Returns a pointer to the array data, cast to uint64_t*.
Array must be evaluated, otherwise returns NULL. mlx_array_dim ⚠ The shape of the array in a particular dimension. mlx_array_dtype ⚠ The array element type. mlx_array_equal ⚠ mlx_array_eval ⚠ Evaluate the array. mlx_array_free ⚠ Free an array. mlx_array_item_bfloat16 ⚠ Access the value of a scalar array. mlx_array_item_bool ⚠ Access the value of a scalar array. mlx_array_item_complex64 ⚠ Access the value of a scalar array. mlx_array_item_float16 ⚠ Access the value of a scalar array. mlx_array_item_float32 ⚠ Access the value of a scalar array. mlx_array_item_float64 ⚠ Access the value of a scalar array. mlx_array_item_int8 ⚠ Access the value of a scalar array. mlx_array_item_int16 ⚠ Access the value of a scalar array. mlx_array_item_int32 ⚠ Access the value of a scalar array. mlx_array_item_int64 ⚠ Access the value of a scalar array. mlx_array_item_uint8 ⚠ Access the value of a scalar array. mlx_array_item_uint16 ⚠ Access the value of a scalar array. mlx_array_item_uint32 ⚠ Access the value of a scalar array. mlx_array_item_uint64 ⚠ Access the value of a scalar array. mlx_array_itemsize ⚠ The size of the array’s datatype in bytes. mlx_array_nbytes ⚠ The number of bytes in the array. mlx_array_ndim ⚠ The array’s dimension. mlx_array_new ⚠ New empty array. mlx_array_new_bool ⚠ New array from a bool scalar. mlx_array_new_complex ⚠ New array from a complex scalar. mlx_array_new_data ⚠ New array from existing buffer.
@param data A buffer which will be copied.
@param shape Shape of the array.
@param dim Number of dimensions (size of shape).
@param dtype Type of array elements. mlx_array_new_data_managed ⚠ New array from existing buffer.
@param data A buffer which will be copied.
@param shape Shape of the array.
@param dim Number of dimensions (size of shape).
@param dtype Type of array elements.
@param dtor Callback for when the buffer is no longer needed. mlx_array_new_data_managed_payload ⚠ New array from existing buffer.
@param data A buffer which will be copied.
@param shape Shape of the array.
@param dim Number of dimensions (size of shape).
@param dtype Type of array elements.
@param payload Payload pointer passed to the dtor callback instead of
data.
@param dtor Callback for when the buffer is no longer needed. mlx_array_new_double ⚠ New array from a double scalar.
Same as float64. mlx_array_new_float ⚠ New array from a float scalar.
Same as float32. mlx_array_new_float32 ⚠ New array from a float32 scalar. mlx_array_new_float64 ⚠ New array from a float64 scalar. mlx_array_new_int ⚠ New array from a int scalar. mlx_array_set ⚠ Set array to provided src array. mlx_array_set_bool ⚠ Set array to a bool scalar. mlx_array_set_complex ⚠ Set array to a complex scalar. mlx_array_set_data ⚠ Set array to specified data and shape.
@param arr Destination array.
@param data A buffer which will be copied.
@param shape Shape of the array.
@param dim Number of dimensions (size of shape).
@param dtype Type of array elements. mlx_array_set_double ⚠ Set array to a double scalar. mlx_array_set_float ⚠ Set array to a float scalar. mlx_array_set_float32 ⚠ Set array to a float32 scalar. mlx_array_set_float64 ⚠ Set array to a float64 scalar. mlx_array_set_int ⚠ Set array to a int scalar. mlx_array_shape ⚠ The shape of the array.
Returns: a pointer to the sizes of each dimension. mlx_array_size ⚠ Number of elements in the array. mlx_array_strides ⚠ The strides of the array.
Returns: a pointer to the sizes of each dimension. mlx_array_tostring ⚠ Get array description. mlx_as_strided ⚠ mlx_astype ⚠ mlx_async_eval ⚠ \defgroup transforms Transform operations
/
/**@{ mlx_async_eval_timed ⚠ Submit evaluation between asynchronous timestamp markers on stream. mlx_async_eval_with_event ⚠ Submit evaluation of outputs and set event to its completion token. mlx_atleast_1d ⚠ mlx_atleast_2d ⚠ mlx_atleast_3d ⚠ mlx_bartlett ⚠ mlx_bitwise_and ⚠ mlx_bitwise_invert ⚠ mlx_bitwise_or ⚠ mlx_bitwise_xor ⚠ mlx_blackman ⚠ mlx_block_masked_mm ⚠ mlx_broadcast_arrays ⚠ mlx_broadcast_to ⚠ mlx_ceil ⚠ mlx_checkpoint ⚠ mlx_clear_cache ⚠ \defgroup memory Memory operations
/
/**@{ mlx_clip ⚠ mlx_closure_apply ⚠ mlx_closure_custom_apply ⚠ mlx_closure_custom_free ⚠ mlx_closure_custom_jvp_apply ⚠ mlx_closure_custom_jvp_free ⚠ mlx_closure_custom_jvp_new ⚠ mlx_closure_custom_jvp_new_func ⚠ mlx_closure_custom_jvp_new_func_payload ⚠ mlx_closure_custom_jvp_set ⚠ mlx_closure_custom_new ⚠ mlx_closure_custom_new_func ⚠ mlx_closure_custom_new_func_payload ⚠ mlx_closure_custom_set ⚠ mlx_closure_custom_vmap_apply ⚠ mlx_closure_custom_vmap_free ⚠ mlx_closure_custom_vmap_new ⚠ mlx_closure_custom_vmap_new_func ⚠ mlx_closure_custom_vmap_new_func_payload ⚠ mlx_closure_custom_vmap_set ⚠ mlx_closure_free ⚠ mlx_closure_kwargs_apply ⚠ mlx_closure_kwargs_free ⚠ mlx_closure_kwargs_new ⚠ mlx_closure_kwargs_new_func ⚠ mlx_closure_kwargs_new_func_payload ⚠ mlx_closure_kwargs_set ⚠ mlx_closure_new ⚠ mlx_closure_new_func ⚠ mlx_closure_new_func_payload ⚠ mlx_closure_new_unary ⚠ mlx_closure_set ⚠ mlx_closure_value_and_grad_apply ⚠ mlx_closure_value_and_grad_free ⚠ mlx_closure_value_and_grad_new ⚠ mlx_closure_value_and_grad_new_func ⚠ mlx_closure_value_and_grad_new_func_payload ⚠ mlx_closure_value_and_grad_set ⚠ mlx_compile ⚠ mlx_concatenate ⚠ mlx_concatenate_axis ⚠ mlx_conjugate ⚠ mlx_contiguous ⚠ mlx_conv1d ⚠ mlx_conv2d ⚠ mlx_conv3d ⚠ mlx_conv_general ⚠ mlx_conv_transpose1d ⚠ mlx_conv_transpose2d ⚠ mlx_conv_transpose3d ⚠ mlx_copy ⚠ mlx_copy_from_host ⚠ Asynchronously copy a host transfer buffer into a new array on stream.
event covers the complete copy. mlx_copy_to_host ⚠ Allocate a host transfer buffer and asynchronously copy source into it. mlx_cos ⚠ mlx_cosh ⚠ mlx_cuda_is_available ⚠ \defgroup cuda Cuda specific operations
/
/**@{ mlx_cummax ⚠ mlx_cummin ⚠ mlx_cumprod ⚠ mlx_cumsum ⚠ mlx_custom_function ⚠ mlx_custom_vjp ⚠ mlx_default_cpu_stream_new ⚠ Returns the current default CPU stream. mlx_default_gpu_stream_new ⚠ Returns the current default GPU stream. mlx_degrees ⚠ mlx_depends ⚠ mlx_dequantize ⚠ mlx_detail_compile ⚠ mlx_detail_compile_clear_cache ⚠ mlx_detail_compile_erase ⚠ mlx_detail_vmap_replace ⚠ \defgroup transforms_impl Implementation detail operations
/
/**@{ mlx_detail_vmap_trace ⚠ mlx_device_count ⚠ Get the number of available devices for a device type. mlx_device_equal ⚠ Check if devices are the same. mlx_device_free ⚠ Free a device. mlx_device_get_index ⚠ Returns the index of the device. mlx_device_get_type ⚠ Returns the type of the device. mlx_device_info_free ⚠ Free a device info object. mlx_device_info_get ⚠ Get device information for a device. mlx_device_info_get_keys ⚠ Get all keys from device info.
Returns 0 on success, 1 on error. mlx_device_info_get_size ⚠ Get a size_t value from device info.
Returns 0 on success, 1 on error, 2 if key not found or wrong type. mlx_device_info_get_string ⚠ Get a string value from device info.
Returns 0 on success, 1 on error, 2 if key not found or wrong type. mlx_device_info_has_key ⚠ Check if a key exists in the device info.
Returns 0 on success, 1 on error.
Sets *exists to true if the key exists, false otherwise. mlx_device_info_is_string ⚠ Check if a value is a string type.
Returns 0 on success, 1 on error.
Sets *is_string to true if the value is a string, false if it’s a size_t. mlx_device_info_new ⚠ Returns a new empty device info object. mlx_device_is_available ⚠ Check if device is available. mlx_device_new ⚠ Returns a new empty device. mlx_device_new_type ⚠ Returns a new device of specified type, with specified index. mlx_device_set ⚠ Set device to provided src device. mlx_device_tostring ⚠ Get device description. mlx_diag ⚠ mlx_diagonal ⚠ mlx_disable_compile ⚠ mlx_distributed_all_gather ⚠ \defgroup distributed Distributed collectives
/
/**@{ mlx_distributed_all_max ⚠ mlx_distributed_all_min ⚠ mlx_distributed_all_sum ⚠ mlx_distributed_all_to_all_v ⚠ mlx_distributed_group_free ⚠ Free the group. mlx_distributed_group_new ⚠ Create an empty group. mlx_distributed_group_rank ⚠ Get the rank. mlx_distributed_group_size ⚠ Get the group size. mlx_distributed_group_split ⚠ Split the group. mlx_distributed_init ⚠ Initialize distributed. mlx_distributed_is_available ⚠ Check if distributed is available. mlx_distributed_recv ⚠ mlx_distributed_recv_like ⚠ mlx_distributed_send ⚠ mlx_distributed_sum_scatter ⚠ mlx_divide ⚠ mlx_divmod ⚠ mlx_dtype_size ⚠ Size of given mlx_dtype datatype in bytes. mlx_einsum ⚠ mlx_enable_compile ⚠ mlx_equal ⚠ mlx_erf ⚠ mlx_erfinv ⚠ mlx_eval ⚠ mlx_event_elapsed ⚠ Resolve elapsed execution-timeline seconds, blocking until completion. mlx_event_free ⚠ Free an event handle. Queued producer and consumer work retains it. mlx_event_get_backend ⚠ Return the producer backend. mlx_event_get_device ⚠ Return the producer device. mlx_event_has_device ⚠ Return whether this event has a producer device identity. mlx_event_has_timing ⚠ Return whether this completion event carries timestamp markers. mlx_event_new ⚠ Return a new, already-complete event without a device identity. mlx_event_query ⚠ Nonblocking completion query. mlx_event_synchronize ⚠ Block the host until completion and report retained async errors. mlx_event_try_elapsed ⚠ Query elapsed execution-timeline seconds without blocking. mlx_exp ⚠ mlx_expand_dims ⚠ mlx_expand_dims_axes ⚠ mlx_expm1 ⚠ mlx_export_function ⚠ \defgroup export Function serialization
/
/**@{ mlx_export_function_kwargs ⚠ mlx_eye ⚠ mlx_fast_cuda_kernel_apply ⚠ mlx_fast_cuda_kernel_config_add_output_arg ⚠ mlx_fast_cuda_kernel_config_add_template_arg_bool ⚠ mlx_fast_cuda_kernel_config_add_template_arg_dtype ⚠ mlx_fast_cuda_kernel_config_add_template_arg_int ⚠ mlx_fast_cuda_kernel_config_free ⚠ mlx_fast_cuda_kernel_config_new ⚠ mlx_fast_cuda_kernel_config_set_grid ⚠ mlx_fast_cuda_kernel_config_set_init_value ⚠ mlx_fast_cuda_kernel_config_set_thread_group ⚠ mlx_fast_cuda_kernel_config_set_verbose ⚠ mlx_fast_cuda_kernel_free ⚠ mlx_fast_cuda_kernel_new ⚠ mlx_fast_layer_norm ⚠ mlx_fast_metal_kernel_apply ⚠ mlx_fast_metal_kernel_config_add_output_arg ⚠ mlx_fast_metal_kernel_config_add_template_arg_bool ⚠ mlx_fast_metal_kernel_config_add_template_arg_dtype ⚠ mlx_fast_metal_kernel_config_add_template_arg_int ⚠ mlx_fast_metal_kernel_config_free ⚠ mlx_fast_metal_kernel_config_new ⚠ mlx_fast_metal_kernel_config_set_grid ⚠ mlx_fast_metal_kernel_config_set_init_value ⚠ mlx_fast_metal_kernel_config_set_thread_group ⚠ mlx_fast_metal_kernel_config_set_verbose ⚠ mlx_fast_metal_kernel_free ⚠ mlx_fast_metal_kernel_new ⚠ mlx_fast_rms_norm ⚠ mlx_fast_rope ⚠ mlx_fast_rope_dynamic ⚠ mlx_fast_scaled_dot_product_attention ⚠ mlx_fft_fft ⚠ mlx_fft_fft2 ⚠ mlx_fft_fftfreq ⚠ mlx_fft_fftn ⚠ mlx_fft_fftshift ⚠ mlx_fft_ifft ⚠ mlx_fft_ifft2 ⚠ mlx_fft_ifftn ⚠ mlx_fft_ifftshift ⚠ mlx_fft_irfft ⚠ mlx_fft_irfft2 ⚠ mlx_fft_irfftn ⚠ mlx_fft_rfft ⚠ mlx_fft_rfft2 ⚠ mlx_fft_rfftfreq ⚠ mlx_fft_rfftn ⚠ mlx_flatten ⚠ mlx_floor ⚠ mlx_floor_divide ⚠ mlx_from_fp8 ⚠ mlx_full ⚠ mlx_full_like ⚠ mlx_function_exporter_apply ⚠ mlx_function_exporter_apply_kwargs ⚠ mlx_function_exporter_free ⚠ mlx_function_exporter_new ⚠ mlx_gather ⚠ mlx_gather_mm ⚠ mlx_gather_qmm ⚠ mlx_gather_single ⚠ mlx_get_active_memory ⚠ mlx_get_cache_memory ⚠ mlx_get_default_device ⚠ Returns the default MLX device. mlx_get_default_stream ⚠ Returns the default stream on the given device. mlx_get_memory_limit ⚠ mlx_get_peak_memory ⚠ mlx_greater ⚠ mlx_greater_equal ⚠ mlx_hadamard_transform ⚠ mlx_hamming ⚠ mlx_hanning ⚠ mlx_host_transfer_buffer_capacity ⚠ mlx_host_transfer_buffer_data ⚠ mlx_host_transfer_buffer_data_mut ⚠ mlx_host_transfer_buffer_dtype ⚠ mlx_host_transfer_buffer_free ⚠ Free a host transfer buffer. Submitted work retains its allocation. mlx_host_transfer_buffer_nbytes ⚠ mlx_host_transfer_buffer_ndim ⚠ mlx_host_transfer_buffer_new ⚠ Allocate an uninitialized typed host transfer buffer. mlx_host_transfer_buffer_policy ⚠ mlx_host_transfer_buffer_shape ⚠ mlx_host_transfer_buffer_size ⚠ mlx_host_transfer_buffer_storage_kind ⚠ mlx_host_transfer_capacity_upper_bound ⚠ Return a conservative capacity bound for pre-allocation admission. mlx_host_transfer_memory_stats_get ⚠ Read current and peak physical host-transfer allocation telemetry. mlx_host_transfer_memory_stats_reset_peak ⚠ Reset one storage kind’s peaks to its current occupancy. mlx_identity ⚠ mlx_imag ⚠ mlx_imported_function_apply ⚠ mlx_imported_function_apply_kwargs ⚠ mlx_imported_function_free ⚠ mlx_imported_function_new ⚠ mlx_inner ⚠ mlx_io_reader_descriptor ⚠ Get IO reader user descriptor. mlx_io_reader_free ⚠ Free IO reader. mlx_io_reader_new ⚠ Returns a new custom IO reader.
vtable operates on user descriptor desc. mlx_io_reader_tostring ⚠ Get IO reader description. mlx_io_writer_descriptor ⚠ Get IO writer user descriptor. mlx_io_writer_free ⚠ Free IO writer. mlx_io_writer_new ⚠ Returns a new custom IO writer.
vtable operates on user descriptor desc. mlx_io_writer_tostring ⚠ Get IO writer description. mlx_isclose ⚠ mlx_isfinite ⚠ mlx_isinf ⚠ mlx_isnan ⚠ mlx_isneginf ⚠ mlx_isposinf ⚠ mlx_jvp ⚠ mlx_kron ⚠ mlx_left_shift ⚠ mlx_less ⚠ mlx_less_equal ⚠ mlx_linalg_cholesky ⚠ \defgroup linalg Linear algebra operations
/
/**@{ mlx_linalg_cholesky_inv ⚠ mlx_linalg_cross ⚠ mlx_linalg_eig ⚠ mlx_linalg_eigh ⚠ mlx_linalg_eigvals ⚠ mlx_linalg_eigvalsh ⚠ mlx_linalg_inv ⚠ mlx_linalg_lu ⚠ mlx_linalg_lu_factor ⚠ mlx_linalg_norm ⚠ mlx_linalg_norm_l2 ⚠ mlx_linalg_norm_matrix ⚠ mlx_linalg_pinv ⚠ mlx_linalg_qr ⚠ mlx_linalg_solve ⚠ mlx_linalg_solve_triangular ⚠ mlx_linalg_svd ⚠ mlx_linalg_tri_inv ⚠ mlx_linspace ⚠ mlx_load ⚠ mlx_load_reader ⚠ \defgroup io IO operations
/
/**@{ mlx_load_safetensors ⚠ mlx_load_safetensors_reader ⚠ mlx_log ⚠ mlx_log2 ⚠ mlx_log1p ⚠ mlx_log10 ⚠ mlx_logaddexp ⚠ mlx_logcumsumexp ⚠ mlx_logical_and ⚠ mlx_logical_not ⚠ mlx_logical_or ⚠ mlx_logsumexp ⚠ mlx_logsumexp_axes ⚠ mlx_logsumexp_axis ⚠ mlx_map_string_to_array_free ⚠ Free a string-to-array map. mlx_map_string_to_array_get ⚠ Returns the value indexed at the specified key in the map. mlx_map_string_to_array_insert ⚠ Insert a new value at the specified key in the map. mlx_map_string_to_array_iterator_free ⚠ Free iterator. mlx_map_string_to_array_iterator_new ⚠ Returns a new iterator over the given map. mlx_map_string_to_array_iterator_next ⚠ Increment iterator. mlx_map_string_to_array_new ⚠ Returns a new empty string-to-array map. mlx_map_string_to_array_set ⚠ Set map to provided src map. mlx_map_string_to_string_free ⚠ Free a string-to-string map. mlx_map_string_to_string_get ⚠ Returns the value indexed at the specified key in the map. mlx_map_string_to_string_insert ⚠ Insert a new value at the specified key in the map. mlx_map_string_to_string_iterator_free ⚠ Free iterator. mlx_map_string_to_string_iterator_new ⚠ Returns a new iterator over the given map. mlx_map_string_to_string_iterator_next ⚠ Increment iterator. mlx_map_string_to_string_new ⚠ Returns a new empty string-to-string map. mlx_map_string_to_string_set ⚠ Set map to provided src map. mlx_masked_scatter ⚠ mlx_matmul ⚠ mlx_max ⚠ mlx_max_axes ⚠ mlx_max_axis ⚠ mlx_maximum ⚠ mlx_mean ⚠ mlx_mean_axes ⚠ mlx_mean_axis ⚠ mlx_median ⚠ mlx_meshgrid ⚠ mlx_metal_is_available ⚠ \defgroup metal Metal specific operations
/
/**@{ mlx_metal_set_embedded_metallib ⚠ mlx_metal_set_metallib_path ⚠ mlx_metal_start_capture ⚠ mlx_metal_stop_capture ⚠ mlx_min ⚠ mlx_min_axes ⚠ mlx_min_axis ⚠ mlx_minimum ⚠ mlx_moveaxis ⚠ mlx_multiply ⚠ mlx_nan_to_num ⚠ mlx_negative ⚠ mlx_node_namer_free ⚠ mlx_node_namer_get_name ⚠ mlx_node_namer_new ⚠ mlx_node_namer_set_name ⚠ mlx_not_equal ⚠ mlx_number_of_elements ⚠ mlx_ones ⚠ mlx_ones_like ⚠ mlx_outer ⚠ mlx_pad ⚠ mlx_pad_symmetric ⚠ mlx_partition ⚠ mlx_partition_axis ⚠ mlx_power ⚠ mlx_prod ⚠ mlx_prod_axes ⚠ mlx_prod_axis ⚠ mlx_put_along_axis ⚠ mlx_qqmm ⚠ mlx_quantize ⚠ mlx_quantized_matmul ⚠ mlx_radians ⚠ mlx_random_bernoulli ⚠ \defgroup random Random number operations
/
/**@{ mlx_random_bits ⚠ mlx_random_categorical ⚠ mlx_random_categorical_num_samples ⚠ mlx_random_categorical_shape ⚠ mlx_random_gumbel ⚠ mlx_random_key ⚠ mlx_random_laplace ⚠ mlx_random_multivariate_normal ⚠ mlx_random_normal ⚠ mlx_random_normal_broadcast ⚠ mlx_random_permutation ⚠ mlx_random_permutation_arange ⚠ mlx_random_randint ⚠ mlx_random_seed ⚠ mlx_random_split ⚠ mlx_random_split_num ⚠ mlx_random_truncated_normal ⚠ mlx_random_uniform ⚠ mlx_real ⚠ mlx_reciprocal ⚠ mlx_remainder ⚠ mlx_repeat ⚠ mlx_repeat_axis ⚠ mlx_reset_peak_memory ⚠ mlx_reshape ⚠ mlx_right_shift ⚠ mlx_roll ⚠ mlx_roll_axes ⚠ mlx_roll_axis ⚠ mlx_round ⚠ mlx_rsqrt ⚠ mlx_save ⚠ mlx_save_safetensors ⚠ mlx_save_safetensors_writer ⚠ mlx_save_writer ⚠ mlx_scatter ⚠ mlx_scatter_add ⚠ mlx_scatter_add_axis ⚠ mlx_scatter_add_single ⚠ mlx_scatter_max ⚠ mlx_scatter_max_single ⚠ mlx_scatter_min ⚠ mlx_scatter_min_single ⚠ mlx_scatter_prod ⚠ mlx_scatter_prod_single ⚠ mlx_scatter_single ⚠ mlx_segmented_mm ⚠ mlx_set_cache_limit ⚠ mlx_set_compile_mode ⚠ mlx_set_default_device ⚠ Set the default MLX device. mlx_set_default_stream ⚠ Set default stream. mlx_set_error_handler ⚠ Set the error handler. mlx_set_memory_limit ⚠ mlx_set_wired_limit ⚠ mlx_sigmoid ⚠ mlx_sign ⚠ mlx_sin ⚠ mlx_sinh ⚠ mlx_slice ⚠ mlx_slice_dynamic ⚠ mlx_slice_update ⚠ mlx_slice_update_add ⚠ mlx_slice_update_dynamic ⚠ mlx_slice_update_max ⚠ mlx_slice_update_min ⚠ mlx_slice_update_prod ⚠ mlx_softmax ⚠ mlx_softmax_axes ⚠ mlx_softmax_axis ⚠ mlx_sort ⚠ mlx_sort_axis ⚠ mlx_split ⚠ mlx_split_sections ⚠ mlx_sqrt ⚠ mlx_square ⚠ mlx_squeeze ⚠ mlx_squeeze_axes ⚠ mlx_squeeze_axis ⚠ mlx_stack ⚠ mlx_stack_axis ⚠ mlx_std ⚠ mlx_std_axes ⚠ mlx_std_axis ⚠ mlx_stop_gradient ⚠ mlx_stream_equal ⚠ Check if streams are the same. mlx_stream_free ⚠ Free a stream. mlx_stream_get_device ⚠ Return the device of the stream. mlx_stream_get_index ⚠ Return the index of the stream. mlx_stream_new ⚠ Returns a new empty stream. mlx_stream_new_device ⚠ Returns a new stream on a device. mlx_stream_set ⚠ Set stream to provided src stream. mlx_stream_tostring ⚠ Get stream description. mlx_stream_wait_event ⚠ Order later work on stream after event without blocking the host. mlx_string_data ⚠ Returns a pointer to the string contents.
The pointer is valid for the life duration of the string. mlx_string_free ⚠ Free string. mlx_string_new ⚠ Returns a new empty string. mlx_string_new_data ⚠ Returns a new string, copying contents from str, which must end with \0. mlx_string_set ⚠ Set string to src string. mlx_submission_scope_free ⚠ mlx_submission_scope_new ⚠ mlx_submission_scope_progress ⚠ mlx_submission_scope_query ⚠ mlx_submission_scope_seal ⚠ mlx_subtract ⚠ mlx_sum ⚠ mlx_sum_axes ⚠ mlx_sum_axis ⚠ mlx_swapaxes ⚠ mlx_synchronize ⚠ Synchronize with the provided stream. mlx_take ⚠ mlx_take_along_axis ⚠ mlx_take_axis ⚠ mlx_tan ⚠ mlx_tanh ⚠ mlx_tensordot ⚠ mlx_tensordot_axis ⚠ mlx_tile ⚠ mlx_to_fp8 ⚠ mlx_topk ⚠ mlx_topk_axis ⚠ mlx_trace ⚠ mlx_transpose ⚠ mlx_transpose_axes ⚠ mlx_tri ⚠ mlx_tril ⚠ mlx_triu ⚠ mlx_unflatten ⚠ mlx_value_and_grad ⚠ mlx_var ⚠ mlx_var_axes ⚠ mlx_var_axis ⚠ mlx_vector_array_append_data ⚠ mlx_vector_array_append_value ⚠ mlx_vector_array_free ⚠ mlx_vector_array_get ⚠ mlx_vector_array_new ⚠ mlx_vector_array_new_data ⚠ mlx_vector_array_new_value ⚠ mlx_vector_array_set ⚠ mlx_vector_array_set_data ⚠ mlx_vector_array_set_value ⚠ mlx_vector_array_size ⚠ mlx_vector_int_append_data ⚠ mlx_vector_int_append_value ⚠ mlx_vector_int_free ⚠ mlx_vector_int_get ⚠ mlx_vector_int_new ⚠ mlx_vector_int_new_data ⚠ mlx_vector_int_new_value ⚠ mlx_vector_int_set ⚠ mlx_vector_int_set_data ⚠ mlx_vector_int_set_value ⚠ mlx_vector_int_size ⚠ mlx_vector_string_append_data ⚠ mlx_vector_string_append_value ⚠ mlx_vector_string_free ⚠ mlx_vector_string_get ⚠ mlx_vector_string_new ⚠ mlx_vector_string_new_data ⚠ mlx_vector_string_new_value ⚠ mlx_vector_string_set ⚠ mlx_vector_string_set_data ⚠ mlx_vector_string_set_value ⚠ mlx_vector_string_size ⚠ mlx_vector_vector_array_append_data ⚠ mlx_vector_vector_array_append_value ⚠ mlx_vector_vector_array_free ⚠ mlx_vector_vector_array_get ⚠ mlx_vector_vector_array_new ⚠ mlx_vector_vector_array_new_data ⚠ mlx_vector_vector_array_new_value ⚠ mlx_vector_vector_array_set ⚠ mlx_vector_vector_array_set_data ⚠ mlx_vector_vector_array_set_value ⚠ mlx_vector_vector_array_size ⚠ mlx_version ⚠ mlx_view ⚠ mlx_vjp ⚠ mlx_where ⚠ mlx_zeros ⚠ mlx_zeros_like ⚠ bfloat16_t float16_t mlx_array A N-dimensional array object. mlx_closure \defgroup mlx_closure Closures
MLX closure objects.
/
/**@{ mlx_closure_custom mlx_closure_custom_jvp mlx_closure_custom_vmap mlx_closure_kwargs mlx_closure_value_and_grad mlx_compile_mode_ \defgroup compile Compilation operations
/
/**@{ mlx_complex64_t mlx_device A MLX device object. mlx_device_info A MLX device info object.
Contains key-value pairs with device properties.
Keys vary by backend but common keys include: mlx_device_type_ Device type. mlx_distributed_group A MLX distributed group object. mlx_dtype_ Array element type. mlx_error_handler_func \defgroup mlx_error Error management
/
/**@{ mlx_event An owning opaque completion event. mlx_event_backend_ Backend identity of a completion event. mlx_fast_cuda_kernel mlx_fast_cuda_kernel_config \defgroup fast Fast custom operations
/
/**@{ mlx_fast_metal_kernel mlx_fast_metal_kernel_config mlx_fft_norm_ \defgroup fft FFT operations
/
/**@{ mlx_function_exporter mlx_host_transfer_buffer An owning, host-addressable transfer allocation. mlx_host_transfer_memory_stats Process-wide physical allocation telemetry for one storage kind. mlx_host_transfer_policy_ Requested semantics for host transfer storage. mlx_host_transfer_storage_kind_ Physical storage selected by the active MLX backend. mlx_imported_function mlx_io_reader A MLX IO reader object. mlx_io_vtable Virtual table for custom IO reader and writer objects. mlx_io_writer A MLX IO writer object. mlx_map_string_to_array A string-to-array map mlx_map_string_to_array_iterator An iterator over a string-to-array map. mlx_map_string_to_string A string-to-string map mlx_map_string_to_string_iterator An iterator over a string-to-string map. mlx_node_namer \defgroup graph_utils Graph Utils
/
/**@{ mlx_optional_dtype A dtype optional. mlx_optional_float A float optional. mlx_optional_int A int optional. mlx_stream A MLX stream object. mlx_string A MLX string object. mlx_submission_activity_ mlx_submission_scope mlx_submission_status mlx_vector_array A vector of array. mlx_vector_int A vector of int. mlx_vector_string A vector of string. mlx_vector_vector_array A vector of vector_array.