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
Este commit está contenido en:
Vladislav Sytchenko
2020-02-25 13:50:34 -05:00
padre d5938efcce
commit fd76d220a5
+2 -4
Ver fichero
@@ -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;