#ifndef GHOSTFLOW_H
#define GHOSTFLOW_H
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef enum GhostFlowError {
Success = 0,
InvalidShape = 1,
InvalidData = 2,
NullPointer = 3,
AllocationFailed = 4,
ComputationFailed = 5,
Unknown = 99,
} GhostFlowError;
typedef struct GhostFlowTensor {
uint8_t _private[0];
} GhostFlowTensor;
enum GhostFlowError ghostflow_init(void);
const char *ghostflow_version(void);
void ghostflow_free_string(char *s);
enum GhostFlowError ghostflow_tensor_create(const float *data,
uintptr_t data_len,
const uintptr_t *shape,
uintptr_t shape_len,
struct GhostFlowTensor **out);
enum GhostFlowError ghostflow_tensor_zeros(const uintptr_t *shape,
uintptr_t shape_len,
struct GhostFlowTensor **out);
enum GhostFlowError ghostflow_tensor_ones(const uintptr_t *shape,
uintptr_t shape_len,
struct GhostFlowTensor **out);
void ghostflow_tensor_free(struct GhostFlowTensor *tensor);
enum GhostFlowError ghostflow_tensor_shape(const struct GhostFlowTensor *tensor,
uintptr_t *out_shape,
uintptr_t *out_ndim);
enum GhostFlowError ghostflow_tensor_data(const struct GhostFlowTensor *tensor,
float *out_data,
uintptr_t *out_len);
enum GhostFlowError ghostflow_tensor_add(const struct GhostFlowTensor *a,
const struct GhostFlowTensor *b,
struct GhostFlowTensor **out);
enum GhostFlowError ghostflow_tensor_mul(const struct GhostFlowTensor *a,
const struct GhostFlowTensor *b,
struct GhostFlowTensor **out);
enum GhostFlowError ghostflow_tensor_matmul(const struct GhostFlowTensor *a,
const struct GhostFlowTensor *b,
struct GhostFlowTensor **out);
enum GhostFlowError ghostflow_tensor_reshape(const struct GhostFlowTensor *tensor,
const uintptr_t *new_shape,
uintptr_t new_shape_len,
struct GhostFlowTensor **out);
const char *ghostflow_get_last_error(void);
#endif