summaryrefslogtreecommitdiff
path: root/libcuda/cuda_runtime_api.cc
diff options
context:
space:
mode:
authorAhmed El-Shafiey <[email protected]>2013-04-14 20:14:54 -0800
committerAndrew Boktor <[email protected]>2014-08-14 13:50:46 -0700
commite040bcb69a3dbcbc50cb747da845e281467075a4 (patch)
treef7172eb3b317e5f9ed3a0adbbc64b07de3781575 /libcuda/cuda_runtime_api.cc
parent2a6fb492f767618a4abfe1ebaf439ad32a1607f4 (diff)
- Adding support for cudaFuncSetCacheConfig API, that allows changing the
L1 Cache and Shared Memory configurations across kernels. The support enable the user to specify two more configurations (Preferred L1) or (Preferred Shared Memory) besides the default config. If the cudaFuncSetCacheConfig API is used to set the cache configuration of a specific kernel to either of these configuration (cudaFuncCachePreferShared, cudaFuncCachePreferL1), the simulator will change the cache configuration at kernel launch accordingly, if there is no alternative configurations provided to the simulator it will use the default configurations with a warning message display [git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 15816]
Diffstat (limited to 'libcuda/cuda_runtime_api.cc')
-rw-r--r--libcuda/cuda_runtime_api.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/libcuda/cuda_runtime_api.cc b/libcuda/cuda_runtime_api.cc
index dad7669..7cb4ec4 100644
--- a/libcuda/cuda_runtime_api.cc
+++ b/libcuda/cuda_runtime_api.cc
@@ -787,6 +787,13 @@ __host__ cudaError_t CUDARTAPI cudaGetDevice(int *device)
return g_last_cudaError = cudaSuccess;
}
+__host__ cudaError_t CUDARTAPI cudaFuncSetCacheConfig(const char *func, enum cudaFuncCache cacheConfig )
+{
+ CUctx_st *context = GPGPUSim_Context();
+ context->get_device()->get_gpgpu()->set_cache_config(context->get_kernel(func)->get_name(), (FuncCache)cacheConfig);
+ return g_last_cudaError = cudaSuccess;
+}
+
/*******************************************************************************
* *
* *