From 687298ba1c8cffa06ddc715cca80862e87c3fed5 Mon Sep 17 00:00:00 2001 From: Ajay Date: Fri, 11 Feb 2022 19:26:33 +0000 Subject: [PATCH] SWDEV-314982 - hipStreamGetCaptureInfo negative cases Change-Id: I98a65fc60610f89184b54152c8e33f59d74e3850 [ROCm/clr commit: 0e94178c03960d5d52e9dd6edff62f5bb369b7e8] --- projects/clr/hipamd/src/hip_graph.cpp | 6 +++--- projects/clr/hipamd/src/hip_internal.hpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index 873ecaee22..f73584ed07 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -1160,16 +1160,16 @@ hipError_t hipGraphExecChildGraphNodeSetParams(hipGraphExec_t hGraphExec, hipGra hipError_t hipStreamGetCaptureInfo(hipStream_t stream, hipStreamCaptureStatus* pCaptureStatus, unsigned long long* pId) { HIP_INIT_API(hipStreamGetCaptureInfo, stream, pCaptureStatus, pId); - if (pCaptureStatus == nullptr || pId == nullptr || !hip::isValid(stream)) { + if (pCaptureStatus == nullptr || !hip::isValid(stream)) { HIP_RETURN(hipErrorInvalidValue); } if (stream == nullptr) { - HIP_RETURN(hipErrorStreamCaptureImplicit); + HIP_RETURN(hipErrorUnknown); } hip::Stream* s = reinterpret_cast(stream); *pCaptureStatus = s->GetCaptureStatus(); if (*pCaptureStatus == hipStreamCaptureStatusActive) { - *pId = s->GetCaptureID(); + pId = reinterpret_cast(s->GetCaptureID()); } HIP_RETURN(hipSuccess); } diff --git a/projects/clr/hipamd/src/hip_internal.hpp b/projects/clr/hipamd/src/hip_internal.hpp index 519e1c206b..606fa02f29 100644 --- a/projects/clr/hipamd/src/hip_internal.hpp +++ b/projects/clr/hipamd/src/hip_internal.hpp @@ -308,12 +308,12 @@ namespace hip { /// Get parent stream hipStream_t GetParentStream() const { return parentStream_; } /// Generate ID for stream capture unique over the lifetime of the process - static int GenerateCaptureID() { + static unsigned long long GenerateCaptureID() { static std::atomic uid(0); return ++uid; } /// Get Capture ID - int GetCaptureID() { return captureID_; } + unsigned long long GetCaptureID() { return captureID_; } void SetCaptureEvent(hipEvent_t e) { captureEvents_.push_back(e); } void SetParallelCaptureStream(hipStream_t s) { parallelCaptureStreams_.push_back(s); } };