summaryrefslogtreecommitdiff
path: root/src/cuda-sim/cuda-sim.cc
diff options
context:
space:
mode:
authorJonathan <[email protected]>2018-05-18 10:50:19 -0700
committerJonathan <[email protected]>2018-05-25 09:11:55 -0700
commit3b4c3898771ac5e774bca9445a5a4a81670b7b17 (patch)
treef9fa4a3fefaf845859b7120041ae4efb1d62c078 /src/cuda-sim/cuda-sim.cc
parentc875860b1a79d3dc828275b6129c92f154b516e1 (diff)
reverted cuda8 changes (extra fields) and assert texture bug fix's assumption
Diffstat (limited to 'src/cuda-sim/cuda-sim.cc')
-rw-r--r--src/cuda-sim/cuda-sim.cc59
1 files changed, 1 insertions, 58 deletions
diff --git a/src/cuda-sim/cuda-sim.cc b/src/cuda-sim/cuda-sim.cc
index 656091c..946043a 100644
--- a/src/cuda-sim/cuda-sim.cc
+++ b/src/cuda-sim/cuda-sim.cc
@@ -26,10 +26,6 @@
// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef VERSION_EIGHT
-#define VERSION_EIGHT
-#endif
-
#include "cuda-sim.h"
#include "instructions.h"
@@ -108,16 +104,6 @@ static address_type get_converge_point(address_type pc);
void gpgpu_t::gpgpu_ptx_sim_bindNameToTexture(const char* name, const struct textureReference* texref, int dim, int readmode, int ext)
{
-
-//#ifdef VERSION_EIGHT
-// int i;
-// printf("%s ", name);
-// printf("__cudaReserved:");
-// for (i = 0; i<15; i++){
-// printf(" %i", texref->__cudaReserved[i]);
-// }
-// printf("\n");
-//#endif
std::string texname(name);
m_NameToTextureRef[texname] = texref;
const textureReferenceAttr *texAttr = new textureReferenceAttr(texref, dim, (enum cudaTextureReadMode)readmode, ext);
@@ -154,50 +140,7 @@ unsigned int intLOGB2( unsigned int v ) {
void gpgpu_t::gpgpu_ptx_sim_bindTextureToArray(const struct textureReference* texref, const struct cudaArray* array)
{
-//#ifdef VERSION_EIGHT
-// int i;
-// printf("__cudaReserved:");
-// for (i = 0; i<15; i++){
-// printf(" %i", texref->__cudaReserved[i]);
-// }
-// printf("\n");
-//#endif
- // counts number of matches
-// int trMatches = 0;
-// for (auto& kv : m_NameToTextureRef){
-// const struct textureReference* tr = kv.second;
-// if (tr->normalized==texref->normalized&&
-// tr->filterMode==texref->filterMode&&
-// tr->addressMode[0]==texref->addressMode[0]&&
-// tr->addressMode[1]==texref->addressMode[1]&&
-// tr->addressMode[2]==texref->addressMode[2]&&
-// tr->channelDesc.x==texref->channelDesc.x&&
-// tr->channelDesc.y==texref->channelDesc.y&&
-// tr->channelDesc.z==texref->channelDesc.z&&
-// tr->channelDesc.w==texref->channelDesc.w&&
-// tr->channelDesc.f==texref->channelDesc.f){
-//
-// m_TextureRefToCudaArray[tr] = array;
-// trMatches++;
-// }
-// }
-// printf("GPGPU-Sim PTX: matches to texref = %d\n", trMatches);
-// assert(trMatches==1);
-
- //tests if texref pointer matches any pointer in m_NameToTextureRef map
- int trMatches = 0;
- for (std::map<std::string,const struct textureReference*>::const_iterator kv = m_NameToTextureRef.begin(); kv!= m_NameToTextureRef.end(); kv ++){
- const struct textureReference* tr = kv->second;
- if (tr==texref){
- m_TextureRefToCudaArray[tr] = array;
- printf("%s\n", kv->first.c_str());
- trMatches++;
- }
- }
- printf("GPGPU-Sim PTX: matches to texref = %d\n", trMatches);
- //assert(trMatches==1);
-
- //m_TextureRefToCudaArray[texref] = array;
+ m_TextureRefToCudaArray[texref] = array;
unsigned int texel_size_bits = array->desc.w + array->desc.x + array->desc.y + array->desc.z;
unsigned int texel_size = texel_size_bits/8;
unsigned int Tx, Ty;