remove c++ style from header

This commit is contained in:
CJ Pais 2024-02-18 13:25:49 -08:00
parent 2f2973de78
commit e801037de6
4 changed files with 51 additions and 18 deletions

View file

@ -34,6 +34,23 @@
//#define CLIP_DEBUG_FUNCTIONS
// RGB uint8 image
struct clip_image_u8 {
int nx;
int ny;
std::vector<uint8_t> buf;
};
// RGB float32 image (NHWC)
// Memory layout: RGBRGBRGB...
struct clip_image_f32 {
int nx;
int ny;
std::vector<float> buf;
};
static std::string format(const char * fmt, ...) {
va_list ap;
va_list ap2;

View file

@ -3,7 +3,6 @@
#include <stddef.h>
#include <stdint.h>
#include <vector>
#ifdef LLAMA_SHARED
# if defined(_WIN32) && !defined(__MINGW32__)
@ -27,23 +26,6 @@ extern "C" {
struct clip_ctx;
// RGB uint8 image
struct clip_image_u8 {
int nx;
int ny;
std::vector<uint8_t> buf;
};
// RGB float32 image (NHWC)
// Memory layout: RGBRGBRGB...
struct clip_image_f32 {
int nx;
int ny;
std::vector<float> buf;
};
struct clip_image_u8_batch {
struct clip_image_u8 * data;
size_t size;

View file

@ -9,6 +9,23 @@
#include <vector>
#include <numeric>
// RGB uint8 image
struct clip_image_u8 {
int nx;
int ny;
std::vector<uint8_t> buf;
};
// RGB float32 image (NHWC)
// Memory layout: RGBRGBRGB...
struct clip_image_f32 {
int nx;
int ny;
std::vector<float> buf;
};
struct clip_image_grid_shape {
int first;
int second;

View file

@ -43,6 +43,23 @@ struct server_params
int32_t write_timeout = 600;
};
// RGB uint8 image
struct clip_image_u8 {
int nx;
int ny;
std::vector<uint8_t> buf;
};
// RGB float32 image (NHWC)
// Memory layout: RGBRGBRGB...
struct clip_image_f32 {
int nx;
int ny;
std::vector<float> buf;
};
bool server_verbose = false;
static size_t common_part(const std::vector<llama_token> &a, const std::vector<llama_token> &b)