From cfdc9dfc36218582a554b10e94d88a8e7b00f791 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 7d3c0c5e1064b25e025bc514952af9a2cc031e7e. 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 --- hipamd/src/hip_texture.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/hipamd/src/hip_texture.cpp b/hipamd/src/hip_texture.cpp index ec83a12622..31a9430722 100644 --- a/hipamd/src/hip_texture.cpp +++ b/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);