From e23ba19da12054236a1c8ac04fe49b5cce1d090c Mon Sep 17 00:00:00 2001 From: netrunnereve <139727413+netrunnereve@users.noreply.github.com> Date: Tue, 1 Aug 2023 17:53:14 -0400 Subject: [PATCH] use initializer list for ggml_init_params --- tests/test-grad0.cpp | 9 +++++---- tests/test-opt.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tests/test-grad0.cpp b/tests/test-grad0.cpp index 78b668ad3..75a698d73 100644 --- a/tests/test-grad0.cpp +++ b/tests/test-grad0.cpp @@ -372,10 +372,11 @@ static bool check_mat_mul( #define NUM_PERMUTATIONS (4*3*2*1) int main(int argc, const char ** argv) { - struct ggml_init_params params; - params.mem_size = 128*1024*1024; - params.mem_buffer = NULL; - params.no_alloc = false; + struct ggml_init_params params = { + /* .mem_size = */ 128*1024*1024, + /* .mem_buffer = */ NULL, + /* .no_alloc = */ false, + }; int64_t ne[4]; diff --git a/tests/test-opt.cpp b/tests/test-opt.cpp index e3671402e..8ab240202 100644 --- a/tests/test-opt.cpp +++ b/tests/test-opt.cpp @@ -118,10 +118,11 @@ void set_element(struct ggml_tensor * t, int idx, float value) { } int main(void) { - struct ggml_init_params params; - params.mem_size = 1024*1024*1024; - params.mem_buffer = NULL; - params.no_alloc = false; + struct ggml_init_params params = { + /* .mem_size = */ 1024*1024*1024, + /* .mem_buffer = */ NULL, + /* .no_alloc = */ false, + }; struct ggml_context * ctx = ggml_init(params);