CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
81 lines
2.4 KiB
Python
81 lines
2.4 KiB
Python
#!/usr/bin/env python3
|
|
|
|
import csv
|
|
import json
|
|
import os
|
|
import pytest
|
|
|
|
from rocprofiler_sdk.pytest_utils.dotdict import dotdict
|
|
from rocprofiler_sdk.pytest_utils import collapse_dict_list
|
|
from rocprofiler_sdk.pytest_utils.perfetto_reader import PerfettoReader
|
|
from rocprofiler_sdk.pytest_utils.otf2_reader import OTF2Reader
|
|
|
|
|
|
def pytest_addoption(parser):
|
|
parser.addoption(
|
|
"--json-input",
|
|
action="store",
|
|
default="rocdecode-trace/rocdecode-demo-trace/out_results.json",
|
|
help="Input JSON",
|
|
)
|
|
parser.addoption(
|
|
"--otf2-input",
|
|
action="store",
|
|
default="rocdecode-trace/rocdecode-demo-trace/out_results.otf2",
|
|
help="Input OTF2",
|
|
)
|
|
parser.addoption(
|
|
"--pftrace-input",
|
|
action="store",
|
|
default="rocdecode-trace/rocdecode-demo-trace/out_results.pftrace",
|
|
help="Input pftrace file",
|
|
)
|
|
parser.addoption(
|
|
"--csv-input",
|
|
action="store",
|
|
default="rocdecode-trace/rocdecode-demo-trace/out_rocdecode_api_trace.csv",
|
|
help="Input CSV",
|
|
)
|
|
|
|
|
|
@pytest.fixture
|
|
def json_data(request):
|
|
filename = request.config.getoption("--json-input")
|
|
if not os.path.isfile(filename):
|
|
return pytest.skip("rocdecode tracing unavailable")
|
|
with open(filename, "r") as inp:
|
|
return dotdict(collapse_dict_list(json.load(inp)))
|
|
|
|
|
|
@pytest.fixture
|
|
def csv_data(request):
|
|
filename = request.config.getoption("--csv-input")
|
|
data = []
|
|
if not os.path.isfile(filename):
|
|
# The CSV file is not generated, because the dependency test
|
|
# responsible to generate this file was skipped or failed.
|
|
# Thus emit the message to skip this test as well.
|
|
return pytest.skip("rocdecode tracing unavailable")
|
|
else:
|
|
with open(filename, "r") as inp:
|
|
reader = csv.DictReader(inp)
|
|
for row in reader:
|
|
data.append(row)
|
|
return data
|
|
|
|
|
|
@pytest.fixture
|
|
def otf2_data(request):
|
|
filename = request.config.getoption("--otf2-input")
|
|
if not os.path.isfile(filename):
|
|
return pytest.skip("rocdecode tracing unavailable")
|
|
return OTF2Reader(filename).read()[0]
|
|
|
|
|
|
@pytest.fixture
|
|
def pftrace_data(request):
|
|
filename = request.config.getoption("--pftrace-input")
|
|
if not os.path.isfile(filename):
|
|
return pytest.skip("rocdecode tracing unavailable")
|
|
return PerfettoReader(filename).read()[0]
|