From: Leonard Mosescu Date: Sat, 19 Apr 2025 05:36:38 +0000 (-0700) Subject: tests : Fix a few small Windows / MSVC build issues (#1193) X-Git-Tag: upstream/0.0.1982~30 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=13bcf9ce50651a8b4238ec6d136f46f2c1b23b6f;p=pkg%2Fggml%2Fsources%2Fggml tests : Fix a few small Windows / MSVC build issues (#1193) * Fix a few small Windows / MSVC build issues * Fix MSVC build and keep C++17 conformance * Update tests/test-pad-reflect-1d.cpp Co-authored-by: Georgi Gerganov * Incorporate review feedback --------- Co-authored-by: Georgi Gerganov --- diff --git a/tests/test-pad-reflect-1d.cpp b/tests/test-pad-reflect-1d.cpp index 764c3e5b..8b957edd 100644 --- a/tests/test-pad-reflect-1d.cpp +++ b/tests/test-pad-reflect-1d.cpp @@ -25,7 +25,9 @@ static void ggml_log_callback_default(ggml_log_level level, const char * text, v struct ggml_context* make_ctx(void) { struct ggml_init_params params = { - .mem_size = 2 * 1024 * 1024, + /*.mem_size =*/ 2 * 1024 * 1024, + /*.mem_buffer =*/ nullptr, + /*.no_alloc. =*/ false }; return ggml_init(params); } @@ -85,10 +87,10 @@ void test_pad_reflect_1d(bool use_gpu) { // Test cases for different padding configurations { - params = (struct ggml_init_params){ - .mem_size = 16*1024*1024, - .mem_buffer = NULL, - .no_alloc = true, + params = ggml_init_params{ + /*.mem_size =*/ 16*1024*1024, + /*.mem_buffer =*/ nullptr, + /*.no_alloc. =*/ true }; ggml_log_set(ggml_log_callback_default, nullptr); @@ -144,10 +146,10 @@ void test_pad_reflect_1d(bool use_gpu) { } { - params = (struct ggml_init_params){ - .mem_size = 16*1024*1024, - .mem_buffer = NULL, - .no_alloc = true, + params = ggml_init_params{ + /*.mem_size =*/ 16*1024*1024, + /*.mem_buffer =*/ nullptr, + /*.no_alloc. =*/ true }; ggml_log_set(ggml_log_callback_default, nullptr);