SWDEV-323472 - Add hipThreadExchangeStreamCaptureMode

Also fix an issue in hip_prof_gen.py with GLenum.

Change-Id: Ib03fe9dae87b850c53b7d8aeb78b8dbdd01f794c
This commit is contained in:
Christophe Paquot
2022-02-18 16:12:12 -08:00
committed by Saleel Kudchadker
parent a3f4d9410c
commit 27f102b167
6 changed files with 50 additions and 59 deletions
+17
View File
@@ -695,6 +695,23 @@ hipError_t hipStreamIsCapturing(hipStream_t stream, hipStreamCaptureStatus* pCap
HIP_RETURN(hipSuccess);
}
hipError_t hipThreadExchangeStreamCaptureMode(hipStreamCaptureMode* mode) {
HIP_INIT_API(hipThreadExchangeStreamCaptureMode, mode);
if (mode == nullptr ||
*mode < hipStreamCaptureModeGlobal ||
*mode > hipStreamCaptureModeRelaxed ||
g_captureStreams.size() == 0) {
HIP_RETURN(hipErrorInvalidValue);
}
hipStreamCaptureMode oldMode = reinterpret_cast<hip::Stream*>(g_captureStreams[0])->GetCaptureMode();
reinterpret_cast<hip::Stream*>(g_captureStreams[0])->SetCaptureMode(*mode);
*mode = oldMode;
HIP_RETURN_DURATION(hipSuccess);
}
hipError_t hipStreamBeginCapture(hipStream_t stream, hipStreamCaptureMode mode) {
HIP_INIT_API(hipStreamBeginCapture, stream, mode);
if (!hip::isValid(stream)) {