mnn library
MNN bindings for Dart.
Copyright (c) 2025, rainyl. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file.
Classes
- BackendConfig
- Expr
- HalideBuffer
- HalideDimension
- HalideType
- Interpreter
- NativeObject
- Base class for wrapping C++ objects in Dart
- PrintOptions
- RuntimeInfo
- ScheduleConfig
- Session
- Tensor
- Timer
- VariableInfo
- VarMap
- VARP
-
Vec<
N extends Pointer< NativeType> , T> - VecF32
- VecF32Iterator
- VecF64
- VecF64Iterator
- VecI16
- VecI16Iterator
- VecI32
- VecI32Iterator
- VecI8
- VecI8Iterator
-
VecIterator<
T> - VecU16
- VecU16Iterator
- VecU8
- VecU8Iterator
-
VecUnmodifible<
N extends Pointer< NativeType> , T> - VecVARP
Enums
- DataType
- DimensionFormat
- DimensionType
- ErrorCode
- Error code enum
- ForwardType
- HalideTypeCode
- Types in the halide type system. They can be ints, unsigned ints, or floats (of various bit-widths), or a handle (which is always 64-bits). Note that the int/uint/float values do not imply a specific bit width (the bit width is expected to be encoded in a separate value).
- HandleDataType
- HintMode
- Hint mode enum
- InputType
- MapType
- MemoryType
- SessionInfoCode
- SessionMode
- StbirDataType
- StbirEdge
- =============================================================== Medium-complexity API
- StbirFilter
- StbirPixelLayout
- stbir_pixel_layout specifies: number of channels order of channels whether color is premultiplied by alpha for back compatibility, you can cast the old channel count to an stbir_pixel_layout
Mixins
Extensions
- DataTypeExt on DataType
-
ListDoubleExtension
on List<
double> -
ListFloatExtension
on List<
double> -
ListIntExtension
on List<
int> -
ListUCharExtension
on List<
int> -
ListVarpExtension
on List<
VARP> - StringVecExtension on String
- VARPFormatting on VARP
- Extension methods for VARP formatting
Constants
- MNN_GPU_MEMORY_BUFFER → const int
- OpenCL_MEMORY_BUFFER
- MNN_GPU_MEMORY_IMAGE → const int
- OpenCL_MEMORY_IMAGE
- MNN_GPU_RECORD_BATCH → const int
- 10 kernels record into one recording.(OpenCL) All ops share one commandBuffer.(Vulkan)
- MNN_GPU_RECORD_OP → const int
- The kernels in one op execution record into one recording.(OpenCL)
- MNN_GPU_TUNING_FAST → const int
- Fast tuning, performance may not good.(OpenCL)
- MNN_GPU_TUNING_HEAVY → const int
- Heavily tuning, usually not suggested.(OpenCL/Vulkan)
- MNN_GPU_TUNING_NONE → const int
- Copyright (c) 2025, rainyl. All rights reserved. Use of this source code is governed by a Apache 2.0 license that can be found in the LICENSE file. Forbidden tuning, performance not good.(OpenCL/Vulkan)
- MNN_GPU_TUNING_NORMAL → const int
- Normal tuning, performance may be ok.(OpenCL)
- MNN_GPU_TUNING_WIDE → const int
- Widely tuning, performance good. Default.(OpenCL/Vulkan)
- MNN_MEMORY_HIGH → const int
- MNN_MEMORY_LOW → const int
- MNN_MEMORY_NORMAL → const int
- MNN_POWER_HIGH → const int
- MNN_POWER_LOW → const int
- MNN_POWER_NORMAL → const int
- MNN_PRECISION_HIGH → const int
- MNN_PRECISION_LOW → const int
- MNN_PRECISION_LOW_BF16 → const int
- MNN_PRECISION_NORMAL → const int
Functions
-
array2string(
List< num> data, List<int> shape, {PrintOptions options = const PrintOptions(), String separator = ', ', String prefix = '', String suffix = ''}) → String -
calcColumnWidths(
List< num> data, List<int> shape, PrintOptions options) → List<int> -
formatAligned(
num v, int width, PrintOptions options) → String -
formatFloat(
num x, int precision, bool suppress) → String -
formatInt(
int x) → String -
getVersion(
) → String -
MnnAssert(
bool condition, String message) → void -
mnnRun(
ErrorCode func()) → void -
mnnRunAsync0<
T> (ErrorCode func(mnn_callback_0 callback), void onComplete(Completer< T> completer)) → Future<T>