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
57
77
108
126
184
214
224
231
238
245
252
259
266
273
293
315
326
362
375
381typedef struct RustnnNamedOperand {
385 const char *name;
389 const struct RustnnOperand *operand;
391
397typedef struct RustnnNamedTensor {
401 const char *name;
405 const struct RustnnTensor *tensor;
407
408#ifdef __cplusplus
409extern "C" {
410#endif // __cplusplus
411
416
426
433 const uint64_t *shape,
434 uintptr_t shape_len,
435 struct RustnnOperandDescriptor **output);
436
443
450 const uint64_t *shape,
451 uintptr_t shape_len,
452 bool readable,
453 bool writable,
454 struct RustnnTensorDescriptor **output);
455
462
469
476 struct RustnnContext **output);
477
484
491 const struct RustnnTensorDescriptor *descriptor,
492 struct RustnnTensor **output);
493
500
507 const struct RustnnTensor *tensor,
508 const void *data,
509 uintptr_t data_len);
510
517 const struct RustnnTensor *tensor,
518 void *data,
519 uintptr_t data_len);
520
525
534 struct RustnnGraphBuilder **output);
535
540
545
552 const char *name,
553 const struct RustnnOperandDescriptor *descriptor,
554 struct RustnnOperand **output);
555
562 const struct RustnnOperandDescriptor *descriptor,
563 const void *data,
564 uintptr_t data_len,
565 struct RustnnOperand **output);
566
573 enum RustnnUnaryOperation operation,
574 const struct RustnnOperand *input,
575 struct RustnnOperand **output);
576
583 enum RustnnBinaryOperation operation,
584 const struct RustnnOperand *lhs,
585 const struct RustnnOperand *rhs,
586 struct RustnnOperand **output);
587
594 enum RustnnTernaryOperation operation,
595 const struct RustnnOperand *first,
596 const struct RustnnOperand *second,
597 const struct RustnnOperand *third,
598 struct RustnnOperand **output);
599
604 enum RustnnUnaryOperation operation,
605 const struct RustnnOperand *input,
606 const struct RustnnOperatorOptions *options,
607 struct RustnnOperand **output);
608
613 enum RustnnBinaryOperation operation,
614 const struct RustnnOperand *lhs,
615 const struct RustnnOperand *rhs,
616 const struct RustnnOperatorOptions *options,
617 struct RustnnOperand **output);
618
625 const struct RustnnOperand *lhs,
626 const struct RustnnOperand *rhs,
627 struct RustnnOperand **output);
628
635 const struct RustnnOperand *lhs,
636 const struct RustnnOperand *rhs,
637 struct RustnnOperand **output);
638
645 const struct RustnnOperand *lhs,
646 const struct RustnnOperand *rhs,
647 struct RustnnOperand **output);
648
655 const struct RustnnOperand *lhs,
656 const struct RustnnOperand *rhs,
657 struct RustnnOperand **output);
658
665 const struct RustnnOperand *lhs,
666 const struct RustnnOperand *rhs,
667 struct RustnnOperand **output);
668
675 const struct RustnnOperand *lhs,
676 const struct RustnnOperand *rhs,
677 struct RustnnOperand **output);
678
685 const struct RustnnOperand *lhs,
686 const struct RustnnOperand *rhs,
687 struct RustnnOperand **output);
688
695 const struct RustnnOperand *lhs,
696 const struct RustnnOperand *rhs,
697 struct RustnnOperand **output);
698
705 const struct RustnnOperand *lhs,
706 const struct RustnnOperand *rhs,
707 struct RustnnOperand **output);
708
715 const struct RustnnOperand *lhs,
716 const struct RustnnOperand *rhs,
717 struct RustnnOperand **output);
718
725 const struct RustnnOperand *lhs,
726 const struct RustnnOperand *rhs,
727 struct RustnnOperand **output);
728
735 const struct RustnnOperand *lhs,
736 const struct RustnnOperand *rhs,
737 struct RustnnOperand **output);
738
745 const struct RustnnOperand *lhs,
746 const struct RustnnOperand *rhs,
747 struct RustnnOperand **output);
748
755 const struct RustnnOperand *lhs,
756 const struct RustnnOperand *rhs,
757 struct RustnnOperand **output);
758
765 const struct RustnnOperand *lhs,
766 const struct RustnnOperand *rhs,
767 struct RustnnOperand **output);
768
775 const struct RustnnOperand *lhs,
776 const struct RustnnOperand *rhs,
777 struct RustnnOperand **output);
778
785 const struct RustnnOperand *lhs,
786 const struct RustnnOperand *rhs,
787 struct RustnnOperand **output);
788
795 const struct RustnnOperand *input,
796 struct RustnnOperand **output);
797
804 const struct RustnnOperand *input,
805 struct RustnnOperand **output);
806
813 const struct RustnnOperand *input,
814 struct RustnnOperand **output);
815
822 const struct RustnnOperand *input,
823 struct RustnnOperand **output);
824
831 const struct RustnnOperand *input,
832 struct RustnnOperand **output);
833
840 const struct RustnnOperand *input,
841 struct RustnnOperand **output);
842
849 const struct RustnnOperand *input,
850 struct RustnnOperand **output);
851
858 const struct RustnnOperand *input,
859 struct RustnnOperand **output);
860
867 const struct RustnnOperand *input,
868 struct RustnnOperand **output);
869
876 const struct RustnnOperand *input,
877 struct RustnnOperand **output);
878
885 const struct RustnnOperand *input,
886 struct RustnnOperand **output);
887
894 const struct RustnnOperand *input,
895 struct RustnnOperand **output);
896
903 const struct RustnnOperand *input,
904 struct RustnnOperand **output);
905
912 const struct RustnnOperand *input,
913 struct RustnnOperand **output);
914
921 const struct RustnnOperand *input,
922 struct RustnnOperand **output);
923
930 const struct RustnnOperand *input,
931 struct RustnnOperand **output);
932
939 const struct RustnnOperand *input,
940 struct RustnnOperand **output);
941
948 const struct RustnnOperand *input,
949 struct RustnnOperand **output);
950
957 const struct RustnnOperand *input,
958 struct RustnnOperand **output);
959
966 const struct RustnnOperand *input,
967 struct RustnnOperand **output);
968
975 const struct RustnnOperand *input,
976 struct RustnnOperand **output);
977
984 const struct RustnnOperand *input,
985 struct RustnnOperand **output);
986
993 const struct RustnnOperand *input,
994 struct RustnnOperand **output);
995
1002 const struct RustnnOperand *input,
1003 struct RustnnOperand **output);
1004
1011 const struct RustnnOperand *input,
1012 struct RustnnOperand **output);
1013
1020 const struct RustnnOperand *lhs,
1021 const struct RustnnOperand *rhs,
1022 const struct RustnnOperatorOptions *options,
1023 struct RustnnOperand **output);
1024
1031 const struct RustnnOperand *lhs,
1032 const struct RustnnOperand *rhs,
1033 const struct RustnnOperatorOptions *options,
1034 struct RustnnOperand **output);
1035
1042 const struct RustnnOperand *lhs,
1043 const struct RustnnOperand *rhs,
1044 const struct RustnnOperatorOptions *options,
1045 struct RustnnOperand **output);
1046
1053 const struct RustnnOperand *lhs,
1054 const struct RustnnOperand *rhs,
1055 const struct RustnnOperatorOptions *options,
1056 struct RustnnOperand **output);
1057
1064 const struct RustnnOperand *lhs,
1065 const struct RustnnOperand *rhs,
1066 const struct RustnnOperatorOptions *options,
1067 struct RustnnOperand **output);
1068
1075 const struct RustnnOperand *lhs,
1076 const struct RustnnOperand *rhs,
1077 const struct RustnnOperatorOptions *options,
1078 struct RustnnOperand **output);
1079
1086 const struct RustnnOperand *lhs,
1087 const struct RustnnOperand *rhs,
1088 const struct RustnnOperatorOptions *options,
1089 struct RustnnOperand **output);
1090
1097 const struct RustnnOperand *lhs,
1098 const struct RustnnOperand *rhs,
1099 const struct RustnnOperatorOptions *options,
1100 struct RustnnOperand **output);
1101
1108 const struct RustnnOperand *lhs,
1109 const struct RustnnOperand *rhs,
1110 const struct RustnnOperatorOptions *options,
1111 struct RustnnOperand **output);
1112
1119 const struct RustnnOperand *lhs,
1120 const struct RustnnOperand *rhs,
1121 const struct RustnnOperatorOptions *options,
1122 struct RustnnOperand **output);
1123
1130 const struct RustnnOperand *lhs,
1131 const struct RustnnOperand *rhs,
1132 const struct RustnnOperatorOptions *options,
1133 struct RustnnOperand **output);
1134
1141 const struct RustnnOperand *lhs,
1142 const struct RustnnOperand *rhs,
1143 const struct RustnnOperatorOptions *options,
1144 struct RustnnOperand **output);
1145
1152 const struct RustnnOperand *lhs,
1153 const struct RustnnOperand *rhs,
1154 const struct RustnnOperatorOptions *options,
1155 struct RustnnOperand **output);
1156
1163 const struct RustnnOperand *lhs,
1164 const struct RustnnOperand *rhs,
1165 const struct RustnnOperatorOptions *options,
1166 struct RustnnOperand **output);
1167
1174 const struct RustnnOperand *lhs,
1175 const struct RustnnOperand *rhs,
1176 const struct RustnnOperatorOptions *options,
1177 struct RustnnOperand **output);
1178
1185 const struct RustnnOperand *lhs,
1186 const struct RustnnOperand *rhs,
1187 const struct RustnnOperatorOptions *options,
1188 struct RustnnOperand **output);
1189
1196 const struct RustnnOperand *lhs,
1197 const struct RustnnOperand *rhs,
1198 const struct RustnnOperatorOptions *options,
1199 struct RustnnOperand **output);
1200
1207 const struct RustnnOperand *input,
1208 const struct RustnnOperatorOptions *options,
1209 struct RustnnOperand **output);
1210
1217 const struct RustnnOperand *input,
1218 const struct RustnnOperatorOptions *options,
1219 struct RustnnOperand **output);
1220
1227 const struct RustnnOperand *input,
1228 const struct RustnnOperatorOptions *options,
1229 struct RustnnOperand **output);
1230
1237 const struct RustnnOperand *input,
1238 const struct RustnnOperatorOptions *options,
1239 struct RustnnOperand **output);
1240
1247 const struct RustnnOperand *input,
1248 const struct RustnnOperatorOptions *options,
1249 struct RustnnOperand **output);
1250
1257 const struct RustnnOperand *input,
1258 const struct RustnnOperatorOptions *options,
1259 struct RustnnOperand **output);
1260
1267 const struct RustnnOperand *input,
1268 const struct RustnnOperatorOptions *options,
1269 struct RustnnOperand **output);
1270
1277 const struct RustnnOperand *input,
1278 const struct RustnnOperatorOptions *options,
1279 struct RustnnOperand **output);
1280
1287 const struct RustnnOperand *input,
1288 const struct RustnnOperatorOptions *options,
1289 struct RustnnOperand **output);
1290
1297 const struct RustnnOperand *input,
1298 const struct RustnnOperatorOptions *options,
1299 struct RustnnOperand **output);
1300
1307 const struct RustnnOperand *input,
1308 const struct RustnnOperatorOptions *options,
1309 struct RustnnOperand **output);
1310
1317 const struct RustnnOperand *input,
1318 const struct RustnnOperatorOptions *options,
1319 struct RustnnOperand **output);
1320
1327 const struct RustnnOperand *input,
1328 const struct RustnnOperatorOptions *options,
1329 struct RustnnOperand **output);
1330
1337 const struct RustnnOperand *input,
1338 const struct RustnnOperatorOptions *options,
1339 struct RustnnOperand **output);
1340
1347 const struct RustnnOperand *input,
1348 const struct RustnnOperatorOptions *options,
1349 struct RustnnOperand **output);
1350
1357 const struct RustnnOperand *input,
1358 const struct RustnnOperatorOptions *options,
1359 struct RustnnOperand **output);
1360
1367 const struct RustnnOperand *input,
1368 const struct RustnnOperatorOptions *options,
1369 struct RustnnOperand **output);
1370
1377 const struct RustnnOperand *input,
1378 const struct RustnnOperatorOptions *options,
1379 struct RustnnOperand **output);
1380
1387 const struct RustnnOperand *input,
1388 const struct RustnnOperatorOptions *options,
1389 struct RustnnOperand **output);
1390
1397 const struct RustnnOperand *input,
1398 const struct RustnnOperatorOptions *options,
1399 struct RustnnOperand **output);
1400
1407 const struct RustnnOperand *input,
1408 const struct RustnnOperatorOptions *options,
1409 struct RustnnOperand **output);
1410
1417 const struct RustnnOperand *input,
1418 const struct RustnnOperatorOptions *options,
1419 struct RustnnOperand **output);
1420
1427 const struct RustnnOperand *input,
1428 const struct RustnnOperatorOptions *options,
1429 struct RustnnOperand **output);
1430
1437 const struct RustnnOperand *input,
1438 const struct RustnnOperatorOptions *options,
1439 struct RustnnOperand **output);
1440
1447 const struct RustnnOperand *input,
1448 const struct RustnnOperatorOptions *options,
1449 struct RustnnOperand **output);
1450
1457 const struct RustnnOperand *input,
1458 struct RustnnOperand **output);
1459
1466 const struct RustnnOperand *input,
1467 struct RustnnOperand **output);
1468
1475 const struct RustnnOperand *input,
1476 struct RustnnOperand **output);
1477
1484 const struct RustnnOperand *input,
1485 struct RustnnOperand **output);
1486
1493 const struct RustnnOperand *input,
1494 struct RustnnOperand **output);
1495
1502 const struct RustnnOperand *input,
1503 struct RustnnOperand **output);
1504
1511 const struct RustnnOperand *input,
1512 struct RustnnOperand **output);
1513
1520 const struct RustnnOperand *input,
1521 struct RustnnOperand **output);
1522
1529 const struct RustnnOperand *input,
1530 struct RustnnOperand **output);
1531
1538 const struct RustnnOperand *input,
1539 struct RustnnOperand **output);
1540
1547 const struct RustnnOperand *input,
1548 struct RustnnOperand **output);
1549
1556 const struct RustnnOperand *input,
1557 struct RustnnOperand **output);
1558
1565 const struct RustnnOperand *input,
1566 struct RustnnOperand **output);
1567
1574 const struct RustnnOperand *input,
1575 struct RustnnOperand **output);
1576
1583 const struct RustnnOperand *input,
1584 struct RustnnOperand **output);
1585
1592 const struct RustnnOperand *input,
1593 struct RustnnOperand **output);
1594
1601 const struct RustnnOperand *input,
1602 struct RustnnOperand **output);
1603
1610 const struct RustnnOperand *input,
1611 struct RustnnOperand **output);
1612
1619 const struct RustnnOperand *input,
1620 struct RustnnOperand **output);
1621
1628 const struct RustnnOperand *input,
1629 struct RustnnOperand **output);
1630
1637 const struct RustnnOperand *input,
1638 struct RustnnOperand **output);
1639
1646 const struct RustnnOperand *input,
1647 struct RustnnOperand **output);
1648
1655 const struct RustnnOperand *input,
1656 struct RustnnOperand **output);
1657
1664 const struct RustnnOperand *input,
1665 struct RustnnOperand **output);
1666
1673 const struct RustnnOperand *input,
1674 struct RustnnOperand **output);
1675
1682 const struct RustnnOperand *input,
1683 struct RustnnOperand **output);
1684
1691 const struct RustnnOperand *input,
1692 struct RustnnOperand **output);
1693
1700 const struct RustnnOperand *lhs,
1701 const struct RustnnOperand *rhs,
1702 struct RustnnOperand **output);
1703
1710 const struct RustnnOperand *lhs,
1711 const struct RustnnOperand *rhs,
1712 struct RustnnOperand **output);
1713
1720 const struct RustnnOperand *lhs,
1721 const struct RustnnOperand *rhs,
1722 struct RustnnOperand **output);
1723
1730 const struct RustnnOperand *lhs,
1731 const struct RustnnOperand *rhs,
1732 struct RustnnOperand **output);
1733
1740 const struct RustnnOperand *lhs,
1741 const struct RustnnOperand *rhs,
1742 struct RustnnOperand **output);
1743
1750 const struct RustnnOperand *lhs,
1751 const struct RustnnOperand *rhs,
1752 struct RustnnOperand **output);
1753
1760 const struct RustnnOperand *lhs,
1761 const struct RustnnOperand *rhs,
1762 struct RustnnOperand **output);
1763
1770 const struct RustnnOperand *first,
1771 const struct RustnnOperand *second,
1772 const struct RustnnOperand *third,
1773 struct RustnnOperand **output);
1774
1781 const struct RustnnOperand *first,
1782 const struct RustnnOperand *second,
1783 const struct RustnnOperand *third,
1784 struct RustnnOperand **output);
1785
1792 const struct RustnnOperand *first,
1793 const struct RustnnOperand *second,
1794 const struct RustnnOperand *third,
1795 struct RustnnOperand **output);
1796
1803 const struct RustnnOperand *first,
1804 const struct RustnnOperand *second,
1805 const struct RustnnOperand *third,
1806 struct RustnnOperand **output);
1807
1814 const struct RustnnOperand *input,
1815 uint32_t axis,
1816 struct RustnnOperand **output);
1817
1824 const struct RustnnOperand *input,
1825 uint32_t axis,
1826 struct RustnnOperand **output);
1827
1834 const struct RustnnOperand *input,
1835 enum RustnnDataType data_type,
1836 struct RustnnOperand **output);
1837
1844 const struct RustnnOperand *input,
1845 uint32_t axis,
1846 struct RustnnOperand **output);
1847
1854 const struct RustnnOperand *input,
1855 uint32_t axis,
1856 struct RustnnOperand **output);
1857
1864 const struct RustnnOperand *input,
1865 const uint32_t *new_shape,
1866 uintptr_t new_shape_len,
1867 struct RustnnOperand **output);
1868
1875 const struct RustnnOperand *input,
1876 const uint32_t *new_shape,
1877 uintptr_t new_shape_len,
1878 struct RustnnOperand **output);
1879
1886 const struct RustnnOperand *input,
1887 const uint32_t *repetitions,
1888 uintptr_t repetitions_len,
1889 struct RustnnOperand **output);
1890
1897 const struct RustnnOperand *input,
1898 const uint32_t *beginning_padding,
1899 uintptr_t beginning_padding_len,
1900 const uint32_t *ending_padding,
1901 uintptr_t ending_padding_len,
1902 struct RustnnOperand **output);
1903
1910 const struct RustnnOperand *input,
1911 const uint32_t *starts,
1912 uintptr_t starts_len,
1913 const uint32_t *sizes,
1914 uintptr_t sizes_len,
1915 struct RustnnOperand **output);
1916
1923 const struct RustnnOperand *const *inputs,
1924 uintptr_t inputs_len,
1925 uint32_t axis,
1926 struct RustnnOperand **output);
1927
1934 const struct RustnnOperand *input,
1935 const struct RustnnOperand *scale,
1936 const struct RustnnOperand *zero_point,
1937 struct RustnnOperand **output);
1938
1945 const struct RustnnOperand *input,
1946 const struct RustnnOperand *scale,
1947 const struct RustnnOperand *zero_point,
1948 struct RustnnOperand **output);
1949
1956 const struct RustnnOperand *input,
1957 const uint32_t *splits,
1958 uintptr_t splits_len,
1959 struct RustnnOperand **outputs,
1960 uintptr_t outputs_capacity,
1961 uintptr_t *outputs_len);
1962
1969 const struct RustnnOperand *input,
1970 uint32_t num_splits,
1971 struct RustnnOperand **outputs,
1972 uintptr_t outputs_capacity,
1973 uintptr_t *outputs_len);
1974
1981 const struct RustnnOperand *input,
1982 const struct RustnnOperand *weight,
1983 const struct RustnnOperand *recurrent_weight,
1984 uint32_t steps,
1985 uint32_t hidden_size,
1986 struct RustnnOperand **outputs,
1987 uintptr_t outputs_capacity,
1988 uintptr_t *outputs_len);
1989
1996 const struct RustnnOperand *input,
1997 const struct RustnnOperand *weight,
1998 const struct RustnnOperand *recurrent_weight,
1999 const struct RustnnOperand *hidden_state,
2000 uint32_t hidden_size,
2001 struct RustnnOperand **output);
2002
2009 const struct RustnnOperand *input,
2010 const struct RustnnOperand *weight,
2011 const struct RustnnOperand *recurrent_weight,
2012 uint32_t steps,
2013 uint32_t hidden_size,
2014 struct RustnnOperand **outputs,
2015 uintptr_t outputs_capacity,
2016 uintptr_t *outputs_len);
2017
2024 const struct RustnnOperand *input,
2025 const struct RustnnOperand *weight,
2026 const struct RustnnOperand *recurrent_weight,
2027 const struct RustnnOperand *hidden_state,
2028 const struct RustnnOperand *cell_state,
2029 uint32_t hidden_size,
2030 struct RustnnOperand **outputs,
2031 uintptr_t outputs_capacity,
2032 uintptr_t *outputs_len);
2033
2041 const struct RustnnNamedOperand *outputs,
2042 uintptr_t outputs_len,
2043 struct RustnnGraph **graph);
2044
2051
2058 struct RustnnGraph *graph,
2059 const struct RustnnNamedTensor *inputs,
2060 uintptr_t inputs_len,
2061 const struct RustnnNamedTensor *outputs,
2062 uintptr_t outputs_len);
2063
2070 const struct RustnnOperand *operand,
2071 uint64_t *dimensions,
2072 uintptr_t dimensions_capacity,
2073 uintptr_t *dimensions_len);
2074
2081 const struct RustnnOperand *operand,
2082 enum RustnnDataType *data_type);
2083
2088 const struct RustnnNamedOperand *outputs,
2089 uintptr_t outputs_len,
2090 char **text);
2091
2095void rustnn_string_destroy(char *value);
2096
2097#ifdef __cplusplus
2098} // extern "C"
2099#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:258
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:188
@ RustnnBinaryOperation_Equal
Definition rustnn.h:196
@ RustnnBinaryOperation_GatherNd
Definition rustnn.h:211
@ RustnnBinaryOperation_Mul
Definition rustnn.h:191
@ RustnnBinaryOperation_ConvTranspose2d
Definition rustnn.h:208
@ RustnnBinaryOperation_Min
Definition rustnn.h:195
@ RustnnBinaryOperation_Gather
Definition rustnn.h:209
@ RustnnBinaryOperation_LogicalXor
Definition rustnn.h:204
@ RustnnBinaryOperation_Sub
Definition rustnn.h:190
@ RustnnBinaryOperation_GatherElements
Definition rustnn.h:210
@ RustnnBinaryOperation_NotEqual
Definition rustnn.h:201
@ RustnnBinaryOperation_Conv2d
Definition rustnn.h:207
@ RustnnBinaryOperation_Prelu
Definition rustnn.h:212
@ RustnnBinaryOperation_Pow
Definition rustnn.h:193
@ RustnnBinaryOperation_GreaterOrEqual
Definition rustnn.h:198
@ RustnnBinaryOperation_Div
Definition rustnn.h:192
@ RustnnBinaryOperation_Gemm
Definition rustnn.h:206
@ RustnnBinaryOperation_LogicalAnd
Definition rustnn.h:202
@ RustnnBinaryOperation_LesserOrEqual
Definition rustnn.h:200
@ RustnnBinaryOperation_Lesser
Definition rustnn.h:199
@ RustnnBinaryOperation_Max
Definition rustnn.h:194
@ RustnnBinaryOperation_Greater
Definition rustnn.h:197
@ RustnnBinaryOperation_LogicalOr
Definition rustnn.h:203
@ RustnnBinaryOperation_Add
Definition rustnn.h:189
@ RustnnBinaryOperation_Matmul
Definition rustnn.h:205
RustnnDataType
C representation of [MLOperandDataType].
Definition rustnn.h:43
@ RustnnDataType_Bfloat16
Definition rustnn.h:54
@ 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_Float8e4m3
Definition rustnn.h:55
@ 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:251
struct RustnnGraphBuilder RustnnGraphBuilder
Opaque handle wrapping [MLGraphBuilder].
Definition rustnn.h:244
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:82
@ RustnnBackend_Automatic
Select a backend automatically.
Definition rustnn.h:86
@ RustnnBackend_Litert
Use LiteRT.
Definition rustnn.h:102
@ RustnnBackend_Cann
Use CANN.
Definition rustnn.h:106
@ RustnnBackend_Onnx
Use ONNX Runtime.
Definition rustnn.h:90
@ RustnnBackend_Coreml
Use CoreML.
Definition rustnn.h:98
@ RustnnBackend_Trtx
Use TensorRT-RTX.
Definition rustnn.h:94
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:265
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:230
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:112
@ RustnnDeviceType_Npu
NPU device.
Definition rustnn.h:124
@ RustnnDeviceType_Gpu
GPU device.
Definition rustnn.h:120
@ RustnnDeviceType_Cpu
CPU device.
Definition rustnn.h:116
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:272
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:130
@ RustnnUnaryOperation_Log
Definition rustnn.h:138
@ RustnnUnaryOperation_Tan
Definition rustnn.h:144
@ RustnnUnaryOperation_IsNan
Definition rustnn.h:153
@ RustnnUnaryOperation_LogicalNot
Definition rustnn.h:149
@ RustnnUnaryOperation_IsInfinite
Definition rustnn.h:154
@ RustnnUnaryOperation_AveragePool2d
Definition rustnn.h:167
@ RustnnUnaryOperation_ReduceLogSum
Definition rustnn.h:177
@ RustnnUnaryOperation_Sqrt
Definition rustnn.h:143
@ RustnnUnaryOperation_ReduceSum
Definition rustnn.h:170
@ RustnnUnaryOperation_Relu
Definition rustnn.h:140
@ RustnnUnaryOperation_HardSigmoid
Definition rustnn.h:157
@ RustnnUnaryOperation_ReduceMax
Definition rustnn.h:172
@ RustnnUnaryOperation_Exp
Definition rustnn.h:135
@ RustnnUnaryOperation_HardSwish
Definition rustnn.h:158
@ RustnnUnaryOperation_Tanh
Definition rustnn.h:145
@ RustnnUnaryOperation_Sigmoid
Definition rustnn.h:141
@ RustnnUnaryOperation_Sign
Definition rustnn.h:148
@ RustnnUnaryOperation_Erf
Definition rustnn.h:146
@ RustnnUnaryOperation_Neg
Definition rustnn.h:139
@ RustnnUnaryOperation_ReduceL1
Definition rustnn.h:175
@ RustnnUnaryOperation_Cos
Definition rustnn.h:134
@ RustnnUnaryOperation_MaxPool2d
Definition rustnn.h:168
@ RustnnUnaryOperation_Triangular
Definition rustnn.h:166
@ RustnnUnaryOperation_InstanceNormalization
Definition rustnn.h:162
@ RustnnUnaryOperation_Reverse
Definition rustnn.h:165
@ RustnnUnaryOperation_Squeeze
Definition rustnn.h:181
@ RustnnUnaryOperation_Floor
Definition rustnn.h:136
@ RustnnUnaryOperation_Softplus
Definition rustnn.h:151
@ RustnnUnaryOperation_ReduceMin
Definition rustnn.h:173
@ RustnnUnaryOperation_ReduceLogSumExp
Definition rustnn.h:178
@ RustnnUnaryOperation_Ceil
Definition rustnn.h:133
@ RustnnUnaryOperation_Clamp
Definition rustnn.h:161
@ RustnnUnaryOperation_Reciprocal
Definition rustnn.h:147
@ RustnnUnaryOperation_Softsign
Definition rustnn.h:152
@ RustnnUnaryOperation_Unsqueeze
Definition rustnn.h:182
@ RustnnUnaryOperation_ReduceSumSquare
Definition rustnn.h:179
@ RustnnUnaryOperation_Shape
Definition rustnn.h:155
@ RustnnUnaryOperation_Linear
Definition rustnn.h:160
@ RustnnUnaryOperation_Sin
Definition rustnn.h:142
@ RustnnUnaryOperation_Identity
Definition rustnn.h:150
@ RustnnUnaryOperation_Abs
Definition rustnn.h:131
@ RustnnUnaryOperation_ReduceL2
Definition rustnn.h:176
@ RustnnUnaryOperation_Elu
Definition rustnn.h:156
@ RustnnUnaryOperation_ReduceMean
Definition rustnn.h:171
@ RustnnUnaryOperation_LayerNormalization
Definition rustnn.h:163
@ RustnnUnaryOperation_ReduceProduct
Definition rustnn.h:174
@ RustnnUnaryOperation_Gelu
Definition rustnn.h:137
@ RustnnUnaryOperation_Resample2d
Definition rustnn.h:164
@ RustnnUnaryOperation_RoundEven
Definition rustnn.h:132
@ RustnnUnaryOperation_Transpose
Definition rustnn.h:180
@ RustnnUnaryOperation_LeakyRelu
Definition rustnn.h:159
@ RustnnUnaryOperation_L2Pool2d
Definition rustnn.h:169
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:237
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 a tracing_subscriber global subscriber if none 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:63
@ RustnnPowerPreference_HighPerformance
Prefer high performance.
Definition rustnn.h:71
@ RustnnPowerPreference_LowPower
Prefer low power.
Definition rustnn.h:75
@ RustnnPowerPreference_Default
Use the default power preference.
Definition rustnn.h:67
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:218
@ RustnnTernaryOperation_ScatterNd
Definition rustnn.h:222
@ RustnnTernaryOperation_Where
Definition rustnn.h:220
@ RustnnTernaryOperation_ScatterElements
Definition rustnn.h:221
@ RustnnTernaryOperation_BatchNormalization
Definition rustnn.h:219
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:279
uintptr_t device_index
Backend-specific device index.
Definition rustnn.h:291
enum RustnnDeviceType device_type
Device class.
Definition rustnn.h:287
enum RustnnBackend backend
Backend that owns the device.
Definition rustnn.h:283
C representation of [MLContextOptions].
Definition rustnn.h:332
bool accelerated
Whether to prefer an accelerated device.
Definition rustnn.h:340
enum RustnnBackend backend_hint
Automatic corresponds to no Rust backend hint.
Definition rustnn.h:344
struct RustnnOptions rustnn_options
Backend settings used when has_rustnn_options is true.
Definition rustnn.h:360
enum RustnnPowerPreference power_preference
WebNN power preference hint.
Definition rustnn.h:336
bool has_device_hint
Whether device_hint should override automatic device selection.
Definition rustnn.h:348
bool has_rustnn_options
Whether rustnn_options should replace the Rust defaults.
Definition rustnn.h:356
struct RustnnBackendDevice device_hint
Exact device to use when has_device_hint is true.
Definition rustnn.h:352
Name and operand pair used to form [MLNamedOperands].
Definition rustnn.h:381
const struct RustnnOperand * operand
Borrowed operand handle.
Definition rustnn.h:389
const char * name
Null-terminated UTF-8 operand name.
Definition rustnn.h:385
Name and tensor pair used to form [MLNamedTensors].
Definition rustnn.h:397
const struct RustnnTensor * tensor
Borrowed tensor handle.
Definition rustnn.h:405
const char * name
Null-terminated UTF-8 tensor name.
Definition rustnn.h:401
C representation of [MLOperatorOptions] shared by the operations exposed by this ABI.
Definition rustnn.h:369
const char * label
Optional null-terminated UTF-8 label.
Definition rustnn.h:373
C representation of [RustNNOptions].
Definition rustnn.h:320
struct RustnnTrtxOptions trtx
TensorRT-RTX backend settings.
Definition rustnn.h:324
C representation of [TrtxOptions].
Definition rustnn.h:297
bool cuda_graphs
Enable CUDA graph execution.
Definition rustnn.h:313
bool fail_on_cache_miss
Fail if a compiled engine is absent from the cache.
Definition rustnn.h:309
bool runtime_cache
Cache runtime state.
Definition rustnn.h:305
bool engine_caching
Cache compiled engines.
Definition rustnn.h:301