summaryrefslogtreecommitdiff
path: root/src/gpgpu-sim/gpu-sim.h
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 /src/gpgpu-sim/gpu-sim.h
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 'src/gpgpu-sim/gpu-sim.h')
-rw-r--r--src/gpgpu-sim/gpu-sim.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gpgpu-sim/gpu-sim.h b/src/gpgpu-sim/gpu-sim.h
index 8572092..8616fd4 100644
--- a/src/gpgpu-sim/gpu-sim.h
+++ b/src/gpgpu-sim/gpu-sim.h
@@ -35,7 +35,6 @@
#include "shader.h"
#include <iostream>
#include <fstream>
-
#include <list>
#include <stdio.h>
@@ -72,6 +71,14 @@ enum dram_ctrl_t {
DRAM_FRFCFS=1
};
+enum FuncCache
+{
+ FuncCachePreferNone = 0,
+ FuncCachePreferShared = 1,
+ FuncCachePreferL1 = 2
+};
+
+
struct power_config {
power_config()
@@ -210,7 +217,7 @@ struct memory_config {
void reg_options(class OptionParser * opp);
bool m_valid;
- l2_cache_config m_L2_config;
+ mutable l2_cache_config m_L2_config;
bool m_L2_texure_only;
char *gpgpu_dram_timing_opt;
@@ -461,6 +468,9 @@ private:
unsigned long long gpu_tot_issued_cta;
unsigned long long last_gpu_sim_insn;
+
+ std::map<std::string, FuncCache> m_special_cache_config;
+
std::vector<std::string> m_executed_kernel_names; //< names of kernel for stat printout
std::vector<unsigned> m_executed_kernel_uids; //< uids of kernel launches for stat printout
std::string executed_kernel_info_string(); //< format the kernel information into a string for stat printout
@@ -474,6 +484,11 @@ public:
+ FuncCache get_cache_config(std::string kernel_name);
+ void set_cache_config(std::string kernel_name, FuncCache cacheConfig );
+ bool has_special_cache_config(std::string kernel_name);
+ void change_cache_config(FuncCache cache_config);
+ void set_cache_config(std::string kernel_name);
};