From a48e08fa4fd766dd67bd29497def7da820c58cf4 Mon Sep 17 00:00:00 2001 From: Andrew Woloszyn Date: Tue, 12 Nov 2024 20:52:27 -0500 Subject: [PATCH] Only set the hip context if it is valid. --- runtime/src/iree/hal/drivers/hip/context_util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runtime/src/iree/hal/drivers/hip/context_util.h b/runtime/src/iree/hal/drivers/hip/context_util.h index 099da8fec5a95..1aa1d79b4c28f 100644 --- a/runtime/src/iree/hal/drivers/hip/context_util.h +++ b/runtime/src/iree/hal/drivers/hip/context_util.h @@ -13,6 +13,9 @@ static inline iree_status_t iree_hal_hip_set_context( const iree_hal_hip_dynamic_symbols_t* syms, hipCtx_t hip_context) { + if (!hip_context) { + return iree_ok_status(); + } IREE_TRACE({ hipCtx_t current_context = NULL; IREE_HIP_RETURN_IF_ERROR(syms, hipCtxGetCurrent(¤t_context),