mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-11-01 00:21:29 +01:00
Make room for probes of other CUDA classes. common.py and gpu_span.py stay in perf/ and become shared; the cluster-finder driver, traced process, README and results move to perf/cf/. - common.py: assert_build_fresh() takes the header list, capture_env() takes extra fields, results_dir() takes the probe folder. - cf/cf_common.py: pedestal frames, n_sigma, rebuild-guard headers, DEVICE_PED_TYPE and the <date>_<f32|f64> results naming. - gpu_span.py: optional kernel-name filter; tolerates an engine with no ops. Output without a filter is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
1.2 KiB
Python
36 lines
1.2 KiB
Python
"""ClusterFinderCUDA-specific settings for the probes in this folder.
|
|
|
|
Importing this module also makes ../common.py and ../gpu_span.py importable.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
HERE = Path(__file__).resolve().parent
|
|
sys.path.insert(0, str(HERE.parent))
|
|
import common # noqa: E402
|
|
|
|
N_PEDESTAL_FRAMES = 1000
|
|
N_SIGMA = 5
|
|
|
|
# Rebuild-guard: the extension must be newer than all of these.
|
|
HEADERS = ["include/aare/cf/clusterfinder_kernel.cuh",
|
|
"include/aare/cf/clusterfinder_algo.cuh",
|
|
"include/aare/cf/ClusterFinderCUDA.hpp"]
|
|
|
|
|
|
def device_ped_type() -> str:
|
|
"""DEVICE_PED_TYPE from the kernel header (the float/double build axis)."""
|
|
hdr = common.REPO / "include/aare/cf/clusterfinder_kernel.cuh"
|
|
for line in hdr.read_text().splitlines()[:40]:
|
|
if "using DEVICE_PED_TYPE" in line and not line.strip().startswith("//"):
|
|
return line.split("=")[1].split(";")[0].strip()
|
|
return "unknown"
|
|
|
|
|
|
def results_dir(tag: str = "") -> Path:
|
|
"""cf/results/<date>_<f32|f64>[_tag]/"""
|
|
short = {"float": "f32", "double": "f64"}.get(device_ped_type(), "unk")
|
|
return common.results_dir(HERE, short, tag)
|