diff options
| author | tgrogers <[email protected]> | 2019-05-19 09:35:48 -0400 |
|---|---|---|
| committer | tgrogers <[email protected]> | 2019-05-19 09:35:48 -0400 |
| commit | 206ccbe8c0f712c802f8919497ca70bff1aa6a1e (patch) | |
| tree | 82ef1ef2631a0c8c32c2ce44319e96b944c52730 /src/cuda-sim/instructions.cc | |
| parent | 8c45f47e1b683d9904956659340a394321c6682d (diff) | |
| parent | 8fb484e4120a08e896f53424e9f4f46710966970 (diff) | |
Merge branch 'dev' of github.com:purdue-aalp/gpgpu-sim_distribution into dev
Diffstat (limited to 'src/cuda-sim/instructions.cc')
| -rw-r--r-- | src/cuda-sim/instructions.cc | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/cuda-sim/instructions.cc b/src/cuda-sim/instructions.cc index c85654c..11001d7 100644 --- a/src/cuda-sim/instructions.cc +++ b/src/cuda-sim/instructions.cc @@ -5258,11 +5258,18 @@ void tex_impl( const ptx_instruction *pI, ptx_thread_info *thread ) if (!ptx_tex_regs) ptx_tex_regs = new ptx_reg_t[4]; unsigned nelem = src2.get_vect_nelem(); thread->get_vector_operand_values(src2, ptx_tex_regs, nelem); //ptx_reg should be 4 entry vector type...coordinates into texture - + /* + 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). + */ gpgpu_t *gpu = thread->get_gpu(); + kernel_info_t &k = thread->get_kernel(); const struct textureReference* texref = gpu->get_texref(texname); - const struct cudaArray* cuArray = gpu->get_texarray(texname); - const struct textureInfo* texInfo = gpu->get_texinfo(texname); + const struct cudaArray* cuArray = k.get_texarray(texname); + const struct textureInfo* texInfo = k.get_texinfo(texname); const struct textureReferenceAttr* texAttr = gpu->get_texattr(texname); //assume always 2D f32 input |
