summaryrefslogtreecommitdiff
path: root/src/cuda-sim/cuda-sim.cc
diff options
context:
space:
mode:
authorSuchita Pati <[email protected]>2019-04-16 23:36:02 -0500
committerSuchita Pati <[email protected]>2019-04-16 23:36:02 -0500
commit69af057daf1999f17b81d761c7a616f67f56adbb (patch)
tree8e660ea7c5f11cf594c9a76513f8c1b6c01f3aeb /src/cuda-sim/cuda-sim.cc
parent73050b730b31e9f58f8c2a0bfc4b3a8cd92be7ff (diff)
Adding additional fixes for the texture bugs
Diffstat (limited to 'src/cuda-sim/cuda-sim.cc')
-rw-r--r--src/cuda-sim/cuda-sim.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index a51ea3e..9d59411 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -1507,6 +1507,13 @@ static unsigned get_tex_datasize( const ptx_instruction *pI, ptx_thread_info *th
std::string texname = src1.name();
gpgpu_t *gpu = thread->get_gpu();
+ /*
+ For programs with many streams, textures can be bound and unbound
+ asynchronously. This means we need to use the kernel's "snapshot" of
+ the state of the texture mappings when it was launched (so that we
+ don't try to access the incorrect texture mapping if it's been updated,
+ or that we don't access a mapping that has been unbound).
+ */
kernel_info_t& k = thread->get_kernel();
const struct textureInfo* texInfo = k.get_texinfo(texname);