]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
tests : Fix a few small Windows / MSVC build issues (#1193)
authorLeonard Mosescu <redacted>
Sat, 19 Apr 2025 05:36:38 +0000 (22:36 -0700)
committerGitHub <redacted>
Sat, 19 Apr 2025 05:36:38 +0000 (08:36 +0300)
* 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 <redacted>
* Incorporate review feedback

---------

Co-authored-by: Georgi Gerganov <redacted>
tests/test-pad-reflect-1d.cpp

index 764c3e5b8175f3bba7a023f76f0325ae42f61aa8..8b957edd3a92886af88b8085f566fd68b7ab349e 100644 (file)
@@ -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);