@@ -147,19 +147,23 @@ in the UMF repository.
147147
148148TODO
149149
150- CTL statistics example
150+ CTL example
151151==============================================================================
152152
153- You can find the full example code in the `examples/ctl/ctl_statistics_example.c `_ file
154- in the UMF repository.
153+ .. note ::
154+ The CTL API is experimental and may change in future releases.
155+
156+ You can find the full example code in the `examples/ctl/ctl.c `_ file in the
157+ UMF repository.
155158
156159The sample configures an OS memory provider and a disjoint pool, reuses the
157160provider's canonical ``OS `` selector obtained at runtime, assigns a custom pool
158161name, and then mixes ``by_handle `` and ``by_name `` selectors to explore CTL
159162statistics. Wildcard nodes are used to choose provider counters, build a
160163four-segment ``{}.{} `` chain for the named pool, reset the peak tracker, and
161- drill into per-bucket disjoint pool telemetry. The program prints hints on ``stderr ``
162- explaining which tracing level is necessary when a statistic is unavailable.
164+ drill into per-bucket disjoint pool telemetry. The program prints hints on
165+ ``stderr `` explaining which tracing level is necessary when a statistic is
166+ unavailable.
163167
164168Build and run the example with::
165169
@@ -176,6 +180,26 @@ Tracing level ``1`` enables slab usage counters, level ``2`` adds allocation
176180and free statistics, and level ``3 `` additionally emits verbose log messages
177181from the pool implementation.
178182
183+ Custom CTL example
184+ ==============================================================================
185+
186+ You can find the full example code in the `examples/ctl/custom_ctl.c `_ file in
187+ the UMF repository. The program implements a minimal memory provider with CTL
188+ hooks that accept configuration values, execute runnables, and expose provider
189+ state through the experimental API. It highlights converting wildcard segments
190+ to ``printf ``-style format strings and reading integers supplied via
191+ configuration defaults.
192+
193+ Build and run the example with::
194+
195+ cmake -B build
196+ cmake --build build
197+ ./build/examples/umf_example_ctl
198+
199+ Optionally supply a modulus via configuration defaults::
200+
201+ UMF_CONF="umf.provider.default.ctl.m=10" ./build/examples/umf_example_ctl
202+
179203IPC example with Level Zero Memory Provider
180204==============================================================================
181205The full code of the example is in the `examples/ipc_level_zero/ipc_level_zero.c `_ file in the UMF repository.
@@ -260,7 +284,8 @@ the :any:`umfCloseIPCHandle` function is called.
260284.. _examples/cuda_shared_memory/cuda_shared_memory.c : https://github.com/oneapi-src/unified-memory-framework/blob/main/examples/cuda_shared_memory/cuda_shared_memory.c
261285.. _examples/ipc_level_zero/ipc_level_zero.c : https://github.com/oneapi-src/unified-memory-framework/blob/main/examples/ipc_level_zero/ipc_level_zero.c
262286.. _examples/custom_file_provider/custom_file_provider.c : https://github.com/oneapi-src/unified-memory-framework/blob/main/examples/custom_file_provider/custom_file_provider.c
263- .. _examples/ctl/ctl_statistics_example.c : https://github.com/oneapi-src/unified-memory-framework/blob/main/examples/ctl/ctl_statistics_example.c
287+ .. _examples/ctl/ctl.c : https://github.com/oneapi-src/unified-memory-framework/blob/main/examples/ctl/ctl.c
288+ .. _examples/ctl/custom_ctl.c : https://github.com/oneapi-src/unified-memory-framework/blob/main/examples/ctl/custom_ctl.c
264289.. _examples/memspace : https://github.com/oneapi-src/unified-memory-framework/blob/main/examples/memspace/
265290.. _README : https://github.com/oneapi-src/unified-memory-framework/blob/main/README.md#memory-pool-managers
266291.. _umf/ipc.h : https://github.com/oneapi-src/unified-memory-framework/blob/main/include/umf/ipc.h
0 commit comments