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


[ROCm/hip commit: ccc73a9fb4]
이 커밋은 다음에 포함됨:
Vladislav Sytchenko
2020-02-25 13:50:34 -05:00
부모 336baa6ae1
커밋 b13baaf346
+2 -4
파일 보기
@@ -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;