Documentation Index
Fetch the complete documentation index at: https://sdk.cerebras.ai/llms.txt
Use this file to discover all available pages before exploring further.
The
comptime_struct type and the @concat_structs builtin were removed in
SDK 2.10.0. See Version 2.10.0.
This guide explains how to migrate existing code to use named struct types
instead.Replacing comptime_struct with struct
As a consequence of the removal of comptime_struct, @concat_structs can no
longer be used.
Before (removed):
struct types to be declared explicitly. These can be used at
both compile time and runtime. The following code serves the equivalent
function to the above example:
Partial initialization
Another key difference betweencomptime_struct and struct is that all
fields must be declared and set. No partial initialization can be done,
sometimes requiring the use of temporary placeholders.
Before (removed):
Parameterized structs
Sometimes, the members of a givenstruct need to vary based on compile-time
parameters or constants. This can be achieved by writing a comptime function
that returns a type. The returned type is a struct whose fields depend on
the arguments passed to the function.
For example, a function that returns a point type whose coordinate type depends
on the scale type requested:

