tiny.accy.executable.composition.element
Defined in executable.composition.
API (2)
Actions
Public operations.
Source
Source: lib/accy/src/executable/composition/element.zig
zig
const std = @import("std");const choir_abi = @import("choir_abi");const choir = @import("choir");const accy_root = @import("../../root.zig");pub fn elementType(value: choir_abi.DType) choir.composition.ElementType { return switch (value) { .i1 => .i1, .i8 => .i8, .i16 => .i16, .i32 => .i32, .i64 => .i64, .u8 => .u8, .u16 => .u16, .u32 => .u32, .u64 => .u64, .f16 => .f16, .bf16 => .bf16, .f32 => .f32, .f64 => .f64, .key => .key, };}pub fn dtype(element_type: choir.composition.ElementType) choir_abi.DType { return switch (element_type) { .i1 => .i1, .i8 => .i8, .i16 => .i16, .i32 => .i32, .i64 => .i64, .u8 => .u8, .u16 => .u16, .u32 => .u32, .u64 => .u64, .f16 => .f16, .bf16 => .bf16, .f32 => .f32, .f64 => .f64, .key => .key, };}test "Accy and composition element types round-trip" { inline for (std.meta.tags(choir_abi.DType)) |value| { try std.testing.expectEqual(value, dtype(elementType(value))); }}Source: lib/accy/src/executable/composition/root.zig:3
zig
pub const element = @import("element.zig");Audit
| Definitions | 3 |
|---|---|
| Public names | 5 |
| Members | 0 |
| Version | 26.7.0 |
| Revision | daab053ee433 |