summaryrefslogtreecommitdiff
path: root/libcuda
diff options
context:
space:
mode:
authorSuchita Pati <[email protected]>2019-04-17 22:09:17 -0500
committerSuchita Pati <[email protected]>2019-04-17 22:09:17 -0500
commit49c6eeff7752b5816fb08c0d6baf2b47c789bc18 (patch)
treefec42f692f3e55c265464c12c7e77f207bb7b327 /libcuda
parent69af057daf1999f17b81d761c7a616f67f56adbb (diff)
Adding configs for device limits and fixed other misc bugs
Diffstat (limited to 'libcuda')
-rw-r--r--libcuda/cuda_runtime_api.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index f6e5e6f..86435b9 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -1205,18 +1205,20 @@ __host__ cudaError_t CUDARTAPI cudaDeviceGetLimit ( size_t* pValue, cudaLimit li
if(g_debug_execution >= 3){
announce_call(__my_func__);
}
+ _cuda_device_id *dev = GPGPUSim_Init();
+ const gpgpu_sim_config& config=dev->get_gpgpu()->get_config();
switch(limit) {
case 0: // cudaLimitStackSize
- *pValue=1024;
+ *pValue=config.stack_limit();
break;
case 2: // cudaLimitMallocHeapSize
- *pValue=8388608;
+ *pValue=config.heap_limit();
break;
case 3: // cudaLimitDevRuntimeSyncDepth
- *pValue=2;
+ *pValue=config.sync_depth_limit();
break;
case 4: // cudaLimitDevRuntimePendingLaunchCount
- *pValue=2048;
+ *pValue=config.pending_launch_count_limit();
break;
default:
printf("ERROR:Limit %s unimplemented \n",limit);
@@ -2717,6 +2719,7 @@ cudaError_t CUDARTAPI cudaDeviceSynchronize(void){
if(g_debug_execution >= 3){
announce_call(__my_func__);
}
+ //Blocks until the device has completed all preceding requested tasks
synchronize();
return g_last_cudaError = cudaSuccess;
}