Files
TheRock/rocm-systems/projects/rocprofiler-systems/external/timemory/examples
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00
..

Examples

Examples demonstrating the usage of timemory features, components, dynamic instrumentation, python bindings and profiling support.

Build

See examples. To build examples along with timemory build using cmake, enable the cmake -DTIMEMORY_BUILD_EXAMPLES=ON. If using spack based install, use the +examples flag in the spack install command.

Description

The examples demonstrate the use of timemory components and features in both C/C++ and Python. Several basic, intermediate and advanced level examples demonstrating basic instrumentation to advanced features such as MPI, kokkos, likwid, caliper, dyninst support are presented. The subsequent sections provide an overview of each example functionality.

ex-c

Demonstrates the basic use of timemory timing instrumentation (timers) in C.

ex-caliper

Demonstrates an example of instrumentation using caliper markers.

ex-cpu-roofline

Demonstrates an example of executing a set of benchmarks on CPU for roofline analysis and plotting.

ex-cuda-event

Demonstrates an example of measuring CPU and CPU events such as cpu-malloc, gpu-malloc, assign and so on using cuda events, cupti counters and events and auto tuple of timemory components.

ex-custom-dynamic-instr

Demonstrates an example of implementing a custom instrumentation library which can be used for dynamic instrumentation using timemory-run tool. For documentation on timemory-run, dynamic instrumentation, refer to timemory-run.

ex-cxx-basic

Demonstrates an example of basic timemory instrumentation in C++.

ex-cxx-overhead

Demonstrates an example of quanitfication of instrumentation overhead (both time and memory) of timemory.

ex-cxx-tuple

Demonstrates an example of usage of auto tuple, component tuple and papi tuple for performance measurements.

ex-derived

Demonstrates an example where a custom (derived) component is created from existing timemory components and then used in auto tuple and auto list for performance measurement.

ex-ert

Demonstrates an example of usage of the empirical roofline toolkit (ERT) component for running microkernels and generation of performance data for roofline analysis with and without using Kokkos.

ex-gotcha

Demonstrates examples of wrapping the C standard library function puts and MPI function calls using GOTCHA and instrumenting them using timemory.

ex-gpu-roofline

Demonstrates an example of executing a set of benchmarks on GPU for roofline analysis and plotting (requires CUDA and CUPTI support).

ex-likwid

Demonstrates an example of performance measurement using likwid markers in C++ and Python.

ex-minimal

Demonstrates an example of basic timemory timing measurement, usage of timemory library, and timemory library overload.

ex-optional

Demonstrates examples where the timemory is optionally enabled/disabled in either normal of MPI based computations.

ex-python

Demonstrate examples of timemory usage in Python such as profiling, component bundles, MPI instrumentation, python bindings, and generic instrumentation.

ex-statistics

Demonstrates an example of generation of flat measurements and statistics from component measurements by setting appropriate component traits.