@@ -372,7 +372,7 @@ struct ggml_state {
372372 struct ggml_numa_nodes numa;
373373};
374374
375- static struct ggml_state g_state = { 0 };
375+ static struct ggml_state g_state { };
376376
377377void ggml_barrier (struct ggml_threadpool * tp) {
378378 int n_threads = atomic_load_explicit (&tp->n_graph , memory_order_relaxed) & GGML_THREADPOOL_N_THREADS_MASK;
@@ -572,7 +572,7 @@ struct ggml_tensor * ggml_set_i32 (struct ggml_tensor * tensor, int32_t value) {
572572 const int nc = tensor->ne [0 ];
573573 const size_t n1 = tensor->nb [1 ];
574574
575- char * const data = tensor->data ;
575+ char * const data = ( char *) tensor->data ;
576576
577577 switch (tensor->type ) {
578578 case GGML_TYPE_I8:
@@ -631,7 +631,7 @@ struct ggml_tensor * ggml_set_f32(struct ggml_tensor * tensor, float value) {
631631 const int nc = tensor->ne [0 ];
632632 const size_t n1 = tensor->nb [1 ];
633633
634- char * const data = tensor->data ;
634+ char * const data = ( char *) tensor->data ;
635635
636636 switch (tensor->type ) {
637637 case GGML_TYPE_I8:
@@ -1116,7 +1116,7 @@ UseGgmlGemm1:;
11161116#endif
11171117
11181118 if (src1->type != vec_dot_type) {
1119- char * wdata = params->wdata ;
1119+ char * wdata = ( char *) params->wdata ;
11201120
11211121 const size_t nbw0 = ggml_type_size (vec_dot_type);
11221122 const size_t nbw1 = ggml_row_size (vec_dot_type, ne10);
@@ -1368,18 +1368,18 @@ static void ggml_compute_forward_mul_mat_id(
13681368 }
13691369
13701370 int64_t * matrix_row_counts = // [n_as]
1371- incr_ptr_aligned (&wdata_cur, n_as*sizeof (int64_t ), sizeof (int64_t ));
1371+ ( int64_t *) incr_ptr_aligned (&wdata_cur, n_as*sizeof (int64_t ), sizeof (int64_t ));
13721372
13731373 struct mmid_row_mapping * matrix_rows = // [n_as][ids->ne[0]*ids->ne[1]]
1374- incr_ptr_aligned (&wdata_cur, n_as*ids->ne [0 ]*ids->ne [1 ]*sizeof (struct mmid_row_mapping ), sizeof (int64_t ));
1374+ ( struct mmid_row_mapping *) incr_ptr_aligned (&wdata_cur, n_as*ids->ne [0 ]*ids->ne [1 ]*sizeof (struct mmid_row_mapping ), sizeof (int64_t ));
13751375
13761376 char (*atomic_current_chunk)[CACHE_LINE_SIZE] = // [n_as]
1377- incr_ptr_aligned (&wdata_cur, CACHE_LINE_SIZE * n_as, CACHE_LINE_SIZE);
1377+ ( char (*)[CACHE_LINE_SIZE]) incr_ptr_aligned (&wdata_cur, CACHE_LINE_SIZE * n_as, CACHE_LINE_SIZE);
13781378
13791379 GGML_ASSERT (params->wsize >= (size_t )((char *) wdata_cur - (char *) params->wdata ));
13801380
13811381 if (src1->type != vec_dot_type) {
1382- char * wdata = params->wdata ;
1382+ char * wdata = ( char *) params->wdata ;
13831383
13841384 const size_t nbw0 = ggml_type_size (vec_dot_type);
13851385 const size_t nbw1 = ggml_row_size (vec_dot_type, ne10);
@@ -1426,7 +1426,7 @@ static void ggml_compute_forward_mul_mat_id(
14261426
14271427 assert (i02 >= 0 && i02 < n_as);
14281428
1429- MMID_MATRIX_ROW (i02, matrix_row_counts[i02]) = (struct mmid_row_mapping ) {id, iid1};
1429+ MMID_MATRIX_ROW (i02, matrix_row_counts[i02]) = (struct mmid_row_mapping ) {id, ( int32_t ) iid1};
14301430 matrix_row_counts[i02] += 1 ;
14311431 }
14321432 }
@@ -2767,7 +2767,7 @@ static thread_ret_t ggml_graph_compute_thread(void * data) {
27672767
27682768 struct ggml_compute_params params = {
27692769 /* .ith =*/ state->ith ,
2770- /* .nth =*/ atomic_load_explicit (&tp->n_graph , memory_order_relaxed) & GGML_THREADPOOL_N_THREADS_MASK,
2770+ /* .nth =*/ ( int ) ( atomic_load_explicit (&tp->n_graph , memory_order_relaxed) & GGML_THREADPOOL_N_THREADS_MASK) ,
27712771 /* .wsize =*/ cplan->work_size ,
27722772 /* .wdata =*/ cplan->work_data ,
27732773 /* .threadpool =*/ tp,
@@ -2960,7 +2960,7 @@ static struct ggml_threadpool * ggml_threadpool_new_impl(
29602960 struct ggml_cplan * cplan) {
29612961
29622962 struct ggml_threadpool * threadpool =
2963- ggml_aligned_malloc (sizeof (struct ggml_threadpool ));
2963+ ( struct ggml_threadpool *) ggml_aligned_malloc (sizeof (struct ggml_threadpool ));
29642964 {
29652965 threadpool->cgraph = cgraph;
29662966 threadpool->cplan = cplan;
@@ -2980,7 +2980,7 @@ static struct ggml_threadpool * ggml_threadpool_new_impl(
29802980
29812981 // Allocate and init workers state
29822982 const size_t workers_size = sizeof (struct ggml_compute_state ) * tpp->n_threads ;
2983- struct ggml_compute_state * workers = ggml_aligned_malloc (workers_size);
2983+ struct ggml_compute_state * workers = ( struct ggml_compute_state *) ggml_aligned_malloc (workers_size);
29842984
29852985 memset (workers, 0 , workers_size);
29862986 for (int j = 0 ; j < tpp->n_threads ; j++) {
@@ -3512,7 +3512,7 @@ void ggml_cpu_init(void) {
35123512 union {
35133513 uint16_t u16 ;
35143514 ggml_fp16_t fp16;
3515- } u = {i };
3515+ } u = { ( uint16_t ) i };
35163516 float f = GGML_COMPUTE_FP16_TO_FP32 (u.fp16 );
35173517 ggml_table_f32_f16[i] = f;
35183518 ggml_table_gelu_f16[i] = GGML_CPU_FP32_TO_FP16 (ggml_gelu_f32 (f));
0 commit comments