File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
Notable changes to this project will be documented in this file.
4
4
5
+ ## Unreleased
6
+
7
+ - Add ` memory::memcpy_dtoh ` to allow copying from device to host.
8
+
5
9
## 0.3.2 - 2/16/22
6
10
7
11
- Fixed ` ModuleJitOptions ` not working (due to cursed reasons).
Original file line number Diff line number Diff line change @@ -214,6 +214,17 @@ pub unsafe fn memcpy_htod(
214
214
Ok ( ( ) )
215
215
}
216
216
217
+ /// Simple wrapper over cuMemcpyDtoH_v2
218
+ #[ allow( clippy:: missing_safety_doc) ]
219
+ pub unsafe fn memcpy_dtoh (
220
+ d_ptr : * mut c_void ,
221
+ src_ptr : cust_raw:: CUdeviceptr ,
222
+ size : usize ,
223
+ ) -> CudaResult < ( ) > {
224
+ crate :: sys:: cuMemcpyDtoH_v2 ( d_ptr, src_ptr, size) . to_result ( ) ?;
225
+ Ok ( ( ) )
226
+ }
227
+
217
228
/// Get the current free and total memory.
218
229
///
219
230
/// Returns in `.1` the total amount of memory available to the the current context.
You can’t perform that action at this time.
0 commit comments