1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
/* automatically generated by rust-bindgen */

#![allow(warnings)]

pub type size_t = ::std::os::raw::c_ulong;
pub type __int8_t = ::std::os::raw::c_schar;
pub type __uint8_t = ::std::os::raw::c_uchar;
pub type __int16_t = ::std::os::raw::c_short;
pub type __uint16_t = ::std::os::raw::c_ushort;
pub type __int32_t = ::std::os::raw::c_int;
pub type __uint32_t = ::std::os::raw::c_uint;
pub type __int64_t = ::std::os::raw::c_long;
pub type __uint64_t = ::std::os::raw::c_ulong;
extern "C" {
    pub fn halide_print(
        user_context: *mut ::std::os::raw::c_void,
        arg1: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn halide_default_print(
        user_context: *mut ::std::os::raw::c_void,
        arg1: *const ::std::os::raw::c_char,
    );
}
pub type halide_print_t = ::std::option::Option<
    unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: *const ::std::os::raw::c_char),
>;
extern "C" {
    pub fn halide_set_custom_print(print: halide_print_t) -> halide_print_t;
}
extern "C" {
    pub fn halide_error(
        user_context: *mut ::std::os::raw::c_void,
        arg1: *const ::std::os::raw::c_char,
    );
}
extern "C" {
    pub fn halide_default_error(
        user_context: *mut ::std::os::raw::c_void,
        arg1: *const ::std::os::raw::c_char,
    );
}
pub type halide_error_handler_t = ::std::option::Option<
    unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: *const ::std::os::raw::c_char),
>;
extern "C" {
    pub fn halide_set_error_handler(handler: halide_error_handler_t) -> halide_error_handler_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_mutex {
    pub _private: [usize; 1usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_cond {
    pub _private: [usize; 1usize],
}
extern "C" {
    pub fn halide_mutex_lock(mutex: *mut halide_mutex);
}
extern "C" {
    pub fn halide_mutex_unlock(mutex: *mut halide_mutex);
}
extern "C" {
    pub fn halide_cond_signal(cond: *mut halide_cond);
}
extern "C" {
    pub fn halide_cond_broadcast(cond: *mut halide_cond);
}
extern "C" {
    pub fn halide_cond_wait(cond: *mut halide_cond, mutex: *mut halide_mutex);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_mutex_array {
    _unused: [u8; 0],
}
extern "C" {
    pub fn halide_mutex_array_create(sz: ::std::os::raw::c_int) -> *mut halide_mutex_array;
}
extern "C" {
    pub fn halide_mutex_array_destroy(
        user_context: *mut ::std::os::raw::c_void,
        array: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn halide_mutex_array_lock(
        array: *mut halide_mutex_array,
        entry: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_mutex_array_unlock(
        array: *mut halide_mutex_array,
        entry: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
pub type halide_task_t = ::std::option::Option<
    unsafe extern "C" fn(
        user_context: *mut ::std::os::raw::c_void,
        task_number: ::std::os::raw::c_int,
        closure: *mut u8,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn halide_do_par_for(
        user_context: *mut ::std::os::raw::c_void,
        task: halide_task_t,
        min: ::std::os::raw::c_int,
        size: ::std::os::raw::c_int,
        closure: *mut u8,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_shutdown_thread_pool();
}
pub type halide_do_par_for_t = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut ::std::os::raw::c_void,
        arg2: halide_task_t,
        arg3: ::std::os::raw::c_int,
        arg4: ::std::os::raw::c_int,
        arg5: *mut u8,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn halide_set_custom_do_par_for(do_par_for: halide_do_par_for_t) -> halide_do_par_for_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_semaphore_t {
    pub _private: [u64; 2usize],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_semaphore_acquire_t {
    pub semaphore: *mut halide_semaphore_t,
    pub count: ::std::os::raw::c_int,
}
extern "C" {
    pub fn halide_semaphore_init(
        arg1: *mut halide_semaphore_t,
        n: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_semaphore_release(
        arg1: *mut halide_semaphore_t,
        n: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_semaphore_try_acquire(
        arg1: *mut halide_semaphore_t,
        n: ::std::os::raw::c_int,
    ) -> bool;
}
pub type halide_semaphore_init_t = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut halide_semaphore_t,
        arg2: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int,
>;
pub type halide_semaphore_release_t = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut halide_semaphore_t,
        arg2: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int,
>;
pub type halide_semaphore_try_acquire_t = ::std::option::Option<
    unsafe extern "C" fn(arg1: *mut halide_semaphore_t, arg2: ::std::os::raw::c_int) -> bool,
>;
pub type halide_loop_task_t = ::std::option::Option<
    unsafe extern "C" fn(
        user_context: *mut ::std::os::raw::c_void,
        min: ::std::os::raw::c_int,
        extent: ::std::os::raw::c_int,
        closure: *mut u8,
        task_parent: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_parallel_task_t {
    pub fn_: halide_loop_task_t,
    pub closure: *mut u8,
    pub name: *const ::std::os::raw::c_char,
    pub semaphores: *mut halide_semaphore_acquire_t,
    pub num_semaphores: ::std::os::raw::c_int,
    pub min: ::std::os::raw::c_int,
    pub extent: ::std::os::raw::c_int,
    pub min_threads: ::std::os::raw::c_int,
    pub serial: bool,
}
extern "C" {
    pub fn halide_do_parallel_tasks(
        user_context: *mut ::std::os::raw::c_void,
        num_tasks: ::std::os::raw::c_int,
        tasks: *mut halide_parallel_task_t,
        task_parent: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
pub type halide_do_task_t = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut ::std::os::raw::c_void,
        arg2: halide_task_t,
        arg3: ::std::os::raw::c_int,
        arg4: *mut u8,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn halide_set_custom_do_task(do_task: halide_do_task_t) -> halide_do_task_t;
}
extern "C" {
    pub fn halide_do_task(
        user_context: *mut ::std::os::raw::c_void,
        f: halide_task_t,
        idx: ::std::os::raw::c_int,
        closure: *mut u8,
    ) -> ::std::os::raw::c_int;
}
pub type halide_do_loop_task_t = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut ::std::os::raw::c_void,
        arg2: halide_loop_task_t,
        arg3: ::std::os::raw::c_int,
        arg4: ::std::os::raw::c_int,
        arg5: *mut u8,
        arg6: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn halide_set_custom_do_loop_task(do_task: halide_do_loop_task_t) -> halide_do_loop_task_t;
}
extern "C" {
    pub fn halide_do_loop_task(
        user_context: *mut ::std::os::raw::c_void,
        f: halide_loop_task_t,
        min: ::std::os::raw::c_int,
        extent: ::std::os::raw::c_int,
        closure: *mut u8,
        task_parent: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
pub type halide_do_parallel_tasks_t = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut ::std::os::raw::c_void,
        arg2: ::std::os::raw::c_int,
        arg3: *mut halide_parallel_task_t,
        task_parent: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn halide_set_custom_parallel_runtime(
        arg1: halide_do_par_for_t,
        arg2: halide_do_task_t,
        arg3: halide_do_loop_task_t,
        arg4: halide_do_parallel_tasks_t,
        arg5: halide_semaphore_init_t,
        arg6: halide_semaphore_try_acquire_t,
        arg7: halide_semaphore_release_t,
    );
}
extern "C" {
    pub fn halide_default_do_par_for(
        user_context: *mut ::std::os::raw::c_void,
        task: halide_task_t,
        min: ::std::os::raw::c_int,
        size: ::std::os::raw::c_int,
        closure: *mut u8,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_default_do_parallel_tasks(
        user_context: *mut ::std::os::raw::c_void,
        num_tasks: ::std::os::raw::c_int,
        tasks: *mut halide_parallel_task_t,
        task_parent: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_default_do_task(
        user_context: *mut ::std::os::raw::c_void,
        f: halide_task_t,
        idx: ::std::os::raw::c_int,
        closure: *mut u8,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_default_do_loop_task(
        user_context: *mut ::std::os::raw::c_void,
        f: halide_loop_task_t,
        min: ::std::os::raw::c_int,
        extent: ::std::os::raw::c_int,
        closure: *mut u8,
        task_parent: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_default_semaphore_init(
        arg1: *mut halide_semaphore_t,
        n: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_default_semaphore_release(
        arg1: *mut halide_semaphore_t,
        n: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_default_semaphore_try_acquire(
        arg1: *mut halide_semaphore_t,
        n: ::std::os::raw::c_int,
    ) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_thread {
    _unused: [u8; 0],
}
extern "C" {
    pub fn halide_spawn_thread(
        f: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
        closure: *mut ::std::os::raw::c_void,
    ) -> *mut halide_thread;
}
extern "C" {
    pub fn halide_join_thread(arg1: *mut halide_thread);
}
extern "C" {
    pub fn halide_set_num_threads(n: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_malloc(
        user_context: *mut ::std::os::raw::c_void,
        x: size_t,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn halide_free(user_context: *mut ::std::os::raw::c_void, ptr: *mut ::std::os::raw::c_void);
}
extern "C" {
    pub fn halide_default_malloc(
        user_context: *mut ::std::os::raw::c_void,
        x: size_t,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn halide_default_free(
        user_context: *mut ::std::os::raw::c_void,
        ptr: *mut ::std::os::raw::c_void,
    );
}
pub type halide_malloc_t = ::std::option::Option<
    unsafe extern "C" fn(
        arg1: *mut ::std::os::raw::c_void,
        arg2: size_t,
    ) -> *mut ::std::os::raw::c_void,
>;
pub type halide_free_t = ::std::option::Option<
    unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: *mut ::std::os::raw::c_void),
>;
extern "C" {
    pub fn halide_set_custom_malloc(user_malloc: halide_malloc_t) -> halide_malloc_t;
}
extern "C" {
    pub fn halide_set_custom_free(user_free: halide_free_t) -> halide_free_t;
}
extern "C" {
    pub fn halide_get_symbol(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn halide_load_library(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn halide_get_library_symbol(
        lib: *mut ::std::os::raw::c_void,
        name: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn halide_default_get_symbol(
        name: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn halide_default_load_library(
        name: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_void;
}
extern "C" {
    pub fn halide_default_get_library_symbol(
        lib: *mut ::std::os::raw::c_void,
        name: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_void;
}
pub type halide_get_symbol_t = ::std::option::Option<
    unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void,
>;
pub type halide_load_library_t = ::std::option::Option<
    unsafe extern "C" fn(name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_void,
>;
pub type halide_get_library_symbol_t = ::std::option::Option<
    unsafe extern "C" fn(
        lib: *mut ::std::os::raw::c_void,
        name: *const ::std::os::raw::c_char,
    ) -> *mut ::std::os::raw::c_void,
>;
extern "C" {
    pub fn halide_set_custom_get_symbol(
        user_get_symbol: halide_get_symbol_t,
    ) -> halide_get_symbol_t;
}
extern "C" {
    pub fn halide_set_custom_load_library(
        user_load_library: halide_load_library_t,
    ) -> halide_load_library_t;
}
extern "C" {
    pub fn halide_set_custom_get_library_symbol(
        user_get_library_symbol: halide_get_library_symbol_t,
    ) -> halide_get_library_symbol_t;
}
extern "C" {
    pub fn halide_debug_to_file(
        user_context: *mut ::std::os::raw::c_void,
        filename: *const ::std::os::raw::c_char,
        type_code: i32,
        buf: *mut halide_buffer_t,
    ) -> i32;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_type_code_t {
    halide_type_int = 0,
    halide_type_uint = 1,
    halide_type_float = 2,
    halide_type_handle = 3,
    halide_type_bfloat = 4,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_type_t {
    pub code: u8,
    pub bits: u8,
    pub lanes: u16,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_trace_event_code_t {
    halide_trace_load = 0,
    halide_trace_store = 1,
    halide_trace_begin_realization = 2,
    halide_trace_end_realization = 3,
    halide_trace_produce = 4,
    halide_trace_end_produce = 5,
    halide_trace_consume = 6,
    halide_trace_end_consume = 7,
    halide_trace_begin_pipeline = 8,
    halide_trace_end_pipeline = 9,
    halide_trace_tag = 10,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_trace_event_t {
    pub func: *const ::std::os::raw::c_char,
    pub value: *mut ::std::os::raw::c_void,
    pub coordinates: *mut i32,
    pub trace_tag: *const ::std::os::raw::c_char,
    pub type_: halide_type_t,
    pub event: halide_trace_event_code_t,
    pub parent_id: i32,
    pub value_index: i32,
    pub dimensions: i32,
}
extern "C" {
    pub fn halide_trace(
        user_context: *mut ::std::os::raw::c_void,
        event: *const halide_trace_event_t,
    ) -> i32;
}
extern "C" {
    pub fn halide_default_trace(
        user_context: *mut ::std::os::raw::c_void,
        event: *const halide_trace_event_t,
    ) -> i32;
}
pub type halide_trace_t = ::std::option::Option<
    unsafe extern "C" fn(
        user_context: *mut ::std::os::raw::c_void,
        arg1: *const halide_trace_event_t,
    ) -> i32,
>;
extern "C" {
    pub fn halide_set_custom_trace(trace: halide_trace_t) -> halide_trace_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_trace_packet_t {
    pub size: u32,
    pub id: i32,
    pub type_: halide_type_t,
    pub event: halide_trace_event_code_t,
    pub parent_id: i32,
    pub value_index: i32,
    pub dimensions: i32,
}
extern "C" {
    pub fn halide_set_trace_file(fd: ::std::os::raw::c_int);
}
extern "C" {
    pub fn halide_get_trace_file(
        user_context: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_shutdown_trace() -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_device_interface_impl_t {
    _unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_device_interface_t {
    pub device_malloc: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
            device_interface: *const halide_device_interface_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub device_free: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub device_sync: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub device_release: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            device_interface: *const halide_device_interface_t,
        ),
    >,
    pub copy_to_host: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub copy_to_device: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
            device_interface: *const halide_device_interface_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub device_and_host_malloc: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
            device_interface: *const halide_device_interface_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub device_and_host_free: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub buffer_copy: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            src: *mut halide_buffer_t,
            dst_device_interface: *const halide_device_interface_t,
            dst: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub device_crop: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            src: *const halide_buffer_t,
            dst: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub device_slice: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            src: *const halide_buffer_t,
            slice_dim: ::std::os::raw::c_int,
            slice_pos: ::std::os::raw::c_int,
            dst: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub device_release_crop: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub wrap_native: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
            handle: u64,
            device_interface: *const halide_device_interface_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub detach_native: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            buf: *mut halide_buffer_t,
        ) -> ::std::os::raw::c_int,
    >,
    pub compute_capability: ::std::option::Option<
        unsafe extern "C" fn(
            user_context: *mut ::std::os::raw::c_void,
            major: *mut ::std::os::raw::c_int,
            minor: *mut ::std::os::raw::c_int,
        ) -> ::std::os::raw::c_int,
    >,
    pub impl_: *const halide_device_interface_impl_t,
}
extern "C" {
    pub fn halide_device_release(
        user_context: *mut ::std::os::raw::c_void,
        device_interface: *const halide_device_interface_t,
    );
}
extern "C" {
    pub fn halide_copy_to_host(
        user_context: *mut ::std::os::raw::c_void,
        buf: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_copy_to_device(
        user_context: *mut ::std::os::raw::c_void,
        buf: *mut halide_buffer_t,
        device_interface: *const halide_device_interface_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_buffer_copy(
        user_context: *mut ::std::os::raw::c_void,
        src: *mut halide_buffer_t,
        dst_device_interface: *const halide_device_interface_t,
        dst: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_device_crop(
        user_context: *mut ::std::os::raw::c_void,
        src: *const halide_buffer_t,
        dst: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_device_slice(
        user_context: *mut ::std::os::raw::c_void,
        src: *const halide_buffer_t,
        slice_dim: ::std::os::raw::c_int,
        slice_pos: ::std::os::raw::c_int,
        dst: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_device_release_crop(
        user_context: *mut ::std::os::raw::c_void,
        buf: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_device_sync(
        user_context: *mut ::std::os::raw::c_void,
        buf: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_device_malloc(
        user_context: *mut ::std::os::raw::c_void,
        buf: *mut halide_buffer_t,
        device_interface: *const halide_device_interface_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_device_free(
        user_context: *mut ::std::os::raw::c_void,
        buf: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_device_wrap_native(
        user_context: *mut ::std::os::raw::c_void,
        buf: *mut halide_buffer_t,
        handle: u64,
        device_interface: *const halide_device_interface_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_device_detach_native(
        user_context: *mut ::std::os::raw::c_void,
        buf: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_set_gpu_device(n: ::std::os::raw::c_int);
}
extern "C" {
    pub fn halide_get_gpu_device(
        user_context: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_memoization_cache_set_size(size: i64);
}
extern "C" {
    pub fn halide_memoization_cache_lookup(
        user_context: *mut ::std::os::raw::c_void,
        cache_key: *const u8,
        size: i32,
        realized_bounds: *mut halide_buffer_t,
        tuple_count: i32,
        tuple_buffers: *mut *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_memoization_cache_store(
        user_context: *mut ::std::os::raw::c_void,
        cache_key: *const u8,
        size: i32,
        realized_bounds: *mut halide_buffer_t,
        tuple_count: i32,
        tuple_buffers: *mut *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_memoization_cache_release(
        user_context: *mut ::std::os::raw::c_void,
        host: *mut ::std::os::raw::c_void,
    );
}
extern "C" {
    pub fn halide_memoization_cache_cleanup();
}
extern "C" {
    pub fn halide_msan_check_memory_is_initialized(
        user_context: *mut ::std::os::raw::c_void,
        ptr: *const ::std::os::raw::c_void,
        len: u64,
        name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_msan_check_buffer_is_initialized(
        user_context: *mut ::std::os::raw::c_void,
        buffer: *mut halide_buffer_t,
        buf_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_msan_annotate_memory_is_initialized(
        user_context: *mut ::std::os::raw::c_void,
        ptr: *const ::std::os::raw::c_void,
        len: u64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_msan_annotate_buffer_is_initialized(
        user_context: *mut ::std::os::raw::c_void,
        buffer: *mut halide_buffer_t,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_msan_annotate_buffer_is_initialized_as_destructor(
        user_context: *mut ::std::os::raw::c_void,
        buffer: *mut ::std::os::raw::c_void,
    );
}
#[repr(i32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_error_code_t {
    halide_error_code_success = 0,
    halide_error_code_generic_error = -1,
    halide_error_code_explicit_bounds_too_small = -2,
    halide_error_code_bad_type = -3,
    halide_error_code_access_out_of_bounds = -4,
    halide_error_code_buffer_allocation_too_large = -5,
    halide_error_code_buffer_extents_too_large = -6,
    halide_error_code_constraints_make_required_region_smaller = -7,
    halide_error_code_constraint_violated = -8,
    halide_error_code_param_too_small = -9,
    halide_error_code_param_too_large = -10,
    halide_error_code_out_of_memory = -11,
    halide_error_code_buffer_argument_is_null = -12,
    halide_error_code_debug_to_file_failed = -13,
    halide_error_code_copy_to_host_failed = -14,
    halide_error_code_copy_to_device_failed = -15,
    halide_error_code_device_malloc_failed = -16,
    halide_error_code_device_sync_failed = -17,
    halide_error_code_device_free_failed = -18,
    halide_error_code_no_device_interface = -19,
    halide_error_code_matlab_init_failed = -20,
    halide_error_code_matlab_bad_param_type = -21,
    halide_error_code_internal_error = -22,
    halide_error_code_device_run_failed = -23,
    halide_error_code_unaligned_host_ptr = -24,
    halide_error_code_bad_fold = -25,
    halide_error_code_fold_factor_too_small = -26,
    halide_error_code_requirement_failed = -27,
    halide_error_code_buffer_extents_negative = -28,
    halide_error_code_unused_29 = -29,
    halide_error_code_unused_30 = -30,
    halide_error_code_specialize_fail = -31,
    halide_error_code_device_wrap_native_failed = -32,
    halide_error_code_device_detach_native_failed = -33,
    halide_error_code_host_is_null = -34,
    halide_error_code_bad_extern_fold = -35,
    halide_error_code_device_interface_no_device = -36,
    halide_error_code_host_and_device_dirty = -37,
    halide_error_code_buffer_is_null = -38,
    halide_error_code_device_buffer_copy_failed = -39,
    halide_error_code_device_crop_unsupported = -40,
    halide_error_code_device_crop_failed = -41,
    halide_error_code_incompatible_device_interface = -42,
    halide_error_code_bad_dimensions = -43,
    halide_error_code_device_dirty_with_no_device_support = -44,
}
extern "C" {
    pub fn halide_error_bounds_inference_call_failed(
        user_context: *mut ::std::os::raw::c_void,
        extern_stage_name: *const ::std::os::raw::c_char,
        result: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_extern_stage_failed(
        user_context: *mut ::std::os::raw::c_void,
        extern_stage_name: *const ::std::os::raw::c_char,
        result: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_explicit_bounds_too_small(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
        var_name: *const ::std::os::raw::c_char,
        min_bound: ::std::os::raw::c_int,
        max_bound: ::std::os::raw::c_int,
        min_required: ::std::os::raw::c_int,
        max_required: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_bad_type(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
        type_given: u32,
        correct_type: u32,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_bad_dimensions(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
        dimensions_given: i32,
        correct_dimensions: i32,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_access_out_of_bounds(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
        dimension: ::std::os::raw::c_int,
        min_touched: ::std::os::raw::c_int,
        max_touched: ::std::os::raw::c_int,
        min_valid: ::std::os::raw::c_int,
        max_valid: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_buffer_allocation_too_large(
        user_context: *mut ::std::os::raw::c_void,
        buffer_name: *const ::std::os::raw::c_char,
        allocation_size: u64,
        max_size: u64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_buffer_extents_negative(
        user_context: *mut ::std::os::raw::c_void,
        buffer_name: *const ::std::os::raw::c_char,
        dimension: ::std::os::raw::c_int,
        extent: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_buffer_extents_too_large(
        user_context: *mut ::std::os::raw::c_void,
        buffer_name: *const ::std::os::raw::c_char,
        actual_size: i64,
        max_size: i64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_constraints_make_required_region_smaller(
        user_context: *mut ::std::os::raw::c_void,
        buffer_name: *const ::std::os::raw::c_char,
        dimension: ::std::os::raw::c_int,
        constrained_min: ::std::os::raw::c_int,
        constrained_extent: ::std::os::raw::c_int,
        required_min: ::std::os::raw::c_int,
        required_extent: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_constraint_violated(
        user_context: *mut ::std::os::raw::c_void,
        var: *const ::std::os::raw::c_char,
        val: ::std::os::raw::c_int,
        constrained_var: *const ::std::os::raw::c_char,
        constrained_val: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_param_too_small_i64(
        user_context: *mut ::std::os::raw::c_void,
        param_name: *const ::std::os::raw::c_char,
        val: i64,
        min_val: i64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_param_too_small_u64(
        user_context: *mut ::std::os::raw::c_void,
        param_name: *const ::std::os::raw::c_char,
        val: u64,
        min_val: u64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_param_too_small_f64(
        user_context: *mut ::std::os::raw::c_void,
        param_name: *const ::std::os::raw::c_char,
        val: f64,
        min_val: f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_param_too_large_i64(
        user_context: *mut ::std::os::raw::c_void,
        param_name: *const ::std::os::raw::c_char,
        val: i64,
        max_val: i64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_param_too_large_u64(
        user_context: *mut ::std::os::raw::c_void,
        param_name: *const ::std::os::raw::c_char,
        val: u64,
        max_val: u64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_param_too_large_f64(
        user_context: *mut ::std::os::raw::c_void,
        param_name: *const ::std::os::raw::c_char,
        val: f64,
        max_val: f64,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_out_of_memory(
        user_context: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_buffer_argument_is_null(
        user_context: *mut ::std::os::raw::c_void,
        buffer_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_debug_to_file_failed(
        user_context: *mut ::std::os::raw::c_void,
        func: *const ::std::os::raw::c_char,
        filename: *const ::std::os::raw::c_char,
        error_code: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_unaligned_host_ptr(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
        alignment: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_host_is_null(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_bad_fold(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
        var_name: *const ::std::os::raw::c_char,
        loop_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_bad_extern_fold(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
        dim: ::std::os::raw::c_int,
        min: ::std::os::raw::c_int,
        extent: ::std::os::raw::c_int,
        valid_min: ::std::os::raw::c_int,
        fold_factor: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_fold_factor_too_small(
        user_context: *mut ::std::os::raw::c_void,
        func_name: *const ::std::os::raw::c_char,
        var_name: *const ::std::os::raw::c_char,
        fold_factor: ::std::os::raw::c_int,
        loop_name: *const ::std::os::raw::c_char,
        required_extent: ::std::os::raw::c_int,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_requirement_failed(
        user_context: *mut ::std::os::raw::c_void,
        condition: *const ::std::os::raw::c_char,
        message: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_specialize_fail(
        user_context: *mut ::std::os::raw::c_void,
        message: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_no_device_interface(
        user_context: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_device_interface_no_device(
        user_context: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_host_and_device_dirty(
        user_context: *mut ::std::os::raw::c_void,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_buffer_is_null(
        user_context: *mut ::std::os::raw::c_void,
        routine: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_error_device_dirty_with_no_device_support(
        user_context: *mut ::std::os::raw::c_void,
        buffer_name: *const ::std::os::raw::c_char,
    ) -> ::std::os::raw::c_int;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_target_feature_t {
    halide_target_feature_jit = 0,
    halide_target_feature_debug = 1,
    halide_target_feature_no_asserts = 2,
    halide_target_feature_no_bounds_query = 3,
    halide_target_feature_sse41 = 4,
    halide_target_feature_avx = 5,
    halide_target_feature_avx2 = 6,
    halide_target_feature_fma = 7,
    halide_target_feature_fma4 = 8,
    halide_target_feature_f16c = 9,
    halide_target_feature_armv7s = 10,
    halide_target_feature_no_neon = 11,
    halide_target_feature_vsx = 12,
    halide_target_feature_power_arch_2_07 = 13,
    halide_target_feature_cuda = 14,
    halide_target_feature_cuda_capability30 = 15,
    halide_target_feature_cuda_capability32 = 16,
    halide_target_feature_cuda_capability35 = 17,
    halide_target_feature_cuda_capability50 = 18,
    halide_target_feature_opencl = 19,
    halide_target_feature_cl_doubles = 20,
    halide_target_feature_cl_atomic64 = 21,
    halide_target_feature_opengl = 22,
    halide_target_feature_openglcompute = 23,
    halide_target_feature_user_context = 24,
    halide_target_feature_matlab = 25,
    halide_target_feature_profile = 26,
    halide_target_feature_no_runtime = 27,
    halide_target_feature_metal = 28,
    halide_target_feature_mingw = 29,
    halide_target_feature_c_plus_plus_mangling = 30,
    halide_target_feature_large_buffers = 31,
    halide_target_feature_hvx_64 = 32,
    halide_target_feature_hvx_128 = 33,
    halide_target_feature_hvx_v62 = 34,
    halide_target_feature_fuzz_float_stores = 35,
    halide_target_feature_soft_float_abi = 36,
    halide_target_feature_msan = 37,
    halide_target_feature_avx512 = 38,
    halide_target_feature_avx512_knl = 39,
    halide_target_feature_avx512_skylake = 40,
    halide_target_feature_avx512_cannonlake = 41,
    halide_target_feature_hvx_use_shared_object = 42,
    halide_target_feature_trace_loads = 43,
    halide_target_feature_trace_stores = 44,
    halide_target_feature_trace_realizations = 45,
    halide_target_feature_trace_pipeline = 46,
    halide_target_feature_cuda_capability61 = 47,
    halide_target_feature_hvx_v65 = 48,
    halide_target_feature_hvx_v66 = 49,
    halide_target_feature_cl_half = 50,
    halide_target_feature_strict_float = 51,
    halide_target_feature_tsan = 52,
    halide_target_feature_asan = 53,
    halide_target_feature_d3d12compute = 54,
    halide_target_feature_check_unsafe_promises = 55,
    halide_target_feature_hexagon_dma = 56,
    halide_target_feature_embed_bitcode = 57,
    halide_target_feature_enable_llvm_loop_opt = 58,
    halide_target_feature_disable_llvm_loop_opt = 59,
    halide_target_feature_wasm_simd128 = 60,
    halide_target_feature_wasm_signext = 61,
    halide_target_feature_sve = 62,
    halide_target_feature_sve2 = 63,
    halide_target_feature_egl = 64,
    halide_target_feature_end = 65,
}
extern "C" {
    pub fn halide_can_use_target_features(
        count: ::std::os::raw::c_int,
        features: *const u64,
    ) -> ::std::os::raw::c_int;
}
pub type halide_can_use_target_features_t = ::std::option::Option<
    unsafe extern "C" fn(
        count: ::std::os::raw::c_int,
        features: *const u64,
    ) -> ::std::os::raw::c_int,
>;
extern "C" {
    pub fn halide_set_custom_can_use_target_features(
        arg1: halide_can_use_target_features_t,
    ) -> halide_can_use_target_features_t;
}
extern "C" {
    pub fn halide_default_can_use_target_features(
        count: ::std::os::raw::c_int,
        features: *const u64,
    ) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_dimension_t {
    pub min: i32,
    pub extent: i32,
    pub stride: i32,
    pub flags: u32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_buffer_t {
    pub device: u64,
    pub device_interface: *const halide_device_interface_t,
    pub host: *mut u8,
    pub flags: u64,
    pub type_: halide_type_t,
    pub dimensions: i32,
    pub dim: *mut halide_dimension_t,
    pub padding: *mut ::std::os::raw::c_void,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct halide_scalar_value_t {
    pub u: halide_scalar_value_t__bindgen_ty_1,
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union halide_scalar_value_t__bindgen_ty_1 {
    pub b: bool,
    pub i8: i8,
    pub i16: i16,
    pub i32: i32,
    pub i64: i64,
    pub u8: u8,
    pub u16: u16,
    pub u32: u32,
    pub u64: u64,
    pub f32: f32,
    pub f64: f64,
    pub handle: *mut ::std::os::raw::c_void,
    _bindgen_union_align: u64,
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum halide_argument_kind_t {
    halide_argument_kind_input_scalar = 0,
    halide_argument_kind_input_buffer = 1,
    halide_argument_kind_output_buffer = 2,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_filter_argument_t {
    pub name: *const ::std::os::raw::c_char,
    pub kind: i32,
    pub dimensions: i32,
    pub type_: halide_type_t,
    pub scalar_def: *const halide_scalar_value_t,
    pub scalar_min: *const halide_scalar_value_t,
    pub scalar_max: *const halide_scalar_value_t,
    pub scalar_estimate: *const halide_scalar_value_t,
    pub buffer_estimates: *const *const i64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_filter_metadata_t {
    pub version: i32,
    pub num_arguments: i32,
    pub arguments: *const halide_filter_argument_t,
    pub target: *const ::std::os::raw::c_char,
    pub name: *const ::std::os::raw::c_char,
}
extern "C" {
    pub fn halide_register_argv_and_metadata(
        filter_argv_call: ::std::option::Option<
            unsafe extern "C" fn(arg1: *mut *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
        >,
        filter_metadata: *const halide_filter_metadata_t,
        extra_key_value_pairs: *const *const ::std::os::raw::c_char,
    );
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_profiler_func_stats {
    pub time: u64,
    pub memory_current: u64,
    pub memory_peak: u64,
    pub memory_total: u64,
    pub stack_peak: u64,
    pub active_threads_numerator: u64,
    pub active_threads_denominator: u64,
    pub name: *const ::std::os::raw::c_char,
    pub num_allocs: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_profiler_pipeline_stats {
    pub time: u64,
    pub memory_current: u64,
    pub memory_peak: u64,
    pub memory_total: u64,
    pub active_threads_numerator: u64,
    pub active_threads_denominator: u64,
    pub name: *const ::std::os::raw::c_char,
    pub funcs: *mut halide_profiler_func_stats,
    pub next: *mut ::std::os::raw::c_void,
    pub num_funcs: ::std::os::raw::c_int,
    pub first_func_id: ::std::os::raw::c_int,
    pub runs: ::std::os::raw::c_int,
    pub samples: ::std::os::raw::c_int,
    pub num_allocs: ::std::os::raw::c_int,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_profiler_state {
    pub lock: halide_mutex,
    pub sleep_time: ::std::os::raw::c_int,
    pub first_free_id: ::std::os::raw::c_int,
    pub current_func: ::std::os::raw::c_int,
    pub active_threads: ::std::os::raw::c_int,
    pub pipelines: *mut halide_profiler_pipeline_stats,
    pub get_remote_profiler_state: ::std::option::Option<
        unsafe extern "C" fn(
            func: *mut ::std::os::raw::c_int,
            active_workers: *mut ::std::os::raw::c_int,
        ),
    >,
    pub sampling_thread: *mut halide_thread,
}
extern "C" {
    pub fn halide_profiler_get_state() -> *mut halide_profiler_state;
}
extern "C" {
    pub fn halide_profiler_get_pipeline_state(
        pipeline_name: *const ::std::os::raw::c_char,
    ) -> *mut halide_profiler_pipeline_stats;
}
extern "C" {
    pub fn halide_profiler_reset();
}
extern "C" {
    pub fn halide_profiler_shutdown();
}
extern "C" {
    pub fn halide_profiler_report(user_context: *mut ::std::os::raw::c_void);
}
extern "C" {
    pub fn halide_float16_bits_to_float(arg1: u16) -> f32;
}
extern "C" {
    pub fn halide_float16_bits_to_double(arg1: u16) -> f64;
}
extern "C" {
    pub fn halide_reuse_device_allocations(
        user_context: *mut ::std::os::raw::c_void,
        arg1: bool,
    ) -> ::std::os::raw::c_int;
}
extern "C" {
    pub fn halide_can_reuse_device_allocations(user_context: *mut ::std::os::raw::c_void) -> bool;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct halide_device_allocation_pool {
    pub release_unused: ::std::option::Option<
        unsafe extern "C" fn(user_context: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
    >,
    pub next: *mut halide_device_allocation_pool,
}
extern "C" {
    pub fn halide_register_device_allocation_pool(arg1: *mut halide_device_allocation_pool);
}