rustnn C and C++ API
WebNN graph construction and execution
Loading...
Searching...
No Matches
rustnn.h
Go to the documentation of this file.
1#pragma once
2
3#include <stdarg.h>
4#include <stdbool.h>
5#include <stdint.h>
6#include <stdlib.h>
7
37
55
75
106
124
182
212
222
229
236
243
250
257
264
271
291
313
324
360
373
379typedef struct RustnnNamedOperand {
383 const char *name;
387 const struct RustnnOperand *operand;
389
395typedef struct RustnnNamedTensor {
399 const char *name;
403 const struct RustnnTensor *tensor;
405
406#ifdef __cplusplus
407extern "C" {
408#endif // __cplusplus
409
414
422
429 const uint64_t *shape,
430 uintptr_t shape_len,
431 struct RustnnOperandDescriptor **output);
432
439
446 const uint64_t *shape,
447 uintptr_t shape_len,
448 bool readable,
449 bool writable,
450 struct RustnnTensorDescriptor **output);
451
458
465
472 struct RustnnContext **output);
473
480
487 const struct RustnnTensorDescriptor *descriptor,
488 struct RustnnTensor **output);
489
496
503 const struct RustnnTensor *tensor,
504 const void *data,
505 uintptr_t data_len);
506
513 const struct RustnnTensor *tensor,
514 void *data,
515 uintptr_t data_len);
516
521
530 struct RustnnGraphBuilder **output);
531
536
541
548 const char *name,
549 const struct RustnnOperandDescriptor *descriptor,
550 struct RustnnOperand **output);
551
558 const struct RustnnOperandDescriptor *descriptor,
559 const void *data,
560 uintptr_t data_len,
561 struct RustnnOperand **output);
562
569 enum RustnnUnaryOperation operation,
570 const struct RustnnOperand *input,
571 struct RustnnOperand **output);
572
579 enum RustnnBinaryOperation operation,
580 const struct RustnnOperand *lhs,
581 const struct RustnnOperand *rhs,
582 struct RustnnOperand **output);
583
590 enum RustnnTernaryOperation operation,
591 const struct RustnnOperand *first,
592 const struct RustnnOperand *second,
593 const struct RustnnOperand *third,
594 struct RustnnOperand **output);
595
600 enum RustnnUnaryOperation operation,
601 const struct RustnnOperand *input,
602 const struct RustnnOperatorOptions *options,
603 struct RustnnOperand **output);
604
609 enum RustnnBinaryOperation operation,
610 const struct RustnnOperand *lhs,
611 const struct RustnnOperand *rhs,
612 const struct RustnnOperatorOptions *options,
613 struct RustnnOperand **output);
614
621 const struct RustnnOperand *lhs,
622 const struct RustnnOperand *rhs,
623 struct RustnnOperand **output);
624
631 const struct RustnnOperand *lhs,
632 const struct RustnnOperand *rhs,
633 struct RustnnOperand **output);
634
641 const struct RustnnOperand *lhs,
642 const struct RustnnOperand *rhs,
643 struct RustnnOperand **output);
644
651 const struct RustnnOperand *lhs,
652 const struct RustnnOperand *rhs,
653 struct RustnnOperand **output);
654
661 const struct RustnnOperand *lhs,
662 const struct RustnnOperand *rhs,
663 struct RustnnOperand **output);
664
671 const struct RustnnOperand *lhs,
672 const struct RustnnOperand *rhs,
673 struct RustnnOperand **output);
674
681 const struct RustnnOperand *lhs,
682 const struct RustnnOperand *rhs,
683 struct RustnnOperand **output);
684
691 const struct RustnnOperand *lhs,
692 const struct RustnnOperand *rhs,
693 struct RustnnOperand **output);
694
701 const struct RustnnOperand *lhs,
702 const struct RustnnOperand *rhs,
703 struct RustnnOperand **output);
704
711 const struct RustnnOperand *lhs,
712 const struct RustnnOperand *rhs,
713 struct RustnnOperand **output);
714
721 const struct RustnnOperand *lhs,
722 const struct RustnnOperand *rhs,
723 struct RustnnOperand **output);
724
731 const struct RustnnOperand *lhs,
732 const struct RustnnOperand *rhs,
733 struct RustnnOperand **output);
734
741 const struct RustnnOperand *lhs,
742 const struct RustnnOperand *rhs,
743 struct RustnnOperand **output);
744
751 const struct RustnnOperand *lhs,
752 const struct RustnnOperand *rhs,
753 struct RustnnOperand **output);
754
761 const struct RustnnOperand *lhs,
762 const struct RustnnOperand *rhs,
763 struct RustnnOperand **output);
764
771 const struct RustnnOperand *lhs,
772 const struct RustnnOperand *rhs,
773 struct RustnnOperand **output);
774
781 const struct RustnnOperand *lhs,
782 const struct RustnnOperand *rhs,
783 struct RustnnOperand **output);
784
791 const struct RustnnOperand *input,
792 struct RustnnOperand **output);
793
800 const struct RustnnOperand *input,
801 struct RustnnOperand **output);
802
809 const struct RustnnOperand *input,
810 struct RustnnOperand **output);
811
818 const struct RustnnOperand *input,
819 struct RustnnOperand **output);
820
827 const struct RustnnOperand *input,
828 struct RustnnOperand **output);
829
836 const struct RustnnOperand *input,
837 struct RustnnOperand **output);
838
845 const struct RustnnOperand *input,
846 struct RustnnOperand **output);
847
854 const struct RustnnOperand *input,
855 struct RustnnOperand **output);
856
863 const struct RustnnOperand *input,
864 struct RustnnOperand **output);
865
872 const struct RustnnOperand *input,
873 struct RustnnOperand **output);
874
881 const struct RustnnOperand *input,
882 struct RustnnOperand **output);
883
890 const struct RustnnOperand *input,
891 struct RustnnOperand **output);
892
899 const struct RustnnOperand *input,
900 struct RustnnOperand **output);
901
908 const struct RustnnOperand *input,
909 struct RustnnOperand **output);
910
917 const struct RustnnOperand *input,
918 struct RustnnOperand **output);
919
926 const struct RustnnOperand *input,
927 struct RustnnOperand **output);
928
935 const struct RustnnOperand *input,
936 struct RustnnOperand **output);
937
944 const struct RustnnOperand *input,
945 struct RustnnOperand **output);
946
953 const struct RustnnOperand *input,
954 struct RustnnOperand **output);
955
962 const struct RustnnOperand *input,
963 struct RustnnOperand **output);
964
971 const struct RustnnOperand *input,
972 struct RustnnOperand **output);
973
980 const struct RustnnOperand *input,
981 struct RustnnOperand **output);
982
989 const struct RustnnOperand *input,
990 struct RustnnOperand **output);
991
998 const struct RustnnOperand *input,
999 struct RustnnOperand **output);
1000
1007 const struct RustnnOperand *input,
1008 struct RustnnOperand **output);
1009
1016 const struct RustnnOperand *lhs,
1017 const struct RustnnOperand *rhs,
1018 const struct RustnnOperatorOptions *options,
1019 struct RustnnOperand **output);
1020
1027 const struct RustnnOperand *lhs,
1028 const struct RustnnOperand *rhs,
1029 const struct RustnnOperatorOptions *options,
1030 struct RustnnOperand **output);
1031
1038 const struct RustnnOperand *lhs,
1039 const struct RustnnOperand *rhs,
1040 const struct RustnnOperatorOptions *options,
1041 struct RustnnOperand **output);
1042
1049 const struct RustnnOperand *lhs,
1050 const struct RustnnOperand *rhs,
1051 const struct RustnnOperatorOptions *options,
1052 struct RustnnOperand **output);
1053
1060 const struct RustnnOperand *lhs,
1061 const struct RustnnOperand *rhs,
1062 const struct RustnnOperatorOptions *options,
1063 struct RustnnOperand **output);
1064
1071 const struct RustnnOperand *lhs,
1072 const struct RustnnOperand *rhs,
1073 const struct RustnnOperatorOptions *options,
1074 struct RustnnOperand **output);
1075
1082 const struct RustnnOperand *lhs,
1083 const struct RustnnOperand *rhs,
1084 const struct RustnnOperatorOptions *options,
1085 struct RustnnOperand **output);
1086
1093 const struct RustnnOperand *lhs,
1094 const struct RustnnOperand *rhs,
1095 const struct RustnnOperatorOptions *options,
1096 struct RustnnOperand **output);
1097
1104 const struct RustnnOperand *lhs,
1105 const struct RustnnOperand *rhs,
1106 const struct RustnnOperatorOptions *options,
1107 struct RustnnOperand **output);
1108
1115 const struct RustnnOperand *lhs,
1116 const struct RustnnOperand *rhs,
1117 const struct RustnnOperatorOptions *options,
1118 struct RustnnOperand **output);
1119
1126 const struct RustnnOperand *lhs,
1127 const struct RustnnOperand *rhs,
1128 const struct RustnnOperatorOptions *options,
1129 struct RustnnOperand **output);
1130
1137 const struct RustnnOperand *lhs,
1138 const struct RustnnOperand *rhs,
1139 const struct RustnnOperatorOptions *options,
1140 struct RustnnOperand **output);
1141
1148 const struct RustnnOperand *lhs,
1149 const struct RustnnOperand *rhs,
1150 const struct RustnnOperatorOptions *options,
1151 struct RustnnOperand **output);
1152
1159 const struct RustnnOperand *lhs,
1160 const struct RustnnOperand *rhs,
1161 const struct RustnnOperatorOptions *options,
1162 struct RustnnOperand **output);
1163
1170 const struct RustnnOperand *lhs,
1171 const struct RustnnOperand *rhs,
1172 const struct RustnnOperatorOptions *options,
1173 struct RustnnOperand **output);
1174
1181 const struct RustnnOperand *lhs,
1182 const struct RustnnOperand *rhs,
1183 const struct RustnnOperatorOptions *options,
1184 struct RustnnOperand **output);
1185
1192 const struct RustnnOperand *lhs,
1193 const struct RustnnOperand *rhs,
1194 const struct RustnnOperatorOptions *options,
1195 struct RustnnOperand **output);
1196
1203 const struct RustnnOperand *input,
1204 const struct RustnnOperatorOptions *options,
1205 struct RustnnOperand **output);
1206
1213 const struct RustnnOperand *input,
1214 const struct RustnnOperatorOptions *options,
1215 struct RustnnOperand **output);
1216
1223 const struct RustnnOperand *input,
1224 const struct RustnnOperatorOptions *options,
1225 struct RustnnOperand **output);
1226
1233 const struct RustnnOperand *input,
1234 const struct RustnnOperatorOptions *options,
1235 struct RustnnOperand **output);
1236
1243 const struct RustnnOperand *input,
1244 const struct RustnnOperatorOptions *options,
1245 struct RustnnOperand **output);
1246
1253 const struct RustnnOperand *input,
1254 const struct RustnnOperatorOptions *options,
1255 struct RustnnOperand **output);
1256
1263 const struct RustnnOperand *input,
1264 const struct RustnnOperatorOptions *options,
1265 struct RustnnOperand **output);
1266
1273 const struct RustnnOperand *input,
1274 const struct RustnnOperatorOptions *options,
1275 struct RustnnOperand **output);
1276
1283 const struct RustnnOperand *input,
1284 const struct RustnnOperatorOptions *options,
1285 struct RustnnOperand **output);
1286
1293 const struct RustnnOperand *input,
1294 const struct RustnnOperatorOptions *options,
1295 struct RustnnOperand **output);
1296
1303 const struct RustnnOperand *input,
1304 const struct RustnnOperatorOptions *options,
1305 struct RustnnOperand **output);
1306
1313 const struct RustnnOperand *input,
1314 const struct RustnnOperatorOptions *options,
1315 struct RustnnOperand **output);
1316
1323 const struct RustnnOperand *input,
1324 const struct RustnnOperatorOptions *options,
1325 struct RustnnOperand **output);
1326
1333 const struct RustnnOperand *input,
1334 const struct RustnnOperatorOptions *options,
1335 struct RustnnOperand **output);
1336
1343 const struct RustnnOperand *input,
1344 const struct RustnnOperatorOptions *options,
1345 struct RustnnOperand **output);
1346
1353 const struct RustnnOperand *input,
1354 const struct RustnnOperatorOptions *options,
1355 struct RustnnOperand **output);
1356
1363 const struct RustnnOperand *input,
1364 const struct RustnnOperatorOptions *options,
1365 struct RustnnOperand **output);
1366
1373 const struct RustnnOperand *input,
1374 const struct RustnnOperatorOptions *options,
1375 struct RustnnOperand **output);
1376
1383 const struct RustnnOperand *input,
1384 const struct RustnnOperatorOptions *options,
1385 struct RustnnOperand **output);
1386
1393 const struct RustnnOperand *input,
1394 const struct RustnnOperatorOptions *options,
1395 struct RustnnOperand **output);
1396
1403 const struct RustnnOperand *input,
1404 const struct RustnnOperatorOptions *options,
1405 struct RustnnOperand **output);
1406
1413 const struct RustnnOperand *input,
1414 const struct RustnnOperatorOptions *options,
1415 struct RustnnOperand **output);
1416
1423 const struct RustnnOperand *input,
1424 const struct RustnnOperatorOptions *options,
1425 struct RustnnOperand **output);
1426
1433 const struct RustnnOperand *input,
1434 const struct RustnnOperatorOptions *options,
1435 struct RustnnOperand **output);
1436
1443 const struct RustnnOperand *input,
1444 const struct RustnnOperatorOptions *options,
1445 struct RustnnOperand **output);
1446
1453 const struct RustnnOperand *input,
1454 struct RustnnOperand **output);
1455
1462 const struct RustnnOperand *input,
1463 struct RustnnOperand **output);
1464
1471 const struct RustnnOperand *input,
1472 struct RustnnOperand **output);
1473
1480 const struct RustnnOperand *input,
1481 struct RustnnOperand **output);
1482
1489 const struct RustnnOperand *input,
1490 struct RustnnOperand **output);
1491
1498 const struct RustnnOperand *input,
1499 struct RustnnOperand **output);
1500
1507 const struct RustnnOperand *input,
1508 struct RustnnOperand **output);
1509
1516 const struct RustnnOperand *input,
1517 struct RustnnOperand **output);
1518
1525 const struct RustnnOperand *input,
1526 struct RustnnOperand **output);
1527
1534 const struct RustnnOperand *input,
1535 struct RustnnOperand **output);
1536
1543 const struct RustnnOperand *input,
1544 struct RustnnOperand **output);
1545
1552 const struct RustnnOperand *input,
1553 struct RustnnOperand **output);
1554
1561 const struct RustnnOperand *input,
1562 struct RustnnOperand **output);
1563
1570 const struct RustnnOperand *input,
1571 struct RustnnOperand **output);
1572
1579 const struct RustnnOperand *input,
1580 struct RustnnOperand **output);
1581
1588 const struct RustnnOperand *input,
1589 struct RustnnOperand **output);
1590
1597 const struct RustnnOperand *input,
1598 struct RustnnOperand **output);
1599
1606 const struct RustnnOperand *input,
1607 struct RustnnOperand **output);
1608
1615 const struct RustnnOperand *input,
1616 struct RustnnOperand **output);
1617
1624 const struct RustnnOperand *input,
1625 struct RustnnOperand **output);
1626
1633 const struct RustnnOperand *input,
1634 struct RustnnOperand **output);
1635
1642 const struct RustnnOperand *input,
1643 struct RustnnOperand **output);
1644
1651 const struct RustnnOperand *input,
1652 struct RustnnOperand **output);
1653
1660 const struct RustnnOperand *input,
1661 struct RustnnOperand **output);
1662
1669 const struct RustnnOperand *input,
1670 struct RustnnOperand **output);
1671
1678 const struct RustnnOperand *input,
1679 struct RustnnOperand **output);
1680
1687 const struct RustnnOperand *input,
1688 struct RustnnOperand **output);
1689
1696 const struct RustnnOperand *lhs,
1697 const struct RustnnOperand *rhs,
1698 struct RustnnOperand **output);
1699
1706 const struct RustnnOperand *lhs,
1707 const struct RustnnOperand *rhs,
1708 struct RustnnOperand **output);
1709
1716 const struct RustnnOperand *lhs,
1717 const struct RustnnOperand *rhs,
1718 struct RustnnOperand **output);
1719
1726 const struct RustnnOperand *lhs,
1727 const struct RustnnOperand *rhs,
1728 struct RustnnOperand **output);
1729
1736 const struct RustnnOperand *lhs,
1737 const struct RustnnOperand *rhs,
1738 struct RustnnOperand **output);
1739
1746 const struct RustnnOperand *lhs,
1747 const struct RustnnOperand *rhs,
1748 struct RustnnOperand **output);
1749
1756 const struct RustnnOperand *lhs,
1757 const struct RustnnOperand *rhs,
1758 struct RustnnOperand **output);
1759
1766 const struct RustnnOperand *first,
1767 const struct RustnnOperand *second,
1768 const struct RustnnOperand *third,
1769 struct RustnnOperand **output);
1770
1777 const struct RustnnOperand *first,
1778 const struct RustnnOperand *second,
1779 const struct RustnnOperand *third,
1780 struct RustnnOperand **output);
1781
1788 const struct RustnnOperand *first,
1789 const struct RustnnOperand *second,
1790 const struct RustnnOperand *third,
1791 struct RustnnOperand **output);
1792
1799 const struct RustnnOperand *first,
1800 const struct RustnnOperand *second,
1801 const struct RustnnOperand *third,
1802 struct RustnnOperand **output);
1803
1810 const struct RustnnOperand *input,
1811 uint32_t axis,
1812 struct RustnnOperand **output);
1813
1820 const struct RustnnOperand *input,
1821 uint32_t axis,
1822 struct RustnnOperand **output);
1823
1830 const struct RustnnOperand *input,
1831 enum RustnnDataType data_type,
1832 struct RustnnOperand **output);
1833
1840 const struct RustnnOperand *input,
1841 uint32_t axis,
1842 struct RustnnOperand **output);
1843
1850 const struct RustnnOperand *input,
1851 uint32_t axis,
1852 struct RustnnOperand **output);
1853
1860 const struct RustnnOperand *input,
1861 const uint32_t *new_shape,
1862 uintptr_t new_shape_len,
1863 struct RustnnOperand **output);
1864
1871 const struct RustnnOperand *input,
1872 const uint32_t *new_shape,
1873 uintptr_t new_shape_len,
1874 struct RustnnOperand **output);
1875
1882 const struct RustnnOperand *input,
1883 const uint32_t *repetitions,
1884 uintptr_t repetitions_len,
1885 struct RustnnOperand **output);
1886
1893 const struct RustnnOperand *input,
1894 const uint32_t *beginning_padding,
1895 uintptr_t beginning_padding_len,
1896 const uint32_t *ending_padding,
1897 uintptr_t ending_padding_len,
1898 struct RustnnOperand **output);
1899
1906 const struct RustnnOperand *input,
1907 const uint32_t *starts,
1908 uintptr_t starts_len,
1909 const uint32_t *sizes,
1910 uintptr_t sizes_len,
1911 struct RustnnOperand **output);
1912
1919 const struct RustnnOperand *const *inputs,
1920 uintptr_t inputs_len,
1921 uint32_t axis,
1922 struct RustnnOperand **output);
1923
1930 const struct RustnnOperand *input,
1931 const struct RustnnOperand *scale,
1932 const struct RustnnOperand *zero_point,
1933 struct RustnnOperand **output);
1934
1941 const struct RustnnOperand *input,
1942 const struct RustnnOperand *scale,
1943 const struct RustnnOperand *zero_point,
1944 struct RustnnOperand **output);
1945
1952 const struct RustnnOperand *input,
1953 const uint32_t *splits,
1954 uintptr_t splits_len,
1955 struct RustnnOperand **outputs,
1956 uintptr_t outputs_capacity,
1957 uintptr_t *outputs_len);
1958
1965 const struct RustnnOperand *input,
1966 uint32_t num_splits,
1967 struct RustnnOperand **outputs,
1968 uintptr_t outputs_capacity,
1969 uintptr_t *outputs_len);
1970
1977 const struct RustnnOperand *input,
1978 const struct RustnnOperand *weight,
1979 const struct RustnnOperand *recurrent_weight,
1980 uint32_t steps,
1981 uint32_t hidden_size,
1982 struct RustnnOperand **outputs,
1983 uintptr_t outputs_capacity,
1984 uintptr_t *outputs_len);
1985
1992 const struct RustnnOperand *input,
1993 const struct RustnnOperand *weight,
1994 const struct RustnnOperand *recurrent_weight,
1995 const struct RustnnOperand *hidden_state,
1996 uint32_t hidden_size,
1997 struct RustnnOperand **output);
1998
2005 const struct RustnnOperand *input,
2006 const struct RustnnOperand *weight,
2007 const struct RustnnOperand *recurrent_weight,
2008 uint32_t steps,
2009 uint32_t hidden_size,
2010 struct RustnnOperand **outputs,
2011 uintptr_t outputs_capacity,
2012 uintptr_t *outputs_len);
2013
2020 const struct RustnnOperand *input,
2021 const struct RustnnOperand *weight,
2022 const struct RustnnOperand *recurrent_weight,
2023 const struct RustnnOperand *hidden_state,
2024 const struct RustnnOperand *cell_state,
2025 uint32_t hidden_size,
2026 struct RustnnOperand **outputs,
2027 uintptr_t outputs_capacity,
2028 uintptr_t *outputs_len);
2029
2037 const struct RustnnNamedOperand *outputs,
2038 uintptr_t outputs_len,
2039 struct RustnnGraph **graph);
2040
2047
2054 struct RustnnGraph *graph,
2055 const struct RustnnNamedTensor *inputs,
2056 uintptr_t inputs_len,
2057 const struct RustnnNamedTensor *outputs,
2058 uintptr_t outputs_len);
2059
2066 const struct RustnnOperand *operand,
2067 uint64_t *dimensions,
2068 uintptr_t dimensions_capacity,
2069 uintptr_t *dimensions_len);
2070
2077 const struct RustnnOperand *operand,
2078 enum RustnnDataType *data_type);
2079
2084 const struct RustnnNamedOperand *outputs,
2085 uintptr_t outputs_len,
2086 char **text);
2087
2091void rustnn_string_destroy(char *value);
2092
2093#ifdef __cplusplus
2094} // extern "C"
2095#endif // __cplusplus
enum RustnnStatus rustnn_graph_builder_erf(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the erf operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_gelu(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the gelu operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_elu(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the elu operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_round_even(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the round even operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_lesser_or_equal(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the lesser or equal operation using [MLGraphBuilder].
enum RustnnStatus rustnn_context_dispatch(struct RustnnContext *context, struct RustnnGraph *graph, const struct RustnnNamedTensor *inputs, uintptr_t inputs_len, const struct RustnnNamedTensor *outputs, uintptr_t outputs_len)
Run an [MLGraph] through [MLContext] with named input and output tensors.
void rustnn_operand_destroy(struct RustnnOperand *operand)
Release an [MLOperand] handle.
enum RustnnStatus rustnn_graph_builder_constant(struct RustnnGraphBuilder *builder, const struct RustnnOperandDescriptor *descriptor, const void *data, uintptr_t data_len, struct RustnnOperand **output)
Create a constant [MLOperand] from descriptor and bytes on [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_is_infinite(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the is infinite operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_subtract_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the subtract operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_concat(struct RustnnGraphBuilder *builder, const struct RustnnOperand *const *inputs, uintptr_t inputs_len, uint32_t axis, struct RustnnOperand **output)
Apply the concat operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_add(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the add operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_sqrt(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the sqrt operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_max_pool2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the max pool2d operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_softsign_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the softsign operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_operand_data_type(struct RustnnGraphBuilder *builder, const struct RustnnOperand *operand, enum RustnnDataType *data_type)
Read an [MLOperand] data type from [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_reduce_l1(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce l1 operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_softsign(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the softsign operation using [MLGraphBuilder].
const char * rustnn_last_error_message(void)
Return the last C API error message for this thread.
enum RustnnStatus rustnn_graph_builder_matmul(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the matmul operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_binary(struct RustnnGraphBuilder *builder, enum RustnnBinaryOperation operation, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply a selected binary operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_log(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the log operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_tan_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the tan operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_gelu_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the gelu operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_sin(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the sin operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_ceil_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the ceil operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_shape_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the shape operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_layer_normalization(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the layer normalization operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_negate(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the negate operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_tanh_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the tanh operation using [MLGraphBuilder] with a label.
void rustnn_graph_destroy(struct RustnnGraph *graph)
Release an [MLGraph] handle.
void rustnn_operand_descriptor_destroy(struct RustnnOperandDescriptor *descriptor)
Release an [MLOperandDescriptor] handle.
enum RustnnStatus rustnn_graph_builder_floor(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the floor operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_greater_or_equal_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the greater or equal operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_greater_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the greater operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_cos_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the cos operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_logical_or_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the logical or operation using [MLGraphBuilder] with a label.
struct RustnnOperandDescriptor RustnnOperandDescriptor
Opaque handle wrapping [MLOperandDescriptor].
Definition rustnn.h:256
enum RustnnStatus rustnn_graph_builder_gru_cell(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *weight, const struct RustnnOperand *recurrent_weight, const struct RustnnOperand *hidden_state, uint32_t hidden_size, struct RustnnOperand **output)
Apply the gru cell operation using [MLGraphBuilder].
RustnnBinaryOperation
Implementation detail of the C++ API.
Definition rustnn.h:186
@ RustnnBinaryOperation_Equal
Definition rustnn.h:194
@ RustnnBinaryOperation_GatherNd
Definition rustnn.h:209
@ RustnnBinaryOperation_Mul
Definition rustnn.h:189
@ RustnnBinaryOperation_ConvTranspose2d
Definition rustnn.h:206
@ RustnnBinaryOperation_Min
Definition rustnn.h:193
@ RustnnBinaryOperation_Gather
Definition rustnn.h:207
@ RustnnBinaryOperation_LogicalXor
Definition rustnn.h:202
@ RustnnBinaryOperation_Sub
Definition rustnn.h:188
@ RustnnBinaryOperation_GatherElements
Definition rustnn.h:208
@ RustnnBinaryOperation_NotEqual
Definition rustnn.h:199
@ RustnnBinaryOperation_Conv2d
Definition rustnn.h:205
@ RustnnBinaryOperation_Prelu
Definition rustnn.h:210
@ RustnnBinaryOperation_Pow
Definition rustnn.h:191
@ RustnnBinaryOperation_GreaterOrEqual
Definition rustnn.h:196
@ RustnnBinaryOperation_Div
Definition rustnn.h:190
@ RustnnBinaryOperation_Gemm
Definition rustnn.h:204
@ RustnnBinaryOperation_LogicalAnd
Definition rustnn.h:200
@ RustnnBinaryOperation_LesserOrEqual
Definition rustnn.h:198
@ RustnnBinaryOperation_Lesser
Definition rustnn.h:197
@ RustnnBinaryOperation_Max
Definition rustnn.h:192
@ RustnnBinaryOperation_Greater
Definition rustnn.h:195
@ RustnnBinaryOperation_LogicalOr
Definition rustnn.h:201
@ RustnnBinaryOperation_Add
Definition rustnn.h:187
@ RustnnBinaryOperation_Matmul
Definition rustnn.h:203
RustnnDataType
C representation of [MLOperandDataType].
Definition rustnn.h:43
@ RustnnDataType_Uint4
Definition rustnn.h:53
@ RustnnDataType_Uint32
Definition rustnn.h:47
@ RustnnDataType_Float32
Definition rustnn.h:44
@ RustnnDataType_Int4
Definition rustnn.h:52
@ RustnnDataType_Int8
Definition rustnn.h:50
@ RustnnDataType_Uint8
Definition rustnn.h:51
@ RustnnDataType_Uint64
Definition rustnn.h:49
@ RustnnDataType_Int64
Definition rustnn.h:48
@ RustnnDataType_Float16
Definition rustnn.h:45
@ RustnnDataType_Int32
Definition rustnn.h:46
enum RustnnStatus rustnn_graph_builder_batch_normalization(struct RustnnGraphBuilder *builder, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
Apply the batch normalization operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_shape(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the shape operation using [MLGraphBuilder].
struct RustnnOperand RustnnOperand
Opaque handle wrapping [MLOperand].
Definition rustnn.h:249
struct RustnnGraphBuilder RustnnGraphBuilder
Opaque handle wrapping [MLGraphBuilder].
Definition rustnn.h:242
enum RustnnStatus rustnn_graph_builder_unary(struct RustnnGraphBuilder *builder, enum RustnnUnaryOperation operation, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply a selected unary operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_is_nan(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the is nan operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_sqrt_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the sqrt operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_power(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the power operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_is_nan_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the is nan operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_minimum(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the minimum operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_sign(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the sign operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_webnn_text(const struct RustnnGraphBuilder *builder, const struct RustnnNamedOperand *outputs, uintptr_t outputs_len, char **text)
Serialize [MLGraphBuilder] output operands as rustnn WebNN text.
RustnnBackend
Backend hint for [MLContextOptions], wrapping [Backend].
Definition rustnn.h:80
@ RustnnBackend_Automatic
Select a backend automatically.
Definition rustnn.h:84
@ RustnnBackend_Litert
Use LiteRT.
Definition rustnn.h:100
@ RustnnBackend_Cann
Use CANN.
Definition rustnn.h:104
@ RustnnBackend_Onnx
Use ONNX Runtime.
Definition rustnn.h:88
@ RustnnBackend_Coreml
Use CoreML.
Definition rustnn.h:96
@ RustnnBackend_Trtx
Use TensorRT-RTX.
Definition rustnn.h:92
enum RustnnStatus rustnn_graph_builder_ceil(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the ceil operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_cos(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the cos operation using [MLGraphBuilder].
struct RustnnTensor RustnnTensor
Opaque handle wrapping [MLTensor].
Definition rustnn.h:263
enum RustnnStatus rustnn_graph_builder_squeeze(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the squeeze operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_conv_transpose2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the conv transpose2d operation using [MLGraphBuilder].
enum RustnnStatus rustnn_operand_descriptor_create(enum RustnnDataType data_type, const uint64_t *shape, uintptr_t shape_len, struct RustnnOperandDescriptor **output)
Allocate an [MLOperandDescriptor] from a data type and shape.
enum RustnnStatus rustnn_graph_builder_softmax(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t axis, struct RustnnOperand **output)
Apply the softmax operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_exp_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the exp operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_build(struct RustnnGraphBuilder **builder, const struct RustnnNamedOperand *outputs, uintptr_t outputs_len, struct RustnnGraph **graph)
Compile a runtime-backed [MLGraphBuilder] into an [MLGraph] and consume it, setting builder to null.
enum RustnnStatus rustnn_graph_builder_clamp(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the clamp operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_split_equal(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t num_splits, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
Apply the split equal operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_multiply(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the multiply operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_hard_sigmoid(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the hard sigmoid operation using [MLGraphBuilder].
struct RustnnContext RustnnContext
Opaque handle wrapping [MLContext].
Definition rustnn.h:228
enum RustnnStatus rustnn_graph_builder_subtract(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the subtract operation using [MLGraphBuilder].
void rustnn_tensor_destroy(struct RustnnTensor *tensor)
Release an [MLTensor] handle.
enum RustnnStatus rustnn_graph_builder_expand(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *new_shape, uintptr_t new_shape_len, struct RustnnOperand **output)
Apply the expand operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_abs_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the abs operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_conv2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the conv2d operation using [MLGraphBuilder].
RustnnDeviceType
C representation of [DeviceType] for a [BackendDevice] hint.
Definition rustnn.h:110
@ RustnnDeviceType_Npu
NPU device.
Definition rustnn.h:122
@ RustnnDeviceType_Gpu
GPU device.
Definition rustnn.h:118
@ RustnnDeviceType_Cpu
CPU device.
Definition rustnn.h:114
enum RustnnStatus rustnn_graph_builder_sigmoid(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the sigmoid operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_transpose(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the transpose operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_reciprocal_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the reciprocal operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_floor_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the floor operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_softplus(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the softplus operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_reduce_mean(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce mean operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_gather_elements(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the gather elements operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_quantize_linear(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *scale, const struct RustnnOperand *zero_point, struct RustnnOperand **output)
Apply the quantize linear operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_leaky_relu(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the leaky relu operation using [MLGraphBuilder].
enum RustnnStatus rustnn_context_create(const struct RustnnContextOptions *options, struct RustnnContext **output)
Create an [MLContext].
enum RustnnStatus rustnn_graph_builder_reduce_max(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce max operation using [MLGraphBuilder].
struct RustnnTensorDescriptor RustnnTensorDescriptor
Opaque handle wrapping [MLTensorDescriptor].
Definition rustnn.h:270
enum RustnnStatus rustnn_graph_builder_reshape(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *new_shape, uintptr_t new_shape_len, struct RustnnOperand **output)
Apply the reshape operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_reduce_min(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce min operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_slice(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *starts, uintptr_t starts_len, const uint32_t *sizes, uintptr_t sizes_len, struct RustnnOperand **output)
Apply the slice operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_lesser_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the lesser operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_logical_xor_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the logical xor operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_erf_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the erf operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_identity_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the identity operation using [MLGraphBuilder] with a label.
void rustnn_tensor_descriptor_destroy(struct RustnnTensorDescriptor *descriptor)
Release an [MLTensorDescriptor] handle.
enum RustnnStatus rustnn_graph_builder_maximum_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the maximum operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_scatter_elements(struct RustnnGraphBuilder *builder, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
Apply the scatter elements operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_unary_with_options(struct RustnnGraphBuilder *builder, enum RustnnUnaryOperation operation, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Implementation detail of the C++ API.
enum RustnnStatus rustnn_graph_builder_softplus_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the softplus operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_reduce_log_sum(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce log sum operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_ternary(struct RustnnGraphBuilder *builder, enum RustnnTernaryOperation operation, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
Apply a selected ternary operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_divide(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the divide operation using [MLGraphBuilder].
enum RustnnStatus rustnn_tensor_descriptor_create(enum RustnnDataType data_type, const uint64_t *shape, uintptr_t shape_len, bool readable, bool writable, struct RustnnTensorDescriptor **output)
Allocate an [MLTensorDescriptor].
enum RustnnStatus rustnn_graph_builder_input(struct RustnnGraphBuilder *builder, const char *name, const struct RustnnOperandDescriptor *descriptor, struct RustnnOperand **output)
Declare a named input [MLOperand] on [MLGraphBuilder].
RustnnUnaryOperation
Implementation detail of the C++ API.
Definition rustnn.h:128
@ RustnnUnaryOperation_Log
Definition rustnn.h:136
@ RustnnUnaryOperation_Tan
Definition rustnn.h:142
@ RustnnUnaryOperation_IsNan
Definition rustnn.h:151
@ RustnnUnaryOperation_LogicalNot
Definition rustnn.h:147
@ RustnnUnaryOperation_IsInfinite
Definition rustnn.h:152
@ RustnnUnaryOperation_AveragePool2d
Definition rustnn.h:165
@ RustnnUnaryOperation_ReduceLogSum
Definition rustnn.h:175
@ RustnnUnaryOperation_Sqrt
Definition rustnn.h:141
@ RustnnUnaryOperation_ReduceSum
Definition rustnn.h:168
@ RustnnUnaryOperation_Relu
Definition rustnn.h:138
@ RustnnUnaryOperation_HardSigmoid
Definition rustnn.h:155
@ RustnnUnaryOperation_ReduceMax
Definition rustnn.h:170
@ RustnnUnaryOperation_Exp
Definition rustnn.h:133
@ RustnnUnaryOperation_HardSwish
Definition rustnn.h:156
@ RustnnUnaryOperation_Tanh
Definition rustnn.h:143
@ RustnnUnaryOperation_Sigmoid
Definition rustnn.h:139
@ RustnnUnaryOperation_Sign
Definition rustnn.h:146
@ RustnnUnaryOperation_Erf
Definition rustnn.h:144
@ RustnnUnaryOperation_Neg
Definition rustnn.h:137
@ RustnnUnaryOperation_ReduceL1
Definition rustnn.h:173
@ RustnnUnaryOperation_Cos
Definition rustnn.h:132
@ RustnnUnaryOperation_MaxPool2d
Definition rustnn.h:166
@ RustnnUnaryOperation_Triangular
Definition rustnn.h:164
@ RustnnUnaryOperation_InstanceNormalization
Definition rustnn.h:160
@ RustnnUnaryOperation_Reverse
Definition rustnn.h:163
@ RustnnUnaryOperation_Squeeze
Definition rustnn.h:179
@ RustnnUnaryOperation_Floor
Definition rustnn.h:134
@ RustnnUnaryOperation_Softplus
Definition rustnn.h:149
@ RustnnUnaryOperation_ReduceMin
Definition rustnn.h:171
@ RustnnUnaryOperation_ReduceLogSumExp
Definition rustnn.h:176
@ RustnnUnaryOperation_Ceil
Definition rustnn.h:131
@ RustnnUnaryOperation_Clamp
Definition rustnn.h:159
@ RustnnUnaryOperation_Reciprocal
Definition rustnn.h:145
@ RustnnUnaryOperation_Softsign
Definition rustnn.h:150
@ RustnnUnaryOperation_Unsqueeze
Definition rustnn.h:180
@ RustnnUnaryOperation_ReduceSumSquare
Definition rustnn.h:177
@ RustnnUnaryOperation_Shape
Definition rustnn.h:153
@ RustnnUnaryOperation_Linear
Definition rustnn.h:158
@ RustnnUnaryOperation_Sin
Definition rustnn.h:140
@ RustnnUnaryOperation_Identity
Definition rustnn.h:148
@ RustnnUnaryOperation_Abs
Definition rustnn.h:129
@ RustnnUnaryOperation_ReduceL2
Definition rustnn.h:174
@ RustnnUnaryOperation_Elu
Definition rustnn.h:154
@ RustnnUnaryOperation_ReduceMean
Definition rustnn.h:169
@ RustnnUnaryOperation_LayerNormalization
Definition rustnn.h:161
@ RustnnUnaryOperation_ReduceProduct
Definition rustnn.h:172
@ RustnnUnaryOperation_Gelu
Definition rustnn.h:135
@ RustnnUnaryOperation_Resample2d
Definition rustnn.h:162
@ RustnnUnaryOperation_RoundEven
Definition rustnn.h:130
@ RustnnUnaryOperation_Transpose
Definition rustnn.h:178
@ RustnnUnaryOperation_LeakyRelu
Definition rustnn.h:157
@ RustnnUnaryOperation_L2Pool2d
Definition rustnn.h:167
struct RustnnContextOptions rustnn_context_options_default(void)
Return the default [MLContextOptions].
enum RustnnStatus rustnn_graph_builder_reciprocal(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reciprocal operation using [MLGraphBuilder].
void rustnn_string_destroy(char *value)
Release a string returned by this C API.
enum RustnnStatus rustnn_graph_builder_multiply_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the multiply operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_relu(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the relu operation using [MLGraphBuilder].
enum RustnnStatus rustnn_context_create_tensor(struct RustnnContext *context, const struct RustnnTensorDescriptor *descriptor, struct RustnnTensor **output)
Allocate an [MLTensor] from an [MLTensorDescriptor].
struct RustnnGraph RustnnGraph
Opaque handle wrapping [MLGraph].
Definition rustnn.h:235
enum RustnnStatus rustnn_graph_builder_reduce_sum(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce sum operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_create_uncompiled(struct RustnnGraphBuilder **output)
Create an uncompiled [MLGraphBuilder] for graph construction and serialization.
void rustnn_init_logger(void)
Install rustnn's pretty_env_logger global logger if no logger is installed yet.
enum RustnnStatus rustnn_graph_builder_equal_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the equal operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_identity(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the identity operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_tan(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the tan operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_arg_max(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t axis, struct RustnnOperand **output)
Apply the arg max operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_logical_or(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the logical or operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_binary_with_options(struct RustnnGraphBuilder *builder, enum RustnnBinaryOperation operation, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Implementation detail of the C++ API.
enum RustnnStatus rustnn_graph_builder_sign_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the sign operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_matmul_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the matmul operation using [MLGraphBuilder] with a label.
RustnnPowerPreference
C representation of [MLPowerPreference].
Definition rustnn.h:61
@ RustnnPowerPreference_HighPerformance
Prefer high performance.
Definition rustnn.h:69
@ RustnnPowerPreference_LowPower
Prefer low power.
Definition rustnn.h:73
@ RustnnPowerPreference_Default
Use the default power preference.
Definition rustnn.h:65
enum RustnnStatus rustnn_graph_builder_logical_not(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the logical not operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_is_infinite_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the is infinite operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_gather_nd(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the gather nd operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_triangular(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the triangular operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_reduce_l2(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce l2 operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_l2_pool2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the l2 pool2d operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_round_even_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the round even operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_resample2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the resample2d operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_prelu(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the prelu operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_pad(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *beginning_padding, uintptr_t beginning_padding_len, const uint32_t *ending_padding, uintptr_t ending_padding_len, struct RustnnOperand **output)
Apply the pad operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_gru(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *weight, const struct RustnnOperand *recurrent_weight, uint32_t steps, uint32_t hidden_size, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
Apply the gru operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_hard_swish(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the hard swish operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_log_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the log operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_split(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *splits, uintptr_t splits_len, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
Apply the split operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_reverse(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reverse operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_lstm(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *weight, const struct RustnnOperand *recurrent_weight, uint32_t steps, uint32_t hidden_size, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
Apply the lstm operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_not_equal(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the not equal operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_sin_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the sin operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_gemm(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the gemm operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_relu_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the relu operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_power_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the power operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_logical_and(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the logical and operation using [MLGraphBuilder].
RustnnStatus
Result of a C API call.
Definition rustnn.h:11
@ RustnnStatus_Error
The wrapped Rust operation returned an error.
Definition rustnn.h:31
@ RustnnStatus_Success
The call completed successfully.
Definition rustnn.h:15
@ RustnnStatus_NullPointer
A required pointer was null.
Definition rustnn.h:19
@ RustnnStatus_InvalidUtf8
A supplied string was not valid UTF-8.
Definition rustnn.h:23
@ RustnnStatus_Panic
The wrapped Rust operation panicked.
Definition rustnn.h:35
@ RustnnStatus_InvalidArgument
A supplied argument was invalid.
Definition rustnn.h:27
enum RustnnStatus rustnn_graph_builder_tile(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const uint32_t *repetitions, uintptr_t repetitions_len, struct RustnnOperand **output)
Apply the tile operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_arg_min(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t axis, struct RustnnOperand **output)
Apply the arg min operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_add_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the add operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_context_read_tensor(struct RustnnContext *context, const struct RustnnTensor *tensor, void *data, uintptr_t data_len)
Copy bytes from an [MLTensor] through [MLContext].
enum RustnnStatus rustnn_graph_builder_abs(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the abs operation using [MLGraphBuilder].
void rustnn_graph_builder_destroy(struct RustnnGraphBuilder *builder)
Release an [MLGraphBuilder] handle.
enum RustnnStatus rustnn_graph_builder_instance_normalization(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the instance normalization operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_scatter_nd(struct RustnnGraphBuilder *builder, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
Apply the scatter nd operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_cumulative_sum(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, uint32_t axis, struct RustnnOperand **output)
Apply the cumulative sum operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_greater_or_equal(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the greater or equal operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_maximum(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the maximum operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_greater(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the greater operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_unsqueeze(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the unsqueeze operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_negate_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the negate operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_create(struct RustnnContext *context, struct RustnnGraphBuilder **output)
Create a runtime-backed [MLGraphBuilder] that exclusively borrows context.
enum RustnnStatus rustnn_context_write_tensor(struct RustnnContext *context, const struct RustnnTensor *tensor, const void *data, uintptr_t data_len)
Copy bytes into an [MLTensor] through [MLContext].
enum RustnnStatus rustnn_graph_builder_not_equal_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the not equal operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_lstm_cell(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *weight, const struct RustnnOperand *recurrent_weight, const struct RustnnOperand *hidden_state, const struct RustnnOperand *cell_state, uint32_t hidden_size, struct RustnnOperand **outputs, uintptr_t outputs_capacity, uintptr_t *outputs_len)
Apply the lstm cell operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_minimum_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the minimum operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_logical_and_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the logical and operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_cast(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, enum RustnnDataType data_type, struct RustnnOperand **output)
Apply the cast operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_logical_xor(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the logical xor operation using [MLGraphBuilder].
void rustnn_context_destroy(struct RustnnContext *context)
Release an [MLContext] handle.
RustnnTernaryOperation
Implementation detail of the C++ API.
Definition rustnn.h:216
@ RustnnTernaryOperation_ScatterNd
Definition rustnn.h:220
@ RustnnTernaryOperation_Where
Definition rustnn.h:218
@ RustnnTernaryOperation_ScatterElements
Definition rustnn.h:219
@ RustnnTernaryOperation_BatchNormalization
Definition rustnn.h:217
enum RustnnStatus rustnn_graph_builder_reduce_product(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce product operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_equal(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the equal operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_reduce_sum_square(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce sum square operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_operand_shape(struct RustnnGraphBuilder *builder, const struct RustnnOperand *operand, uint64_t *dimensions, uintptr_t dimensions_capacity, uintptr_t *dimensions_len)
Copy an [MLOperand] shape from [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_dequantize_linear(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperand *scale, const struct RustnnOperand *zero_point, struct RustnnOperand **output)
Apply the dequantize linear operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_logical_not_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the logical not operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_sigmoid_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the sigmoid operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_divide_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the divide operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_where(struct RustnnGraphBuilder *builder, const struct RustnnOperand *first, const struct RustnnOperand *second, const struct RustnnOperand *third, struct RustnnOperand **output)
Apply the where operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_tanh(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the tanh operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_gather(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the gather operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_lesser_or_equal_with_options(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, const struct RustnnOperatorOptions *options, struct RustnnOperand **output)
Apply the lesser or equal operation using [MLGraphBuilder] with a label.
enum RustnnStatus rustnn_graph_builder_linear(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the linear operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_lesser(struct RustnnGraphBuilder *builder, const struct RustnnOperand *lhs, const struct RustnnOperand *rhs, struct RustnnOperand **output)
Apply the lesser operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_reduce_log_sum_exp(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the reduce log sum exp operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_exp(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the exp operation using [MLGraphBuilder].
enum RustnnStatus rustnn_graph_builder_average_pool2d(struct RustnnGraphBuilder *builder, const struct RustnnOperand *input, struct RustnnOperand **output)
Apply the average pool2d operation using [MLGraphBuilder].
C representation of [BackendDevice].
Definition rustnn.h:277
uintptr_t device_index
Backend-specific device index.
Definition rustnn.h:289
enum RustnnDeviceType device_type
Device class.
Definition rustnn.h:285
enum RustnnBackend backend
Backend that owns the device.
Definition rustnn.h:281
C representation of [MLContextOptions].
Definition rustnn.h:330
bool accelerated
Whether to prefer an accelerated device.
Definition rustnn.h:338
enum RustnnBackend backend_hint
Automatic corresponds to no Rust backend hint.
Definition rustnn.h:342
struct RustnnOptions rustnn_options
Backend settings used when has_rustnn_options is true.
Definition rustnn.h:358
enum RustnnPowerPreference power_preference
WebNN power preference hint.
Definition rustnn.h:334
bool has_device_hint
Whether device_hint should override automatic device selection.
Definition rustnn.h:346
bool has_rustnn_options
Whether rustnn_options should replace the Rust defaults.
Definition rustnn.h:354
struct RustnnBackendDevice device_hint
Exact device to use when has_device_hint is true.
Definition rustnn.h:350
Name and operand pair used to form [MLNamedOperands].
Definition rustnn.h:379
const struct RustnnOperand * operand
Borrowed operand handle.
Definition rustnn.h:387
const char * name
Null-terminated UTF-8 operand name.
Definition rustnn.h:383
Name and tensor pair used to form [MLNamedTensors].
Definition rustnn.h:395
const struct RustnnTensor * tensor
Borrowed tensor handle.
Definition rustnn.h:403
const char * name
Null-terminated UTF-8 tensor name.
Definition rustnn.h:399
C representation of [MLOperatorOptions] shared by the operations exposed by this ABI.
Definition rustnn.h:367
const char * label
Optional null-terminated UTF-8 label.
Definition rustnn.h:371
C representation of [RustNNOptions].
Definition rustnn.h:318
struct RustnnTrtxOptions trtx
TensorRT-RTX backend settings.
Definition rustnn.h:322
C representation of [TrtxOptions].
Definition rustnn.h:295
bool cuda_graphs
Enable CUDA graph execution.
Definition rustnn.h:311
bool fail_on_cache_miss
Fail if a compiled engine is absent from the cache.
Definition rustnn.h:307
bool runtime_cache
Cache runtime state.
Definition rustnn.h:303
bool engine_caching
Cache compiled engines.
Definition rustnn.h:299