2023-10-25 13:02:23 +00:00
|
|
|
#ifndef CX_H
|
|
|
|
#define CX_H
|
|
|
|
|
|
|
|
// Include standard headers
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <unistd.h>
|
2024-10-26 07:55:43 +00:00
|
|
|
#include <stdint.h>
|
2024-11-07 21:07:33 +00:00
|
|
|
#include <pthread.h>
|
2023-10-25 13:02:23 +00:00
|
|
|
|
|
|
|
// Include GLEW
|
|
|
|
#include <GL/glew.h>
|
|
|
|
|
|
|
|
// Include GLFW
|
2023-12-13 09:56:21 +00:00
|
|
|
#define GLFW_INCLUDE_VULKAN
|
2023-10-25 13:02:23 +00:00
|
|
|
#include <GLFW/glfw3.h>
|
|
|
|
|
|
|
|
// Include project headers
|
|
|
|
#include <tensor.h>
|
|
|
|
#include <model.h>
|
|
|
|
#include <tensor.h>
|
|
|
|
#include <shader.h>
|
2024-07-06 15:59:22 +00:00
|
|
|
#include <neural.h>
|
2023-10-25 13:02:23 +00:00
|
|
|
|
2024-11-07 21:07:33 +00:00
|
|
|
// Declare common data structures.
|
|
|
|
|
|
|
|
typedef struct _cx_thrgr {
|
|
|
|
pthread_t *group_manager;
|
|
|
|
pthread_t *workers;
|
|
|
|
} CX_ThreadGroup;
|
|
|
|
|
|
|
|
typedef struct _cx_ctx {
|
|
|
|
GLFWwindow *window;
|
|
|
|
Neural_Network *nn;
|
|
|
|
CX_ThreadGroup **threads;
|
|
|
|
} CX_Context;
|
|
|
|
|
2023-10-25 13:02:23 +00:00
|
|
|
// Declare functions
|
|
|
|
|
2024-11-07 21:07:33 +00:00
|
|
|
CX_Context *cx_context_new(void);
|
2023-10-25 13:02:23 +00:00
|
|
|
|
2024-10-19 09:32:39 +00:00
|
|
|
int cx_glinit(GLFWwindow **);
|
2024-07-06 15:59:22 +00:00
|
|
|
int cx_nninit(Neural_Network **);
|
2024-10-19 09:32:39 +00:00
|
|
|
|
2024-11-07 21:07:33 +00:00
|
|
|
int cx_run(CX_Context *);
|
2024-07-06 15:59:22 +00:00
|
|
|
|
2023-10-25 13:02:23 +00:00
|
|
|
#endif
|
|
|
|
|