Skip to content

Commit

Permalink
[cuda][hip] Fixed tracing when device tracing is disabled at runtime (#…
Browse files Browse the repository at this point in the history
…18171)

Fixes a crash if `--hip_tracing=false` or `--cuda_tracing=false` at
runtime while iree was compiled with
`IREE_ENABLE_RUNTIME_TRACING=ON`.

Signed-off-by: Andrew Woloszyn <[email protected]>
  • Loading branch information
AWoloszyn authored Aug 15, 2024
1 parent b144e90 commit 3f97c02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions runtime/src/iree/hal/drivers/cuda/tracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ void iree_hal_cuda_stream_tracing_zone_begin_impl(
iree_hal_cuda_tracing_context_t* context,
iree_hal_cuda_tracing_context_event_list_t* event_list, CUstream stream,
const iree_tracing_location_t* src_loc) {
IREE_ASSERT_ARGUMENT(context);
if (!context) return;
uint16_t query_id = iree_hal_cuda_stream_tracing_context_insert_query(
context, event_list, stream);
iree_tracing_gpu_zone_begin(context->id, query_id, src_loc);
Expand All @@ -439,7 +439,7 @@ void iree_hal_cuda_stream_tracing_zone_begin_external_impl(
const char* file_name, size_t file_name_length, uint32_t line,
const char* function_name, size_t function_name_length, const char* name,
size_t name_length) {
IREE_ASSERT_ARGUMENT(context);
if (!context) return;
uint16_t query_id = iree_hal_cuda_stream_tracing_context_insert_query(
context, event_list, stream);
iree_tracing_gpu_zone_begin_external(context->id, query_id, file_name,
Expand Down
4 changes: 2 additions & 2 deletions runtime/src/iree/hal/drivers/hip/tracing.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ void iree_hal_hip_stream_tracing_zone_begin_impl(
iree_hal_hip_tracing_context_t* context,
iree_hal_hip_tracing_context_event_list_t* event_list, hipStream_t stream,
const iree_tracing_location_t* src_loc) {
IREE_ASSERT_ARGUMENT(context);
if (!context) return;
uint16_t query_id = iree_hal_hip_stream_tracing_context_insert_query(
context, event_list, stream);
iree_tracing_gpu_zone_begin(context->id, query_id, src_loc);
Expand All @@ -438,7 +438,7 @@ void iree_hal_hip_stream_tracing_zone_begin_external_impl(
const char* file_name, size_t file_name_length, uint32_t line,
const char* function_name, size_t function_name_length, const char* name,
size_t name_length) {
IREE_ASSERT_ARGUMENT(context);
if (!context) return;
uint16_t query_id = iree_hal_hip_stream_tracing_context_insert_query(
context, event_list, stream);
iree_tracing_gpu_zone_begin_external(context->id, query_id, file_name,
Expand Down

0 comments on commit 3f97c02

Please sign in to comment.