aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda_ml/src/lib.rs
blob: d076227e0c2b008d7924c8f9561f1bab7c378e69 (plain)
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
mod r#impl;

macro_rules! unimplemented_fn {
    ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => {
        $(
            #[no_mangle]
            #[allow(improper_ctypes_definitions)]
            pub extern $abi fn $fn_name ( $( $arg_id : $arg_type),* ) -> $ret_type {
                r#impl::unimplemented()
            }
        )*
    };
}

macro_rules! implemented_fn {
    ($($abi:literal fn $fn_name:ident( $($arg_id:ident : $arg_type:ty),* ) -> $ret_type:ty;)*) => {
        $(
            #[no_mangle]
            #[allow(improper_ctypes_definitions)]
            pub extern $abi fn $fn_name ( $( $arg_id : $arg_type),* ) -> $ret_type {
                r#impl::$fn_name($($arg_id),*)
            }
        )*
    };
}

cuda_base::nvml_function_declarations!(
    unimplemented_fn,
    implemented_fn <= [
        nvmlErrorString
    ]
);