diff options
author | Andrzej Janik <[email protected]> | 2020-11-11 22:35:34 +0100 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2020-11-12 20:12:14 +0100 |
commit | a2e77fe961fb543370261e844d6cd79e0269e877 (patch) | |
tree | dea4c9c506c73941403de8ab46560bd569b4a7e7 /level_zero | |
parent | 7c93997cc9b90886b6371ca3b93e21e7e6ae073d (diff) | |
download | ZLUDA-a2e77fe961fb543370261e844d6cd79e0269e877.tar.gz ZLUDA-a2e77fe961fb543370261e844d6cd79e0269e877.zip |
Refactor host code to use one big lock
Diffstat (limited to 'level_zero')
-rw-r--r-- | level_zero/src/ze.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/level_zero/src/ze.rs b/level_zero/src/ze.rs index f8a2c3b..4267682 100644 --- a/level_zero/src/ze.rs +++ b/level_zero/src/ze.rs @@ -173,6 +173,16 @@ impl Context { check!(sys::zeContextCreate(drv.0, &ctx_desc, &mut result));
Ok(Context(result))
}
+
+ pub unsafe fn mem_free(&mut self, ptr: *mut c_void) -> Result<()> {
+ check! {
+ sys::zeMemFree(
+ self.0,
+ ptr,
+ )
+ };
+ Ok(())
+ }
}
impl Drop for Context {
@@ -239,7 +249,7 @@ pub struct Module(sys::ze_module_handle_t); impl Module {
// HACK ALERT
- // We use OpenCL for now to do SPIR-V linking, because Level0
+ // We use OpenCL for now to do SPIR-V linking, because Level0
// does not allow linking. Don't let presence of zeModuleDynamicLink fool
// you, it's not currently possible to create non-compiled modules.
// zeModuleCreate always compiles (builds and links).
|