API reference
The public API of ClikaRT is the ClikaRT:: namespace, declared by the headers under ClikaRT/. Include ClikaRT/clika_rt.h for everything, or the individual headers named on each page.
Namespaces
| Name | Description |
|---|---|
ClikaRT::cli | |
ClikaRT::device | |
ClikaRT::dtype | The dtype-system helpers: classification predicates, size arithmetic, and the readable name. DataType itself stays at ClikaRT:: (the one name every signature spells); everything ABOUT a dtype lives here. |
ClikaRT::encoding | |
ClikaRT::env | |
ClikaRT::graph | |
ClikaRT::http | |
ClikaRT::io | |
ClikaRT::json | |
ClikaRT::logging | |
ClikaRT::nn | |
ClikaRT::ops | |
ClikaRT::placement | |
ClikaRT::processor | |
ClikaRT::progress | |
ClikaRT::quant | The quantized-checkpoint import taxonomy: the parsed quantization_config facts and the routing enums the split factories consume. |
ClikaRT::regex | |
ClikaRT::runtime | |
ClikaRT::spec | |
ClikaRT::tables | |
ClikaRT::threading | |
ClikaRT::tokenizer |
Classes
| Name | Description |
|---|---|
Device | A compute device: a backend API plus a device index (e.g. the 1 in CUDA device 1). Default-constructs to the whole-machine host CPU. |
EagerScope | While alive, forces EAGER execution on the calling thread: every op runs its kernel and produces a real value before dispatch returns, even when nested inside a TracingScope. Use it to guard a region that must compute concrete values (a metric, a running average, a control-flow decision read back to the host) so a caller who wrapped the surrounding code in a TracingScope cannot turn those ops into un-materialized placeholders. Outside any scope execution is already eager, so this is a no-op there. Non-copyable, non-movable. |
Error | Thrown by the throwing API overloads and by Result::value_or_throw(). |
FakeTensor | A value type (no out-of-line surface): it holds a vector<spec::SymInt>, a dtype, a copyable Stream, and a flag, all ABI-stable, so it crosses by layout. |
NamedTensors | An insertion-agnostic name → Tensor map. Copyable and movable (a copy shares each entry's storage; the tensors are refcount handles). |
ProfileSession | A profiling session: start one or more captures, then export the results. Move-only. The session must outlive any in-flight async work it captured (workers that finish after a capture ends still record into it). |
ProfileSummary | The counters a session accumulated, as plain values: the typed form of ProfileSession::summary_text() and of the summary object in report.json, field for field, so a consumer reads numbers instead of parsing text. Durations are nanoseconds; counts are events recorded inside the session's captures. |
QTensor | A quantized weight, viewed with its scheme. A value type over a refcounted payload handle; copying a QTensor never copies weight bytes. |
Result | Holds either a success value of type T or a (Status, message) failure. Move-only. Check ok() before reading value(), or use value_or_throw(). [[nodiscard]]: a call that returns a Result and discards it swallows the failure it may carry; the compiler warns at such a site; consume it (unwrap, CLIKART_CHECK, a named read) or discard deliberately with a (void) cast. |
Result\<void\> | Outcome of a fallible operation that yields no value on success (e.g. registering a route, writing a file). Check ok(), or call value_or_throw() to raise ClikaRT::Error on failure in your own TU. [[nodiscard]]: a statement-position effect call that ignores its result swallows the failure; the compiler warns; consume it (CLIKART_CHECK, unwrap, a named read) or discard deliberately with a (void) cast. |
Scalar | A scalar operand that keeps its KIND across the boundary: a bool, an integer (any width, stays integral), or a double. What it buys over a bare double parameter: an integer scalar against an integer tensor stays in the integer domain (ops::sub(2, int64_tensor) is Int64, exact at any magnitude), where a double would force weak-float promotion. Every ctor is implicit on purpose. Pass the bare literal. Distinct from ScalarOrTensor: a Scalar never carries a tensor, which is what keeps a two-tensor call (ops::add(a, b)) unambiguous against the tensor-first overloads. |
ScalarOrTensor | A ClikaRT-level value type (NOT op-layer machinery): one optional slot that carries a scalar (double / integer) OR a tensor. Every ctor is implicit on purpose. Pass a bare double, an integer, a Tensor, or std::nullopt straight to a ScalarOrTensor parameter; spelling the wrap at a call site (ops::ScalarOrTensor(x)) is redundant noise. ops::ScalarOrTensor remains a valid spelling via the alias below. |
Span | A non-owning view over size() contiguous elements of T, the C++17 stand-in for std::span (see the file note above). It never allocates, copies, or owns: the viewed memory must outlive every copy of the view. T's constness is the access law: Span<const X> reads, Span<X> writes through to the caller's memory. |
Stream | A handle to a device execution stream. Cheap to copy (it is an identifier, not the stream's resources). |
StreamOrDevice | A value type: it holds a copyable Stream handle and/or a Device, so it crosses the ABI by layout; resolve_impl is its one library entry (the placement law lives in the runtime). |
SynchronousStreamScope | While alive, every op dispatched on the calling thread WAITS for completion before the dispatch call returns, and stream runs at most one task at a time, so the moment a dispatch returns, the result is ready (Stream::query_idle() is true). Deterministic, ideal for debugging / per-op stepping; it trades away the throughput that async pipelining buys. The stream's prior limit is restored on destruction. Open it only on a quiescent stream (synchronize first). Non-copyable, non-movable. |
Tensor | An N-dimensional tensor. Copyable and movable. |
TracingScope | While alive, the calling thread builds a LAZY graph: ops return Unscheduled placeholder tensors carrying lineage, and NO kernel runs. Call Tensor::synchronize() to materialize the graph in one pass. Outside the scope execution is eager (the default). Non-copyable, non-movable. |
Enumerations
enum Status
enum class Status : std::int32_t
Outcome of an operation.
| Enumerator | Value | Description |
|---|---|---|
Ok | 0 | |
InvalidArgument | ||
NotFound | ||
Unsupported | ||
Internal | ||
Unavailable | transient: the work was shed under load; retry later (HTTP 503) |
Declared in ClikaRT/common/result.h, line 92
enum DataType
enum class DataType : std::int32_t
The element format of a tensor's values.
int32-backed for a stable ABI. The set covers booleans, signed/unsigned integers (including sub-byte widths), the IEEE-style floats, and the narrow floating formats used by quantized models (FP8 / FP6 / FP4). Undefined is the unset value.
ABI note: the numeric values are part of the public ABI: new types append at the end; existing ones never reorder or drop.
| Enumerator | Value | Description |
|---|---|---|
Undefined | 0 | |
Bool | ||
Int2 | ||
Int4 | ||
Int8 | ||
Int16 | ||
Int32 | ||
Int64 | ||
UInt1 | ||
UInt2 | ||
UInt4 | ||
UInt8 | ||
UInt16 | ||
UInt32 | ||
UInt64 | ||
Float16 | ||
BFloat16 | ||
Float32 | ||
Float64 | ||
Float8_E4M3 | ||
Float8_E5M2 | ||
Float8_E4M3FNUZ | ||
Float8_E5M2FNUZ | ||
Float8_E8M0 | ||
Float6_E2M3 | ||
Float6_E3M2 | ||
Float4_E2M1 |
Declared in ClikaRT/compute/data_type.h, line 21
Type aliases
using OptionalTensor
using OptionalTensor = Tensor
A tensor argument that may be omitted. It is just Tensor; pass a default Tensor{} (an undefined tensor) to mean "not provided". The alias documents, at a signature, that the parameter is optional (e.g. a norm's weight/bias, an attention mask). Mirrors the role of c10::optional<Tensor> in ATen, using the undefined-tensor sentinel ClikaRT already carries.
Declared in ClikaRT/compute/tensor.h, line 894
Functions
unwrap(T)
template <``typename T, typename std::enable_if<!detail::is_result<detail::unwrap_plain_t<T>>::value, int>::type = 0``>constexpr T& unwrap(T& value) noexcept
The lvalue identity: the argument itself, by reference (no copy).
Declared in ClikaRT/common/result.h, line 468
unwrap(T)
template <``typename T, typename std::enable_if<!detail::is_result<detail::unwrap_plain_t<T>>::value &&!std::is_lvalue_reference<T>::value, int>::type = 0``>constexpr detail::unwrap_plain_t<T> unwrap(T&& value)
The rvalue identity: the argument's VALUE (one move), never a reference into it. A reference-returning arm would hand a range-for or an auto&& binding the storage of a temporary that dies at the end of the range-init full-expression; returning the value makes that binding own what it reads.
Declared in ClikaRT/common/result.h, line 480
unwrap(Result<T>)
template <``typename T``>T unwrap(Result<T>&& r)
The Result<T> read: move the value out, or raise on failure.
Declared in ClikaRT/common/result.h, line 486
unwrap(Result<void>)
void unwrap(Result<void>&& r)
The Result<void> read: no value; run the failure check only.
Declared in ClikaRT/common/result.h, line 488
GetVersionInfo()
std::string GetVersionInfo()
Human-readable ClikaRT version, e.g. "0.1.0".
Declared in ClikaRT/common/version.h, line 13
quantized_view()
Declared in ClikaRT/compute/q_tensor.h, line 89
make_quantized()
QTensor make_quantized(
Tensor payload,
std::string_view scheme,
Span<const std::int64_t> logical_shape,
OptionalTensor global_scale = {}
)
Declared in ClikaRT/compute/q_tensor.h, line 106
make_quantized_mxfp4()
QTensor make_quantized_mxfp4(
Tensor blocks,
Tensor scales,
Span<const std::int64_t> logical_shape
)
Declared in ClikaRT/compute/q_tensor.h, line 114
make_quantized_nvfp4()
QTensor make_quantized_nvfp4(
Tensor codes,
Tensor sub_scales,
OptionalTensor global_scale,
Span<const std::int64_t> logical_shape
)
Declared in ClikaRT/compute/q_tensor.h, line 129
make_quantized_fp8()
Declared in ClikaRT/compute/q_tensor.h, line 158
make_quantized_fp8_blocked()
QTensor make_quantized_fp8_blocked(
Tensor codes,
Tensor scale,
std::int64_t block_size,
Span<const std::int64_t> logical_shape
)
Declared in ClikaRT/compute/q_tensor.h, line 206
make_quantized_affine()
QTensor make_quantized_affine(
Tensor codes,
Tensor scales,
Tensor biases,
std::int64_t group_size,
std::int64_t bits,
Span<const std::int64_t> logical_shape
)
Declared in ClikaRT/compute/q_tensor.h, line 247
make_quantized_gptq()
QTensor make_quantized_gptq(
Tensor qweight,
Tensor qzeros,
Tensor scales,
OptionalTensor g_idx,
std::int64_t bits,
std::int64_t group_size,
quant::QuantizationConfig::ZerosConvention zeros_convention
)
Declared in ClikaRT/compute/q_tensor.h, line 367
make_quantized_bnb4()
QTensor make_quantized_bnb4(
Tensor packed,
Tensor absmax,
OptionalTensor nested_absmax,
OptionalTensor nested_quant_map,
OptionalTensor offset,
OptionalTensor quant_map,
std::string_view quant_type,
std::int64_t blocksize,
std::int64_t nested_blocksize,
Span<const std::int64_t> shape
)
Declared in ClikaRT/compute/q_tensor.h, line 383
make_quantized_awq()
QTensor make_quantized_awq(
Tensor qweight,
Tensor qzeros,
Tensor scales,
std::int64_t bits,
std::int64_t group_size
)
Declared in ClikaRT/compute/q_tensor.h, line 393
make_quantized_ct_pack()
QTensor make_quantized_ct_pack(
Tensor packed,
Tensor scales,
std::int64_t bits,
std::int64_t group_size
)
Declared in ClikaRT/compute/q_tensor.h, line 410
operator+()
scalar + t, elementwise, the double-scalar mirror of t + scalar.
Declared in ClikaRT/compute/tensor.h, line 904
operator*()
scalar * t, elementwise.
Declared in ClikaRT/compute/tensor.h, line 906
operator-()
scalar - t, elementwise: each element subtracted FROM the scalar.
Declared in ClikaRT/compute/tensor.h, line 908
operator/()
scalar / t, elementwise: the scalar divided BY each element.
Declared in ClikaRT/compute/tensor.h, line 910
operator<<()
std::ostream& operator<<(std::ostream& os, const Tensor& t)
Stream a tensor's to_string() summary (shape, dtype, device, first values) to an ostream, so std::cout << t << '\n' works. Header-only; forwards to the (infallible) to_string(); reads values for any dtype, integers included.
Declared in ClikaRT/compute/tensor.h, line 915
Platform notes
macOS: JIT acceleration and the Hardened Runtime
On macOS, ClikaRT's CPU runtime can accelerate some workloads by compiling specialized kernels at run time. The host application must be allowed to map executable memory: an application built with the Hardened Runtime needs the com.apple.security.cs.allow-jit entitlement. Without it, ClikaRT detects the restriction at startup and serves its standard kernels; results are identical, and only the acceleration is unavailable.
ClikaRT/cli/cli.h
#include <ClikaRT/cli/cli.h>
Umbrella for the public command-line parser (ClikaRT::cli): typed options / flags / positionals, subcommand routing, display + mutually-exclusive groups, auto help/usage, env-var fallbacks, and shell-completion generation. Every fallible call returns Result; the parser never throws, never exits, and never mutates argv.
ClikaRT/clika_rt.h
#include <ClikaRT/clika_rt.h>
ClikaRT public API umbrella header.
ClikaRT/common/macros.h
#include <ClikaRT/common/macros.h>
Macros
#define CLIKART_IS_WINDOWS
#define CLIKART_IS_WINDOWS 0
Declared in ClikaRT/common/macros.h, line 12
#define CLIKART_IS_ANDROID
#define CLIKART_IS_ANDROID 0
Declared in ClikaRT/common/macros.h, line 18
#define CLIKART_IS_LINUX
#define CLIKART_IS_LINUX 0
Declared in ClikaRT/common/macros.h, line 24
#define CLIKART_IS_MACOS
#define CLIKART_IS_MACOS 0
Declared in ClikaRT/common/macros.h, line 40
#define CLIKART_IS_IOS
#define CLIKART_IS_IOS 0
Declared in ClikaRT/common/macros.h, line 41
#define CLIKART_IS_APPLE
#define CLIKART_IS_APPLE (CLIKART_IS_MACOS || CLIKART_IS_IOS)
Declared in ClikaRT/common/macros.h, line 44
#define CLIKART_IS_X86_64
#define CLIKART_IS_X86_64 0
Declared in ClikaRT/common/macros.h, line 49
#define CLIKART_IS_ARM64
#define CLIKART_IS_ARM64 0
Declared in ClikaRT/common/macros.h, line 55
#define CLIKART_PUBLIC_EXPORT
#define CLIKART_PUBLIC_EXPORT
Declared in ClikaRT/common/macros.h, line 79
#define CLIKART_LOCAL
#define CLIKART_LOCAL
Declared in ClikaRT/common/macros.h, line 88
#define CLIKART_STATIC_C_API
#define CLIKART_STATIC_C_API
Declared in ClikaRT/common/macros.h, line 97
#define CLIKART_C_API
#define CLIKART_C_API
Declared in ClikaRT/common/macros.h, line 119
#define CLIKART_HAS_EXCEPTIONS
#define CLIKART_HAS_EXCEPTIONS 0
Declared in ClikaRT/common/macros.h, line 134
ClikaRT/common/result.h
#include <ClikaRT/common/result.h>
Value-returned result type for the ClikaRT API. Holds a value on success or a Status + message on failure. Every fallible public method returns Result<T> and never throws on its own. You turn a failure into an exception on the calling side with value_or_throw() (which raises ClikaRT::Error), or inspect ok() / status() / message() and never pay for exceptions at all.
Works with exceptions disabled: a consumer compiling with -fno-exceptions (or defining CLIKART_NO_EXCEPTIONS) gets a value_or_throw() that reports the failure to stderr and std::abort()s instead of throwing; the inspecting API (ok() / status() / message()) is unaffected.
── The error-handling vocabulary: each name's role ─────────────────────
Two LAYERS live in this header and they are not duplicates:
The LIBRARY's own boundary shims (not for consumer code):
CLIKART_RESULT(T)/CLIKART_UNWRAP(expr): how the public headers' inline wrappers adapt the library'sResultto the built error-handling shape (CLIKART_USE_RESULT_TYPE). Consumer code never writes these.CLIKART_INPLACE_RESULT(T)/CLIKART_INPLACE_UNWRAP(expr, self): the same adaptation for the IN-PLACE wrappers (the write-through ops and mutating tensor methods): under the value-returning surface they keep the historicalT&return (the mutatedself/out); under theResult-returning surface they return the impl'sResult<void>straight through.CLIKART_CHECKis the caller's mode-stable spelling for these calls.
The caller vocabulary (each spelling compiles and behaves identically whichever shape the library was built with):
ClikaRT::unwrap(x): read a value; extracts aResult(raising on failure) and forwards anything else unchanged, so the same call-site text serves both shapes.- Implicit extraction:
T x = fn(...);/g(fn(...))compiles under BOTH shapes: a TEMPORARYResult<T>converts toT, raising on failure exactly asunwrap. Call sites written against the value-returning surface keep compiling when a build opts into theResultsurface, so a codebase adopts explicit handling gradually rather than all at once. Rvalue-only (a NAMEDResultis read throughok()/value()/unwrap), and excluded forboolpayloads (operator booltests OKNESS everywhere, never the payload; read a bool payload throughunwrap/value()). Noteauto x = fn(...);still binds theResultitself; spell the type (orunwrap) to extract. CLIKART_TRY(expr): the CAPTURE idiom, "hand me data, never throw": yields aResultwhatever happens, catchingClikaRT::ErrorAND any other exception (nothing propagates).CLIKART_TRY_OR_RETURN(var, expr)/CLIKART_CHECK(expr): the PROPAGATE idiom forResult-returning consumer functions: on failure they RETURN the error (status + message + code_name verbatim) to the enclosing function's caller; onlyClikaRT::Erroris converted; foreign exceptions pass through untouched.
Macros
#define CLIKART_DETAIL_HAS_CXXABI
#define CLIKART_DETAIL_HAS_CXXABI 0
Declared in ClikaRT/common/result.h, line 73
#define CLIKART_USE_RESULT_TYPE
#define CLIKART_USE_RESULT_TYPE 0
Declared in ClikaRT/common/result.h, line 86
#define CLIKART_TRY
#define CLIKART_TRY(...) (::ClikaRT::detail::try_capture([&]() { return (__VA_ARGS__); }))
CLIKART_TRY: opt back INTO Result-style error handling.
The public API returns values directly and raises ClikaRT::Error on failure. When you would rather inspect a Result than catch, wrap the call:
Result<Tensor> r = CLIKART_TRY(ops::matmul(a, b));
if (!r.ok()) { log(r.message()); return; }
use(r.value());
Yields a Result<T> where T is the (decayed) type the expression produces: Result<void> for a void call, Result<Tensor> for a Tensor- or Tensor&-returning one. An expression that already produces a Result<U> passes through as that same Result<U> (never Result<Result<U>>), so the idiom reads identically whichever error-handling shape the library was built with. The expression is evaluated exactly once. A ClikaRT::Error is captured with its status; any other exception is captured as Status::Internal; nothing propagates. This is the inverse of the internal unwrap-or-propagate idiom: it CATCHES exceptions at the call site and hands you data.
Declared in ClikaRT/common/result.h, line 554
#define CLIKART_RESULT
#define CLIKART_RESULT(...) __VA_ARGS__
CLIKART_RESULT / CLIKART_UNWRAP: the two-mode public boundary shape.
A fallible public method delegates to a Result<T>-returning *_impl in the library and adapts that Result for the caller. These macros pick the adaptation at build time from CLIKART_USE_RESULT_TYPE (the CLIKART_USE_RESULT_TYPE CMake option, baked into build_info.h); the SAME header source compiles both ways, no per-method edit to flip. CLIKART_UNWRAP supplies its own return, so the wrapper body is just the unwrap; one macro serves both a value and a void boundary (a void-returning function may return a void expression):
CLIKART_RESULT(Tensor) to(Device d) const { CLIKART_UNWRAP(to_impl(d)); } CLIKART_RESULT(void) write(...) const { CLIKART_UNWRAP(write_impl(...)); }
- CLIKART_USE_RESULT_TYPE == 0 (default): the return type is the bare value
T(void), and the unwrap isreturn (expr).value_or_throw();; the wrapper raisesClikaRT::Erroron failure, caller-side. Byte-behaviour-identical to the historical value-returning surface. - CLIKART_USE_RESULT_TYPE == 1: the return type is
Result<T>(Result<void>) and the unwrap isreturn (expr);; the impl'sResultpasses straight through; the wrapper never throws and the caller inspects.ok()/.status()/.value().
CLIKART_RESULT is variadic so a comma-bearing type (CLIKART_RESULT(std::array<Tensor, 2>), CLIKART_RESULT(std::vector<std::byte>)) is not split into two macro arguments. Boundaries that transform the impl's result before returning it (an in-place op returning Tensor& / *this, a templated readback, a contained callback) keep their explicit value_or_throw(); they are not Result<T>-shaped and are the deliberate carve-outs (same family as the user-callback types).
Declared in ClikaRT/common/result.h, line 590
#define CLIKART_UNWRAP
#define CLIKART_UNWRAP(expr) return (expr).value_or_throw()
Declared in ClikaRT/common/result.h, line 591
#define CLIKART_INPLACE_RESULT
#define CLIKART_INPLACE_RESULT(...) __VA_ARGS__&
CLIKART_INPLACE_RESULT / CLIKART_INPLACE_UNWRAP: the boundary shims for the IN-PLACE wrapper family (a write-through op returning its out, a mutating tensor method returning *this). The impl twins all return Result<void>; the wrapper manufactures the reference:
inline CLIKART_INPLACE_RESULT(Tensor) relu_(Tensor& self) { CLIKART_INPLACE_UNWRAP(impl::relu_(self), self); }
- CLIKART_USE_RESULT_TYPE == 0 (default): the return type is
T&and the unwrap is(expr).value_or_throw(); return self;, the historical reference-returning surface, raisingClikaRT::Errorcaller-side on failure. - CLIKART_USE_RESULT_TYPE == 1: the return type is
Result<void>and the unwrap isreturn (expr);; the impl'sResult<void>passes straight through (the caller already holds the buffer it handed in).
The caller's mode-stable spelling for these calls is CLIKART_CHECK(...); reference-chaining is a value-surface-only idiom.
Declared in ClikaRT/common/result.h, line 616
#define CLIKART_INPLACE_UNWRAP
#define CLIKART_INPLACE_UNWRAP(expr, self) (expr).value_or_throw(); return self
Declared in ClikaRT/common/result.h, line 617
#define CLIKART_DETAIL_CONCAT2
#define CLIKART_DETAIL_CONCAT2(a, b) a##b
Declared in ClikaRT/common/result.h, line 621
#define CLIKART_DETAIL_CONCAT
#define CLIKART_DETAIL_CONCAT(a, b) CLIKART_DETAIL_CONCAT2(a, b)
Declared in ClikaRT/common/result.h, line 622
#define CLIKART_TRY_OR_RETURN
#define CLIKART_TRY_OR_RETURN(var, expr) auto CLIKART_DETAIL_CONCAT(clikart_try_state_, __LINE__) = \ ::ClikaRT::detail::propagate_capture([&]() { return (expr); }); \ if (!CLIKART_DETAIL_CONCAT(clikart_try_state_, __LINE__).ok()) \ return {CLIKART_DETAIL_CONCAT(clikart_try_state_, __LINE__).status(), \ CLIKART_DETAIL_CONCAT(clikart_try_state_, __LINE__).message(), \ CLIKART_DETAIL_CONCAT(clikart_try_state_, __LINE__).code_name()}; \ var = std::move(CLIKART_DETAIL_CONCAT(clikart_try_state_, __LINE__).value())
CLIKART_TRY_OR_RETURN: the PROPAGATE idiom's value form, for Result-returning consumer functions.
Result<float> mean_of(Tensor t) {
CLIKART_TRY_OR_RETURN(auto m, ClikaRT::ops::mean(t));
return m.item<float>();
}
Evaluates expr exactly once; on success declare-assigns (or assigns) var from the value; on a LIBRARY failure returns the error (status, message, and the fine code_name verbatim, through the three-argument Result constructor) to the enclosing function's caller. Only ClikaRT::Error is converted; a foreign exception passes through untouched. The SAME text serves both error-handling shapes: under the value-returning surface expr yields the bare value (a failure throws and is converted here); under the Result-returning surface expr yields a Result that passes through unflattened. Error timing is the settle-time law (see unwrap): failures surface at the read site, and a settled failure re-reports identically on re-read. Expands to multiple statements; use it in statement context (never as an unbraced if body), one per source line. With exceptions disabled a failure already aborted inside the library, so a reached call only ever sees success.
Declared in ClikaRT/common/result.h, line 646
#define CLIKART_CHECK
#define CLIKART_CHECK(expr) do { \ auto clikart_check_state_ = \ ::ClikaRT::detail::propagate_capture([&]() { return (expr); }); \ if (!clikart_check_state_.ok()) \ return {clikart_check_state_.status(), \ clikart_check_state_.message(), \ clikart_check_state_.code_name()}; \ } while (false)
CLIKART_CHECK: the PROPAGATE idiom's effect form: expr is run for its effect (an in-place op, a write, a registration) and any LIBRARY failure returns the error (status/message/code_name verbatim) to the enclosing function's caller; only ClikaRT::Error is converted, foreign exceptions pass through. The mode-stable spelling for the in-place Tensor&-returning ops (CLIKART_CHECK(ops::relu_(x));) and for any Result<void> call under the Result-returning surface. Single statement (safe as an if body); settle-time + sticky re-read semantics as on unwrap.
Declared in ClikaRT/common/result.h, line 664
ClikaRT/common/version.h
#include <ClikaRT/common/version.h>
ClikaRT version information.
ClikaRT/compute/scope.h
#include <ClikaRT/compute/scope.h>
RAII execution-mode scopes. ClikaRT executes asynchronously by default; ops dispatch and return, and the work runs later. These scopes change that for the calling thread, for their lifetime: force every op to complete before dispatch returns (deterministic / debug), or switch to lazy graph-building (tracing).
ClikaRT/http/http.h
#include <ClikaRT/http/http.h>
HTTP umbrella: the client (client.h) and the server (server.h) together. Include this to get both sides; include the role header directly (ClikaRT/http/client.h or ClikaRT/http/server.h) to name the side you use.
ClikaRT/nn/nn.h
#include <ClikaRT/nn/nn.h>
ClikaRT public NN-module umbrella; include this one header for the whole nn surface. New public modules are added HERE (and only here); consumers and clika_rt.h never enumerate the individual headers.
ClikaRT/profiler/profiler.h
#include <ClikaRT/profiler/profiler.h>
Capture a profile of ClikaRT compute work and export it: a Chrome trace you can open in chrome://tracing / Perfetto, a per-op summary, or the raw report JSON.
While a capture is active, every op dispatched on the capturing thread (and on the streams it drives) is timed automatically; you do not instrument individual calls. The shape is RAII:
ClikaRT::ProfileSession session;
{
auto capture = session.start_capture("decode");
// ... run ops / drive streams ...
} // capture ends here
session.save("profile_out"); // chrome_trace.json + summary.txt + ...
printf("%s\n", session.summary_text().c_str());
const ClikaRT::ProfileSummary s = session.summary(); // the same numbers, typed
printf("%zu allocations\n", s.total_allocations);