-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[hip] Log a message if we are going to do a context switch.
Signed-off-by: Andrew Woloszyn <[email protected]>
- Loading branch information
Showing
11 changed files
with
100 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2024 The IREE Authors | ||
// | ||
// Licensed under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
#ifndef IREE_HAL_DRIVERS_HIP_CONTEXT_UTIL_H_ | ||
#define IREE_HAL_DRIVERS_HIP_CONTEXT_UTIL_H_ | ||
|
||
#include "iree/base/api.h" | ||
#include "iree/hal/drivers/hip/dynamic_symbols.h" | ||
#include "iree/hal/drivers/hip/status_util.h" | ||
|
||
static inline iree_status_t iree_hal_hip_set_context( | ||
const iree_hal_hip_dynamic_symbols_t* syms, hipCtx_t hip_context) { | ||
IREE_TRACE({ | ||
hipCtx_t current_context = NULL; | ||
IREE_HIP_RETURN_IF_ERROR(syms, hipCtxGetCurrent(¤t_context), | ||
"hipCtxGetCurrent"); | ||
if (current_context != hip_context) { | ||
IREE_TRACE_MESSAGE(INFO, "Hip Context Switch"); | ||
} | ||
}); | ||
return IREE_HIP_RESULT_TO_STATUS(syms, hipCtxSetCurrent(hip_context)); | ||
} | ||
|
||
#endif // IREE_HAL_DRIVERS_HIP_CONTEXT_UTIL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.