diff --git a/driverapi/internal/cmdqueue.h b/driverapi/internal/cmdqueue.h index d8a43a7..cfb683f 100644 --- a/driverapi/internal/cmdqueue.h +++ b/driverapi/internal/cmdqueue.h @@ -38,7 +38,7 @@ struct CommandQueuePage { /** * Pointer into commandQueuePage. Commands are mem-copied in appending fashion into the command queue page and - * commandWritePtr is used to keep track of the current offset from the base pointer. + * commandWritePtr is used to keep trackFlops of the current offset from the base pointer. */ uint64_t commandWriteIdx = 0; @@ -194,7 +194,7 @@ class NvCommandQueue { libreCudaStatus_t waitForEvent(LibreCUEvent event); - libreCudaStatus_t getEventTimestamp(LibreCUEvent event, uint64_t *pTimestampOut); + static libreCudaStatus_t getEventTimestamp(LibreCUEvent event, uint64_t *pTimestampOut); private: diff --git a/driverapi/src/cmdqueue.cpp b/driverapi/src/cmdqueue.cpp index 47cd96b..6711434 100644 --- a/driverapi/src/cmdqueue.cpp +++ b/driverapi/src/cmdqueue.cpp @@ -944,10 +944,10 @@ libreCudaStatus_t NvCommandQueue::getEventTimestamp(LibreCUEvent event, uint64_t LIBRECUDA_VALIDATE(pTimestampOut != nullptr, LIBRECUDA_ERROR_INVALID_VALUE); LIBRECUDA_VALIDATE(event->stream != nullptr, LIBRECUDA_ERROR_INVALID_VALUE); LIBRECUDA_VALIDATE(event->computeSignal != nullptr || event->dmaSignal != nullptr, LIBRECUDA_ERROR_INVALID_VALUE); - if (currentQueueType == COMPUTE) { + if (event->computeSignal != nullptr) { LIBRECUDA_VALIDATE(event->computeSignal->value == 1, LIBRECUDA_ERROR_NOT_READY); // event was not hit yet *pTimestampOut = event->computeSignal->time_stamp; - } else if (currentQueueType == DMA) { + } else if (event->dmaSignal != nullptr) { LIBRECUDA_VALIDATE(event->dmaSignal->value == 1, LIBRECUDA_ERROR_NOT_READY); // event was not hit yet *pTimestampOut = event->dmaSignal->time_stamp; }