瀏覽代碼

gcc: Adjust to the `{cpu,cuda,opencl}_func' deprecation.

* gcc-plugin/src/starpu.c
  (build_codelet_initializer)[implementation_pointers]: Make sure
  POINTERS is NULL-terminated.
  Don't initialize the `cpu_func', `cuda_func', and `opencl_func'
  fields.

* gcc-plugin/tests/mocks.h (starpu_insert_task): Remove checks of the
  `cpu_func', `cuda_func', and `opencl_func' fields.
Ludovic Courtès 13 年之前
父節點
當前提交
9d1fec0254
共有 2 個文件被更改,包括 6 次插入14 次删除
  1. 6 10
      gcc-plugin/src/starpu.c
  2. 0 4
      gcc-plugin/tests/mocks.h

+ 6 - 10
gcc-plugin/src/starpu.c

@@ -1417,7 +1417,12 @@ build_codelet_initializer (tree task_decl)
 	  }
       }
 
-    /* Return a (potentially empty) array initializer.  */
+    /* POINTERS must be null-terminated.  */
+    pointers = tree_cons (size_int (len), build_zero_cst (ptr_type_node),
+			  pointers);
+    len++;
+
+    /* Return an array initializer.  */
     tree index_type = build_index_type (size_int (list_length (pointers)));
 
     return build_constructor_from_list (build_array_type (ptr_type_node,
@@ -1440,10 +1445,6 @@ build_codelet_initializer (tree task_decl)
 
   impls = task_implementation_list (task_decl);
 
-#define multiple_impls(x)						\
-  build_int_cstu (ptr_type_node,					\
-		  (uintptr_t) STARPU_MULTIPLE_ ## x ## _IMPLEMENTATIONS)
-
   inits =
     chain_trees (field_initializer ("where", where_init (impls)),
 		 field_initializer ("nbuffers", pointer_arg_count ()),
@@ -1456,13 +1457,8 @@ build_codelet_initializer (tree task_decl)
 		 field_initializer ("cuda_funcs",
 		 		    implementation_pointers (impls,
 							     STARPU_CUDA)),
-		 field_initializer ("cpu_func", multiple_impls (CPU)),
-		 field_initializer ("cuda_func", multiple_impls (CUDA)),
-		 field_initializer ("opencl_func", multiple_impls (OPENCL)),
 		 NULL_TREE);
 
-#undef multiple_impls
-
   return build_constructor_from_unsorted_list (codelet_type (), inits);
 }
 

+ 0 - 4
gcc-plugin/tests/mocks.h

@@ -65,10 +65,6 @@ starpu_insert_task (struct starpu_codelet *cl, ...)
   assert (cl->opencl_funcs[0] != NULL);
   assert (cl->cuda_funcs[0] == NULL);
 
-  assert (cl->cpu_func == STARPU_MULTIPLE_CPU_IMPLEMENTATIONS);
-  assert (cl->opencl_func == STARPU_MULTIPLE_OPENCL_IMPLEMENTATIONS);
-  assert (cl->cuda_func == STARPU_MULTIPLE_CUDA_IMPLEMENTATIONS);
-
   va_list args;
 
   va_start (args, cl);