From a261d1f49c984a3fc35fc0b1484678aca9042c7d Mon Sep 17 00:00:00 2001 From: Marko Arandjelovic Date: Wed, 18 Sep 2024 05:09:41 -0400 Subject: [PATCH] Revert "SWDEV-441296 - Allign hipTexObjectCreate error handling to CUDA" This reverts commit 2e7581a69a02df055a8b52e89b7c94989d04d183. Changing the error code is considered as a breaking change, so it should be done in major releases only. The other reason for reverting the commit is that this change itself is incorrect. Cuda behaves in the same way as hip when pResDesc or pTexDesc are nullptr. Change-Id: I3abee6b79279b81ab01c7f8466c7f8e3776c4109 [ROCm/clr commit: cfdc9dfc36218582a554b10e94d88a8e7b00f791] --- projects/clr/hipamd/src/hip_texture.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/projects/clr/hipamd/src/hip_texture.cpp b/projects/clr/hipamd/src/hip_texture.cpp index ec83a12622..31a9430722 100644 --- a/projects/clr/hipamd/src/hip_texture.cpp +++ b/projects/clr/hipamd/src/hip_texture.cpp @@ -1521,12 +1521,8 @@ hipError_t hipTexObjectCreate(hipTextureObject_t* pTexObject, const HIP_RESOURCE_VIEW_DESC* pResViewDesc) { HIP_INIT_API(hipTexObjectCreate, pTexObject, pResDesc, pTexDesc, pResViewDesc); - if (pTexObject == nullptr) { - HIP_RETURN(hipErrorNotInitialized); - } - - if (pResDesc == nullptr || pTexDesc == nullptr) { - HIP_RETURN(hipErrorInvalidContext); + if ((pTexObject == nullptr) || (pResDesc == nullptr) || (pTexDesc == nullptr)) { + HIP_RETURN(hipErrorInvalidValue); } hipResourceDesc resDesc = hip::getResourceDesc(*pResDesc);