aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda/src/impl/memory.rs
diff options
context:
space:
mode:
Diffstat (limited to 'zluda/src/impl/memory.rs')
-rw-r--r--zluda/src/impl/memory.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/zluda/src/impl/memory.rs b/zluda/src/impl/memory.rs
index 3843776..33d5a4e 100644
--- a/zluda/src/impl/memory.rs
+++ b/zluda/src/impl/memory.rs
@@ -1,4 +1,5 @@
use hip_runtime_sys::*;
+use std::mem;
pub(crate) fn alloc_v2(dptr: *mut hipDeviceptr_t, bytesize: usize) -> hipError_t {
unsafe { hipMalloc(dptr.cast(), bytesize) }?;
@@ -33,3 +34,7 @@ pub(crate) fn get_address_range_v2(
) -> hipError_t {
unsafe { hipMemGetAddressRange(pbase, psize, dptr) }
}
+
+pub(crate) fn set_d32_v2(dst: hipDeviceptr_t, ui: ::core::ffi::c_uint, n: usize) -> hipError_t {
+ unsafe { hipMemsetD32(dst, mem::transmute(ui), n) }
+}