Skip to main content

apple_mps/
lib.rs

1#![doc = include_str!("../README.md")]
2#![cfg_attr(docsrs, feature(doc_cfg))]
3#![allow(clippy::doc_markdown)]
4#![allow(clippy::missing_const_for_fn)]
5#![allow(clippy::missing_errors_doc)]
6#![allow(clippy::module_name_repetitions)]
7#![allow(clippy::must_use_candidate)]
8
9/// Metal Performance Shaders core device and command-buffer wrappers.
10pub mod core;
11/// Error types returned by the safe Metal Performance Shaders wrappers.
12pub mod error;
13#[doc(hidden)]
14pub mod ffi;
15/// Metal Performance Shaders image-filter wrappers.
16pub mod filters;
17mod generated;
18/// Metal Performance Shaders image wrappers and related raw-value helpers.
19pub mod image;
20/// Metal Performance Shaders matrix and vector wrappers.
21pub mod matrix;
22/// Metal Performance Shaders NDArray wrappers.
23pub mod ndarray;
24/// Metal Performance Shaders neural-network graph and optimizer wrappers.
25pub mod neural;
26/// Metal Performance Shaders ray-tracing wrappers.
27pub mod ray;
28/// Metal Performance Shaders state wrappers.
29pub mod state;
30
31pub use crate::core::{
32    device_options, hint_temporary_memory_high_water_mark, preferred_device,
33    set_heap_cache_duration, supports_mtl_device, CommandBuffer as MpsCommandBuffer, Predicate,
34    PreferredDevice,
35};
36pub use crate::error::{Error, Result};
37pub use crate::filters::{
38    HistogramInfo, ImageAdd, ImageBilinearScale, ImageBox, ImageConvolution, ImageGaussianBlur,
39    ImageHistogram, ImageLanczosScale, ImageMedian, ImageReduceRowMax, ImageReduceRowMean,
40    ImageReduceRowMin, ImageReduceRowSum, ImageScaleAndAdd, ImageSobel, ImageStatisticsMean,
41    ImageStatisticsMinAndMax, ImageThresholdBinary, ScaleTransform,
42};
43pub use crate::image::{
44    feature_channel_format, image_edge_mode, image_layout, kernel_options, Image, ImageDescriptor,
45    ImageReadWriteParams, ImageRegion,
46};
47pub use crate::matrix::{
48    data_type, data_type_size, Matrix, MatrixDescriptor, MatrixMultiplication,
49    MatrixMultiplicationDescriptor, Vector, VectorDescriptor,
50};
51pub use crate::ndarray::{
52    NDArray, NDArrayDescriptor, NDArrayIdentity, NDArrayMatrixMultiplication,
53};
54pub use crate::neural::{
55    cnn_accumulator_precision_option, cnn_convolution_flags, cnn_convolution_weights_layout,
56    nn_regularization_type, rnn_bidirectional_combine_mode, rnn_sequence_direction, CnnConvolution,
57    CnnConvolutionDescriptor, CnnConvolutionWeightsAndBiasesState, CnnNeuronReluNode,
58    CnnPoolingMaxNode, CnnSoftMaxNode, CnnUpsamplingNearestNode, GruDescriptor, LstmDescriptor,
59    NNGraph, NNImageNode, NNOptimizer, NNOptimizerAdam, NNOptimizerDescriptor, NNOptimizerRmsProp,
60    NNOptimizerStochasticGradientDescent, RnnDescriptor, RnnImageInferenceLayer,
61    RnnRecurrentImageState, RnnSingleGateDescriptor,
62};
63pub use crate::ray::{
64    acceleration_structure_status, acceleration_structure_usage, cull_mode, intersection_data_type,
65    intersection_type, polygon_type, ray_data_type, winding, PolygonAccelerationStructure,
66    RayIntersector, SVGF,
67};
68pub use crate::state::{
69    state_batch_increment_read_count, state_batch_resource_size, state_batch_synchronize,
70    state_resource_type, State, StateResourceList, StateTextureInfo,
71};