MSVC: Remove features that are only available on MSVC C++20.

pull/31/head
Sebastián Aedo 2 years ago
parent 718bb989a5
commit ce0d5fb9de

@ -209,8 +209,8 @@ bool llama_model_load(const std::string & fname, llama_model & model, gpt_vocab
// create the ggml context // create the ggml context
{ {
struct ggml_init_params params = { struct ggml_init_params params = {
.mem_size = ctx_size, /*.mem_size =*/ ctx_size,
.mem_buffer = NULL, /*.mem_buffer =*/ NULL,
}; };
model.ctx = ggml_init(params); model.ctx = ggml_init(params);
@ -546,12 +546,13 @@ bool llama_eval(
} }
struct ggml_init_params params = { struct ggml_init_params params = {
.mem_size = buf_size, /*.mem_size =*/ buf_size,
.mem_buffer = buf, /*.mem_buffer =*/ buf,
}; };
struct ggml_context * ctx0 = ggml_init(params); struct ggml_context * ctx0 = ggml_init(params);
struct ggml_cgraph gf = { .n_threads = n_threads }; struct ggml_cgraph gf;
gf.n_threads = n_threads;
struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N); struct ggml_tensor * embd = ggml_new_tensor_1d(ctx0, GGML_TYPE_I32, N);
memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd)); memcpy(embd->data, embd_inp.data(), N*ggml_element_size(embd));

Loading…
Cancel
Save