summaryrefslogtreecommitdiff
path: root/src/cuda-sim
diff options
context:
space:
mode:
authorAhmad Alawneh <[email protected]>2025-02-15 02:47:41 +0300
committerGitHub <[email protected]>2025-02-14 23:47:41 +0000
commitc3966b6a8c24f4c64877d5a18335549d3af66d1a (patch)
tree8c767d9e6c359092f4c73d36c96cd556d7c72b04 /src/cuda-sim
parent68e1cd30efaecbd71b496822f9d88a5803b33841 (diff)
Cuda12 (#94)
* added support to cuda 12, by predicating texuture cache * format code
Diffstat (limited to 'src/cuda-sim')
-rw-r--r--src/cuda-sim/cuda-sim.cc6
-rw-r--r--src/cuda-sim/instructions.cc2
2 files changed, 8 insertions, 0 deletions
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index 2fd90c0..d05549c 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -125,6 +125,7 @@ cudaLaunchDeviceV2_init_perWarp, cudaLaunchDevicV2_perKernel>"
void gpgpu_t::gpgpu_ptx_sim_bindNameToTexture(
const char *name, const struct textureReference *texref, int dim,
int readmode, int ext) {
+#if (CUDART_VERSION <= 1200)
std::string texname(name);
if (m_NameToTextureRef.find(texname) == m_NameToTextureRef.end()) {
m_NameToTextureRef[texname] = std::set<const struct textureReference *>();
@@ -148,6 +149,7 @@ void gpgpu_t::gpgpu_ptx_sim_bindNameToTexture(
const textureReferenceAttr *texAttr = new textureReferenceAttr(
texref, dim, (enum cudaTextureReadMode)readmode, ext);
m_NameToAttribute[texname] = texAttr;
+#endif
}
const char *gpgpu_t::gpgpu_ptx_sim_findNamefromTexture(
@@ -185,6 +187,7 @@ unsigned int intLOGB2(unsigned int v) {
void gpgpu_t::gpgpu_ptx_sim_bindTextureToArray(
const struct textureReference *texref, const struct cudaArray *array) {
+#if (CUDART_VERSION <= 1200)
std::string texname = gpgpu_ptx_sim_findNamefromTexture(texref);
std::map<std::string, const struct cudaArray *>::const_iterator t =
@@ -258,14 +261,17 @@ void gpgpu_t::gpgpu_ptx_sim_bindTextureToArray(
texInfo->texel_size = texel_size;
texInfo->texel_size_numbits = intLOGB2(texel_size);
m_NameToTextureInfo[texname] = texInfo;
+#endif
}
void gpgpu_t::gpgpu_ptx_sim_unbindTexture(
const struct textureReference *texref) {
+#if (CUDART_VERSION <= 1200)
// assumes bind-use-unbind-bind-use-unbind pattern
std::string texname = gpgpu_ptx_sim_findNamefromTexture(texref);
m_NameToCudaArray.erase(texname);
m_NameToTextureInfo.erase(texname);
+#endif
}
#define MAX_INST_SIZE 8 /*bytes*/
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc
index 843bf0b..8bc19d3 100644
--- a/src/cuda-sim/instructions.cc
+++ b/src/cuda-sim/instructions.cc
@@ -6046,6 +6046,7 @@ void textureNormalizeOutput(const struct cudaChannelFormatDesc &desc,
}
void tex_impl(const ptx_instruction *pI, ptx_thread_info *thread) {
+#if (CUDART_VERSION <= 1200)
unsigned dimension = pI->dimension();
const operand_info &dst =
pI->dst(); // the registers to which fetched texel will be placed
@@ -6373,6 +6374,7 @@ void tex_impl(const ptx_instruction *pI, ptx_thread_info *thread) {
}
thread->set_vector_operand_values(dst, data1, data2, data3, data4);
+#endif
}
void txq_impl(const ptx_instruction *pI, ptx_thread_info *thread) {