SWDEV-299966 - Fix hipModuleGetTexRef

hipModuleGetTexRef() returns success for any global device
variable name even if it's not a texture.
This is wrong thus will fail "hipModuleTexture2dDrv --tests 0x14"
This patch will compare the size to overcome this issue somehow.

Change-Id: I4a4d96f947a68713036437ee525359ff412fefe2
Этот коммит содержится в:
Tao Sang authored and Tao Sang committed 2021-08-30 10:30:52 -04:00
1 родитель 037f161f2e
Коммит 3f1cb97306
1 file changed
+4
+4
Просмотреть файл
@@ -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<char>();
*texRef = reinterpret_cast<textureReference*>(dvar->shadowVptr);
return hipSuccess;