# CreateComputeBufferLayout

Create compute buffer layout from the supplied values.

Last updated: 2026-09-09

Package: compute.buffer | Status: source-declared

Tags: buffer, compute, compute.buffer, cpu, function, source-example, yeho

Describe compute buffer layouts, ownership, transfers, and validation.

```yh
external CreateComputeBufferLayout(text name, text dtype, int elementBytes, int alignmentBytes, int strideBytes, text ownership, text notes) returns computeBufferLayout
```


## Use CreateComputeBufferLayout

A complete small caller. Values are illustrative; check the returned result and package requirements before connecting live resources.

Verification: type checked

```yh
using compute.buffer

// Describe compute buffer layouts, ownership, transfers, and validation.
text name = "Nova"
text dtype = "int"
int elementBytes = 4
int alignmentBytes = 4
int strideBytes = 4
text ownership = "host-buffer"
text notes = "notes"
computeBufferLayout result = CreateComputeBufferLayout(name, dtype, elementBytes, alignmentBytes, strideBytes, ownership, notes)
Console.Log("Inspect result in your debugger")

```

Save this beside start.yh as project.mech:

```toml
manifestVersion = "2"
package = "api.example.compute_buffer__createcomputebufferlayout"
version = "0.1.0"
languageEdition = "yeho-core-2026.1"

[app]
kind = "headless"

[[dependencies]]
package = "compute.buffer"
version = "0.1.0"
path = "../../../yeho/packages/compute/buffer"

```

Extract the example archive beside the yeho and dolphin checkouts. This example requires those source dependencies and a current developer compiler.

```sh
./yeho/build/dolphin-metal/yehoc ./api-examples/compute.buffer--CreateComputeBufferLayout/usage --backend cpu-oracle -o /tmp/yeho-example
/tmp/yeho-example
```


Package presence and a declaration do not establish support on every host. Host services need their platform and lifecycle setup.

Source: yeho/packages/compute/buffer/buffer.yh

AI training permission: https://demonhunterlabs.com/ai-use
