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] --- src/abstract_hardware_model.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/abstract_hardware_model.h') diff --git a/src/abstract_hardware_model.h b/src/abstract_hardware_model.h index de6eef8..5d74651 100644 --- a/src/abstract_hardware_model.h +++ b/src/abstract_hardware_model.h @@ -226,6 +226,9 @@ struct core_config { m_valid = false; num_shmem_bank=16; shmem_limited_broadcast = false; + gpgpu_shmem_sizeDefault=(unsigned)-1; + gpgpu_shmem_sizePrefL1=(unsigned)-1; + gpgpu_shmem_sizePrefShared=(unsigned)-1; } virtual void init() = 0; @@ -244,7 +247,10 @@ struct core_config { return ((addr/WORD_SIZE) % num_shmem_bank); } unsigned mem_warp_parts; - unsigned gpgpu_shmem_size; + mutable unsigned gpgpu_shmem_size; + unsigned gpgpu_shmem_sizeDefault; + unsigned gpgpu_shmem_sizePrefL1; + unsigned gpgpu_shmem_sizePrefShared; // texture and constant cache line sizes (used to determine number of memory accesses) unsigned gpgpu_cache_texl1_linesize; -- cgit v1.3