package io.synor.compute;

/**
 * Supported processor types for heterogeneous computing.
 */
public enum ProcessorType {
    /** Central Processing Unit */
    CPU("cpu"),
    /** Graphics Processing Unit */
    GPU("gpu"),
    /** Tensor Processing Unit */
    TPU("tpu"),
    /** Neural Processing Unit */
    NPU("npu"),
    /** Language Processing Unit (for LLM inference) */
    LPU("lpu"),
    /** Field-Programmable Gate Array */
    FPGA("fpga"),
    /** Digital Signal Processor */
    DSP("dsp"),
    /** WebGPU (browser-based) */
    WEBGPU("webgpu"),
    /** WebAssembly */
    WASM("wasm"),
    /** Automatic selection */
    AUTO("auto");

    private final String value;

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

    public String getValue() {
        return value;
    }

    public static ProcessorType fromValue(String value) {
        for (ProcessorType type : values()) {
            if (type.value.equalsIgnoreCase(value)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Unknown processor type: " + value);
    }
}
