hipBindTexture() should handle nullptr offset.

If a user passes a ptr that was allocated by hipMalloc(), the offset is guaranteed to be 0 and NULL may be passed as the offset parameter. We shouldn't return an error in this case.

Change-Id: I4a8d645121e5a17d5e2861a0629356a3599de9ee
This commit is contained in:
Vladislav Sytchenko
2020-02-25 13:50:34 -05:00
parent 92b9a4466e
commit ccc73a9fb4
+2 -4
View File
@@ -388,8 +388,7 @@ hipError_t ihipBindTexture(size_t* offset,
const hipChannelFormatDesc* desc,
size_t size,
hipTextureReadMode readMode) {
if ((offset == nullptr) ||
(texref == nullptr) ||
if ((texref == nullptr) ||
(devPtr == nullptr) ||
(desc == nullptr)) {
return hipErrorInvalidValue;
@@ -426,8 +425,7 @@ hipError_t ihipBindTexture2D(size_t* offset,
size_t height,
size_t pitch,
hipTextureReadMode readMode) {
if ((offset == nullptr) ||
(texref == nullptr) ||
if ((texref == nullptr) ||
(devPtr == nullptr) ||
(desc == nullptr)) {
return hipErrorInvalidValue;