aboutsummaryrefslogtreecommitdiffhomepage
path: root/zluda/src/impl/context.rs
diff options
context:
space:
mode:
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) }
}