Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/sol_execbench/core/bench/cupti_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ def set_kernel_name(activity):
return "MEMCPY"
if activity.kind == cupti.ActivityKind.MEMSET:
return "MEMSET"
return None
# Activities such as RUNTIME or DRIVER may not provide a name. Fall
# back to a stable string so callers always receive a `str`.
return getattr(activity, "name", None) or str(activity.kind)

@staticmethod
def get_bytes(activity):
Expand Down
28 changes: 28 additions & 0 deletions tests/core/bench/test_cupti_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""Tests for CUPTI activity normalization helpers."""

import types
import pytest

from sol_execbench.core.bench.cupti_utils import CuptiKernelInfo


def test_kernel_string_for_activity_without_name():
"""Unexpected activity kinds without a name must still produce a string identity."""
activity = types.SimpleNamespace(
kind="RUNTIME",
name=None,
start=0.0,
end=1.0,
correlation_id=0,
bytes=0,
copy_kind=0,
value=0,
)
info = CuptiKernelInfo.from_activity(activity)
assert isinstance(info.name, str)
assert info.kernel_string() == "RUNTIME_0_0_0_RUNTIME"