Fixed review comments

This commit is contained in:
Rahul Garg
2017-11-21 21:19:06 +05:30
parent 24307fe5c4
commit 38029f2849
4 changed files with 162 additions and 163 deletions
+12 -11
View File
@@ -841,17 +841,18 @@ hipError_t hipModuleLoadDataEx(hipModule_t *module, const void *image, unsigned
hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name)
{
HIP_INIT_API(texRef, hmod, name);
hipError_t ret = hipSuccess;
hipError_t ret = hipErrorNotFound;
if(texRef == NULL){
return ihipLogStatus(hipErrorInvalidValue);
}
if(name == NULL || hmod == NULL){
return ihipLogStatus(hipErrorNotInitialized);
}
else{
const auto it = hmod->coGlobals.find(name);
if (it == hmod->coGlobals.end()) return ihipLogStatus(hipErrorInvalidValue);
*texRef = reinterpret_cast<textureReference*>(it->second);
return ihipLogStatus(ret);
ret = hipErrorInvalidValue;
} else {
if(name == NULL || hmod == NULL){
ret = hipErrorNotInitialized;
} else{
const auto it = hmod->coGlobals.find(name);
if (it == hmod->coGlobals.end()) return ihipLogStatus(hipErrorInvalidValue);
*texRef = reinterpret_cast<textureReference*>(it->second);
ret = hipSuccess;
}
}
return ihipLogStatus(ret);
}