Skip to content

Commit

Permalink
TODO: capture Status none
Browse files Browse the repository at this point in the history
  • Loading branch information
pvelesko committed Dec 5, 2024
1 parent ffc06b1 commit 96835b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/CHIPBackend.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2150,6 +2150,7 @@ public:
*/
template <class GraphNodeType, class... ArgTypes>
bool captureIntoGraph(ArgTypes... ArgsPack) {
assert(getCaptureStatus() == hipStreamCaptureStatusNone);
if (getCaptureStatus() == hipStreamCaptureStatusActive) {
auto Graph = getCaptureGraph();
auto Node = new GraphNodeType(ArgsPack...);
Expand All @@ -2165,7 +2166,8 @@ public:

hipStreamCaptureStatus getCaptureStatus() const { return CaptureStatus_; }
void setCaptureStatus(hipStreamCaptureStatus CaptureMode) {
CaptureStatus_ = CaptureMode;
assert(CaptureStatus_ == hipStreamCaptureStatusNone);
// CaptureStatus_ = CaptureMode;
}
hipStreamCaptureMode getCaptureMode() const { return CaptureMode_; }
void setCaptureMode(hipStreamCaptureMode CaptureMode) {
Expand Down
2 changes: 2 additions & 0 deletions src/CHIPBindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2532,6 +2532,7 @@ static inline hipError_t hipMemcpyAsyncInternal(void *Dst, const void *Src,
NULLCHECK(Dst, Src);

auto ChipQueue = Backend->findQueue(static_cast<chipstar::Queue *>(Stream));
assert(ChipQueue->getCaptureStatus() == hipStreamCaptureStatusNone);
checkMemcpyKind(*ChipQueue->getDevice(), Kind);
LOCK(ChipQueue->QueueMtx);

Expand Down Expand Up @@ -3322,6 +3323,7 @@ hipStreamCreateWithPriorityInternal(hipStream_t *Stream, unsigned int Flags,
auto ClampedPriority = std::min(MinPriority, std::max(MaxPriority, Priority));
chipstar::Queue *ChipQueue =
Dev->createQueueAndRegister(FlagsParsed, ClampedPriority);
assert(ChipQueue->getCaptureStatus() == hipStreamCaptureStatusNone);
*Stream = ChipQueue;
return hipSuccess;
}
Expand Down

0 comments on commit 96835b0

Please sign in to comment.