package io.synor.compute;

/**
 * Precision levels for compute operations.
 */
public enum Precision {
    /** 64-bit floating point */
    FP64("fp64"),
    /** 32-bit floating point */
    FP32("fp32"),
    /** 16-bit floating point */
    FP16("fp16"),
    /** Brain floating point 16-bit */
    BF16("bf16"),
    /** 8-bit integer quantization */
    INT8("int8"),
    /** 4-bit integer quantization */
    INT4("int4");

    private final String value;

    Precision(String value) {
        this.value = value;
    }

    public String getValue() {
        return value;
    }

    public static Precision fromValue(String value) {
        for (Precision p : values()) {
            if (p.value.equalsIgnoreCase(value)) {
                return p;
            }
        }
        throw new IllegalArgumentException("Unknown precision: " + value);
    }
}
