diff options
author | Andrzej Janik <[email protected]> | 2024-12-10 21:48:10 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2024-12-10 21:48:10 +0100 |
commit | 7ac67a89e9ac08d743242627cacefda518cefd68 (patch) | |
tree | 5fdb6c1519256268ef1b72a83728fb72b813c78c /zluda_ml/src/impl.rs | |
parent | 7a6df9dcbf59edef371e7f63c16c64916ddb0c0b (diff) | |
download | ZLUDA-7ac67a89e9ac08d743242627cacefda518cefd68.tar.gz ZLUDA-7ac67a89e9ac08d743242627cacefda518cefd68.zip |
Enable Geekbench 5 (#304)
Diffstat (limited to 'zluda_ml/src/impl.rs')
-rw-r--r-- | zluda_ml/src/impl.rs | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/zluda_ml/src/impl.rs b/zluda_ml/src/impl.rs index 35f3778..818d711 100644 --- a/zluda_ml/src/impl.rs +++ b/zluda_ml/src/impl.rs @@ -1,4 +1,5 @@ -use crate::nvml::nvmlReturn_t;
+use cuda_types::nvml::*;
+use std::{ffi::CStr, ptr};
#[cfg(debug_assertions)]
pub(crate) fn unimplemented() -> nvmlReturn_t {
@@ -9,3 +10,35 @@ pub(crate) fn unimplemented() -> nvmlReturn_t { pub(crate) fn unimplemented() -> nvmlReturn_t {
nvmlReturn_t::NVML_ERROR_NOT_SUPPORTED
}
+
+#[allow(non_snake_case)]
+pub(crate) fn nvmlErrorString(
+ _result: cuda_types::nvml::nvmlReturn_t,
+) -> *const ::core::ffi::c_char {
+ c"".as_ptr()
+}
+
+#[allow(non_snake_case)]
+pub(crate) fn nvmlInit_v2() -> cuda_types::nvml::nvmlReturn_t {
+ nvmlReturn_t::SUCCESS
+}
+
+const VERSION: &'static CStr = c"550.77";
+
+#[allow(non_snake_case)]
+pub(crate) fn nvmlSystemGetDriverVersion(
+ result: *mut ::core::ffi::c_char,
+ length: ::core::ffi::c_uint,
+) -> cuda_types::nvml::nvmlReturn_t {
+ if result == ptr::null_mut() {
+ return nvmlReturn_t::ERROR_INVALID_ARGUMENT;
+ }
+ let version = VERSION.to_bytes_with_nul();
+ let copy_length = usize::min(length as usize, version.len());
+ let slice = unsafe { std::slice::from_raw_parts_mut(result.cast(), copy_length) };
+ slice.copy_from_slice(&version[..copy_length]);
+ if let Some(null) = slice.last_mut() {
+ *null = 0;
+ }
+ nvmlReturn_t::SUCCESS
+}
|