go-mlx/dist/include/mlx/c/optional.h
Snider 2292557fd6 chore: vendor MLX C headers for Go module consumers
dist/include/ contains the MLX and MLX-C headers needed for CGo
compilation. Without these, go-mlx cannot be used as a module
dependency (headers not found in module cache).

Libraries (dylib/metallib) are still gitignored — users build
those locally via cmake.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-21 19:14:04 +00:00

51 lines
687 B
C

/* Copyright © 2023-2024 Apple Inc. */
#ifndef MLX_OPTIONAL_H
#define MLX_OPTIONAL_H
#include <stdbool.h>
#include "mlx/c/array.h"
#include "mlx/c/string.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* \defgroup mlx_optional Optionals
* MLX optional scalars.
*/
/**@{*/
/**
* A int optional.
*/
typedef struct mlx_optional_int_ {
int value;
bool has_value;
} mlx_optional_int;
/**
* A float optional.
*/
typedef struct mlx_optional_float_ {
float value;
bool has_value;
} mlx_optional_float;
/**
* A dtype optional.
*/
typedef struct mlx_optional_dtype_ {
mlx_dtype value;
bool has_value;
} mlx_optional_dtype;
/**@}*/
#ifdef __cplusplus
}
#endif
#endif