SWDEV-353548 - assert with different behavior for Release vs Debug

assert statement behavior
-Debug: crashes tests with SIGABORT
-Release: continues silently without

Change-Id: I7578eb16a7391ff7f9d68f1cae3bcea7f8225579
This commit is contained in:
Ajay
2022-09-21 19:50:06 +00:00
committed by Ajay GunaShekar
parent 7ef4eada54
commit be80bf5406
4 changed files with 19 additions and 32 deletions
+12 -24
View File
@@ -70,8 +70,7 @@ cl_channel_type getCLChannelType(const hipArray_Format hipFormat,
}
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -89,8 +88,7 @@ cl_channel_order getCLChannelOrder(const unsigned int hipNumChannels,
break;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -131,8 +129,7 @@ cl_addressing_mode getCLAddressingMode(const hipTextureAddressMode hipAddressMod
return CL_ADDRESS_CLAMP;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -145,8 +142,7 @@ cl_filter_mode getCLFilterMode(const hipTextureFilterMode hipFilterMode) {
return CL_FILTER_LINEAR;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -161,8 +157,7 @@ cl_mem_object_type getCLMemObjectType(const hipResourceType hipResType) {
break;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -205,8 +200,7 @@ size_t getElementSize(const hipArray_const_t array) {
return 4 * array->NumChannels;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -288,8 +282,7 @@ hipChannelFormatDesc getChannelFormatDesc(int numChannels,
}
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -356,8 +349,7 @@ hipArray_Format getArrayFormat(const hipChannelFormatDesc& desc) {
break;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -395,8 +387,7 @@ int getNumChannels(const hipResourceViewFormat hipFormat) {
break;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -439,8 +430,7 @@ hipArray_Format getArrayFormat(const hipResourceViewFormat hipFormat) {
break;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -535,8 +525,7 @@ hipResourceViewFormat getResourceViewFormat(const hipChannelFormatDesc& desc) {
break;
}
ShouldNotReachHere();
//error scenario
return {};
}
@@ -604,8 +593,7 @@ std::pair<hipMemoryType, hipMemoryType> getMemoryType(const hipMemcpyKind kind)
return {hipMemoryTypeUnified, hipMemoryTypeUnified};
}
ShouldNotReachHere();
//error scenario
return {};
}
+2 -2
View File
@@ -291,7 +291,7 @@ hipError_t hipGraphMemcpyNode::ValidateParams(const hipMemcpy3DParms* pNodeParam
return status;
}
} else {
ShouldNotReachHere();
return hipErrorInvalidValue;
}
return hipSuccess;
}
@@ -469,7 +469,7 @@ hipError_t hipGraphMemcpyNode::SetCommandParams(const hipMemcpy3DParms* pNodePar
amd::CopyMemoryCommand* command = reinterpret_cast<amd::CopyMemoryCommand*>(commands_[0]);
command->setParams(*srcImage, *dstImage, srcOrigin, dstOrigin, copyRegion);
} else {
ShouldNotReachHere();
return hipErrorInvalidValue;
}
return hipSuccess;
}
+2 -2
View File
@@ -873,7 +873,7 @@ amd::Image* ihipImageCreate(const cl_channel_order channelOrder,
imageSlicePitch);
break;
default:
ShouldNotReachHere();
LogPrintfError("Cannot create image of imageType: 0x%x \n", imageType);
}
} else {
switch (imageType) {
@@ -916,7 +916,7 @@ amd::Image* ihipImageCreate(const cl_channel_order channelOrder,
numMipLevels);
break;
default:
ShouldNotReachHere();
LogPrintfError("Cannot create image of imageType: 0x%x \n", imageType);
}
}
+3 -4
View File
@@ -248,10 +248,9 @@ hipError_t ihipCreateTextureObject(hipTextureObject_t* pTexObject,
}
break;
}
case hipResourceTypeMipmappedArray: {
ShouldNotReachHere();
break;
}
case hipResourceTypeMipmappedArray:
return hipErrorInvalidValue;
case hipResourceTypeLinear: {
const cl_channel_order channelOrder = hip::getCLChannelOrder(hip::getNumChannels(pResDesc->res.linear.desc), pTexDesc->sRGB);
const cl_channel_type channelType = hip::getCLChannelType(hip::getArrayFormat(pResDesc->res.linear.desc), pTexDesc->readMode);