Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pub mod ffi {
- #[repr(C, align(8))]
- pub struct DialectRegistry {
- data: [u8; 72],
- phantom: ::std::marker::PhantomData<::std::marker::PhantomPinned>,
- }
- extern "C" {
- fn _ZN4mlir15DialectRegistryC1Ev(this: *mut DialectRegistry);
- }
- impl DialectRegistry {
- pub unsafe fn new() -> Self {
- let mut this = std::mem::MaybeUninit::<DialectRegistry>::uninit();
- _ZN4mlir15DialectRegistryC1Ev(this.as_mut_ptr());
- this.assume_init()
- }
- }
- #[repr(C, align(8))]
- pub struct MLIRContext {
- data: [u8; 8],
- phantom: ::std::marker::PhantomData<::std::marker::PhantomPinned>,
- }
- extern "C" {
- fn _ZN4mlir11MLIRContextC1ENS0_9ThreadingE(
- this: *mut MLIRContext,
- threading: Threading,
- );
- }
- impl MLIRContext {
- pub unsafe fn new(threading: Threading) -> Self {
- let mut this = std::mem::MaybeUninit::<MLIRContext>::uninit();
- _ZN4mlir11MLIRContextC1ENS0_9ThreadingE(this.as_mut_ptr(), threading);
- this.assume_init()
- }
- }
- extern "C" {
- fn _ZN4mlir11MLIRContext23isMultithreadingEnabledEv(
- this: *mut MLIRContext,
- ) -> bool;
- }
- impl MLIRContext {
- pub unsafe fn isMultithreadingEnabled(&mut self) -> bool {
- _ZN4mlir11MLIRContext23isMultithreadingEnabledEv(self as *mut _)
- }
- }
- #[repr(i32)]
- pub enum Threading {
- DISABLED = 0,
- ENABLED = 1,
- }
- #[repr(C, align(8))]
- pub struct Builder {
- data: [u8; 8],
- phantom: ::std::marker::PhantomData<::std::marker::PhantomPinned>,
- }
- extern "C" {
- fn _ZN4mlir7BuilderC1EPNS_11MLIRContextE(
- this: *mut Builder,
- context: *mut MLIRContext,
- );
- }
- impl Builder {
- pub unsafe fn new(context: *mut MLIRContext) -> Self {
- let mut this = std::mem::MaybeUninit::<Builder>::uninit();
- _ZN4mlir7BuilderC1EPNS_11MLIRContextE(this.as_mut_ptr(), context);
- this.assume_init()
- }
- }
- #[repr(C, align(8))]
- pub struct Type {
- data: [u8; 8],
- phantom: ::std::marker::PhantomData<::std::marker::PhantomPinned>,
- }
- extern "C" {
- fn _ZNK4mlir4Type7isIndexEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isIndex(&self) -> bool {
- _ZNK4mlir4Type7isIndexEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type12isFloat8E5M2Ev(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isFloat8E5M2(&self) -> bool {
- _ZNK4mlir4Type12isFloat8E5M2Ev(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type14isFloat8E4M3FNEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isFloat8E4M3FN(&self) -> bool {
- _ZNK4mlir4Type14isFloat8E4M3FNEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type6isBF16Ev(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isBF16(&self) -> bool {
- _ZNK4mlir4Type6isBF16Ev(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type5isF16Ev(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isF16(&self) -> bool {
- _ZNK4mlir4Type5isF16Ev(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type5isF32Ev(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isF32(&self) -> bool {
- _ZNK4mlir4Type5isF32Ev(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type5isF64Ev(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isF64(&self) -> bool {
- _ZNK4mlir4Type5isF64Ev(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type5isF80Ev(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isF80(&self) -> bool {
- _ZNK4mlir4Type5isF80Ev(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type6isF128Ev(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isF128(&self) -> bool {
- _ZNK4mlir4Type6isF128Ev(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type9isIntegerEj(this: *const Type, width: u32) -> bool;
- }
- impl Type {
- pub unsafe fn isInteger(&self, width: u32) -> bool {
- _ZNK4mlir4Type9isIntegerEj(self as *const _, width)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type17isSignlessIntegerEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isSignlessInteger(&self) -> bool {
- _ZNK4mlir4Type17isSignlessIntegerEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type17isUnsignedIntegerEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isUnsignedInteger(&self) -> bool {
- _ZNK4mlir4Type17isUnsignedIntegerEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type21getIntOrFloatBitWidthEv(this: *const Type) -> u32;
- }
- impl Type {
- pub unsafe fn getIntOrFloatBitWidth(&self) -> u32 {
- _ZNK4mlir4Type21getIntOrFloatBitWidthEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type20isSignlessIntOrIndexEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isSignlessIntOrIndex(&self) -> bool {
- _ZNK4mlir4Type20isSignlessIntOrIndexEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type27isSignlessIntOrIndexOrFloatEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isSignlessIntOrIndexOrFloat(&self) -> bool {
- _ZNK4mlir4Type27isSignlessIntOrIndexOrFloatEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type20isSignlessIntOrFloatEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isSignlessIntOrFloat(&self) -> bool {
- _ZNK4mlir4Type20isSignlessIntOrFloatEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type12isIntOrIndexEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isIntOrIndex(&self) -> bool {
- _ZNK4mlir4Type12isIntOrIndexEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type12isIntOrFloatEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isIntOrFloat(&self) -> bool {
- _ZNK4mlir4Type12isIntOrFloatEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type19isIntOrIndexOrFloatEv(this: *const Type) -> bool;
- }
- impl Type {
- pub unsafe fn isIntOrIndexOrFloat(&self) -> bool {
- _ZNK4mlir4Type19isIntOrIndexOrFloatEv(self as *const _)
- }
- }
- extern "C" {
- fn _ZNK4mlir4Type4dumpEv(this: *const Type);
- }
- impl Type {
- pub unsafe fn dump(&self) {
- _ZNK4mlir4Type4dumpEv(self as *const _)
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment