From 0ec64e8b24bd7dc4e4074e9e2fbb0da19073934f Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Tue, 24 Jul 2018 10:11:26 +0530 Subject: [PATCH 1/2] Set offset in hipGetTextureAlignmentOffset --- hipamd/src/hip_texture.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/hipamd/src/hip_texture.cpp b/hipamd/src/hip_texture.cpp index d6caf853de..8b335f336f 100644 --- a/hipamd/src/hip_texture.cpp +++ b/hipamd/src/hip_texture.cpp @@ -676,6 +676,7 @@ hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* auto ctx = ihipGetTlsDefaultCtx(); if (ctx) { + *offset = 0; } return ihipLogStatus(hip_status); } From f17c897751690b5f51ac929980d0396f6d0cd64f Mon Sep 17 00:00:00 2001 From: Rahul Garg Date: Tue, 24 Jul 2018 12:25:40 +0530 Subject: [PATCH 2/2] Null check before setting offset --- hipamd/src/hip_texture.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hipamd/src/hip_texture.cpp b/hipamd/src/hip_texture.cpp index 8b335f336f..82bc5b5d8a 100644 --- a/hipamd/src/hip_texture.cpp +++ b/hipamd/src/hip_texture.cpp @@ -676,7 +676,8 @@ hipError_t hipGetTextureAlignmentOffset(size_t* offset, const textureReference* auto ctx = ihipGetTlsDefaultCtx(); if (ctx) { - *offset = 0; + if(offset != nullptr) + *offset = 0; } return ihipLogStatus(hip_status); }