From 2e7581a69a02df055a8b52e89b7c94989d04d183 Mon Sep 17 00:00:00 2001 From: Marko Arandjelovic Date: Mon, 17 Jun 2024 13:16:44 +0200 Subject: [PATCH] SWDEV-441296 - Allign hipTexObjectCreate error handling to CUDA Change-Id: I9ff01c22f14344e0e82e473104d6930e9fa5ff77 [ROCm/clr commit: 7d3c0c5e1064b25e025bc514952af9a2cc031e7e] --- projects/clr/hipamd/src/hip_texture.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/projects/clr/hipamd/src/hip_texture.cpp b/projects/clr/hipamd/src/hip_texture.cpp index df34da0669..3d2d184dbc 100644 --- a/projects/clr/hipamd/src/hip_texture.cpp +++ b/projects/clr/hipamd/src/hip_texture.cpp @@ -1513,8 +1513,12 @@ hipError_t hipTexObjectCreate(hipTextureObject_t* pTexObject, const HIP_RESOURCE_VIEW_DESC* pResViewDesc) { HIP_INIT_API(hipTexObjectCreate, pTexObject, pResDesc, pTexDesc, pResViewDesc); - if ((pTexObject == nullptr) || (pResDesc == nullptr) || (pTexDesc == nullptr)) { - HIP_RETURN(hipErrorInvalidValue); + if (pTexObject == nullptr) { + HIP_RETURN(hipErrorNotInitialized); + } + + if (pResDesc == nullptr || pTexDesc == nullptr) { + HIP_RETURN(hipErrorInvalidContext); } hipResourceDesc resDesc = hip::getResourceDesc(*pResDesc);