diff --git a/hipamd/src/hip_platform.cpp b/hipamd/src/hip_platform.cpp index bc45c970dd..800e9c180a 100644 --- a/hipamd/src/hip_platform.cpp +++ b/hipamd/src/hip_platform.cpp @@ -875,6 +875,10 @@ hipError_t PlatformState::getDynTexRef(const char* hostVar, hipModule_t hmod, te hip::DeviceVar* dvar = nullptr; IHIP_RETURN_ONFAIL(it->second->getDeviceVar(&dvar, hostVar)); + if (dvar->size() != sizeof(textureReference)) { + return hipErrorNotFound; // Any better way to verify texture type? + } + dvar->shadowVptr = new texture(); *texRef = reinterpret_cast(dvar->shadowVptr); return hipSuccess;