aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda/src/impl/context.rs
diff options
context:
space:
mode:
authorAndrzej Janik <[email protected]>2024-11-20 02:11:22 +0000
committerAndrzej Janik <[email protected]>2024-11-20 02:11:22 +0000
commit122676bb13aaeab3ac1603e1fff2b7e3e3a40d2a (patch)
tree7a86498960ae402b32cd07c0002ef8f7ee7eb4a4 /zluda/src/impl/context.rs
parent94e8e1342512d0dac75167baf22dd16e70408f1c (diff)
downloadZLUDA-122676bb13aaeab3ac1603e1fff2b7e3e3a40d2a.tar.gz
ZLUDA-122676bb13aaeab3ac1603e1fff2b7e3e3a40d2a.zip
Add cuCtx*
Diffstat (limited to 'zluda/src/impl/context.rs')
-rw-r--r--zluda/src/impl/context.rs25
1 files changed, 5 insertions, 20 deletions
diff --git a/zluda/src/impl/context.rs b/zluda/src/impl/context.rs
index fffceb8..61cb92e 100644
--- a/zluda/src/impl/context.rs
+++ b/zluda/src/impl/context.rs
@@ -1,24 +1,9 @@
-use std::ptr;
+use hip_runtime_sys::*;
-use crate::cuda::CUlimit;
-use crate::cuda::CUresult;
-
-pub(crate) unsafe fn get_limit(pvalue: *mut usize, limit: CUlimit) -> CUresult {
- if pvalue == ptr::null_mut() {
- return CUresult::CUDA_ERROR_INVALID_VALUE;
- }
- if limit == CUlimit::CU_LIMIT_STACK_SIZE {
- *pvalue = 512; // GTX 1060 reports 1024
- CUresult::CUDA_SUCCESS
- } else {
- CUresult::CUDA_ERROR_NOT_SUPPORTED
- }
+pub(crate) unsafe fn get_limit(pvalue: *mut usize, limit: hipLimit_t) -> hipError_t {
+ unsafe { hipDeviceGetLimit(pvalue, limit) }
}
-pub(crate) fn set_limit(limit: CUlimit, value: usize) -> CUresult {
- if limit == CUlimit::CU_LIMIT_STACK_SIZE {
- CUresult::CUDA_SUCCESS
- } else {
- CUresult::CUDA_ERROR_NOT_SUPPORTED
- }
+pub(crate) fn set_limit(limit: hipLimit_t, value: usize) -> hipError_t {
+ unsafe { hipDeviceSetLimit(limit, value) }
}