From e040bcb69a3dbcbc50cb747da845e281467075a4 Mon Sep 17 00:00:00 2001 From: Ahmed El-Shafiey Date: Sun, 14 Apr 2013 20:14:54 -0800 Subject: - 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] --- libcuda/cuda_runtime_api.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libcuda/cuda_runtime_api.cc') 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; +} + /******************************************************************************* * * * * -- cgit v1.3