aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda_ml/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'zluda_ml/src/lib.rs')
-rw-r--r--zluda_ml/src/lib.rs35
1 files changed, 32 insertions, 3 deletions
diff --git a/zluda_ml/src/lib.rs b/zluda_ml/src/lib.rs
index bb62334..d076227 100644
--- a/zluda_ml/src/lib.rs
+++ b/zluda_ml/src/lib.rs
@@ -1,3 +1,32 @@
-pub mod r#impl;
-#[allow(warnings)]
-mod nvml; \ No newline at end of file
+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
+ ]
+);