Pārlūkot izejas kodu

Fix concurrent update of codelets

Samuel Thibault 8 gadi atpakaļ
vecāks
revīzija
fa6cfa0197
1 mainītis faili ar 10 papildinājumiem un 8 dzēšanām
  1. 10 8
      src/core/task.c

+ 10 - 8
src/core/task.c

@@ -385,7 +385,8 @@ void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl)
 	if (!cl)
 		return;
 
-	int is_where_unset = cl->where == 0;
+	uint32_t where = cl->where;
+	int is_where_unset = where == 0;
 	unsigned i, some_impl;
 
 	/* Check deprecated and unset fields (where, <device>_func,
@@ -415,7 +416,7 @@ void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl)
 	}
 	if (some_impl && is_where_unset)
 	{
-		cl->where |= STARPU_CPU;
+		where |= STARPU_CPU;
 	}
 
 	/* CUDA */
@@ -442,7 +443,7 @@ void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl)
 	}
 	if (some_impl && is_where_unset)
 	{
-		cl->where |= STARPU_CUDA;
+		where |= STARPU_CUDA;
 	}
 
 	/* OpenCL */
@@ -469,7 +470,7 @@ void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl)
 	}
 	if (some_impl && is_where_unset)
 	{
-		cl->where |= STARPU_OPENCL;
+		where |= STARPU_OPENCL;
 	}
 
 	some_impl = 0;
@@ -481,7 +482,7 @@ void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl)
 		}
 	if (some_impl && is_where_unset)
 	{
-		cl->where |= STARPU_MIC;
+		where |= STARPU_MIC;
 	}
 
 	some_impl = 0;
@@ -493,7 +494,7 @@ void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl)
 		}
 	if (some_impl && is_where_unset)
 	{
-		cl->where |= STARPU_MPI_MS;
+		where |= STARPU_MPI_MS;
 	}
 
 	some_impl = 0;
@@ -505,7 +506,7 @@ void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl)
 		}
 	if (some_impl && is_where_unset)
 	{
-		cl->where |= STARPU_SCC;
+		where |= STARPU_SCC;
 	}
 
 	some_impl = 0;
@@ -517,8 +518,9 @@ void _starpu_codelet_check_deprecated_fields(struct starpu_codelet *cl)
 		}
 	if (some_impl && is_where_unset)
 	{
-		cl->where |= STARPU_MIC|STARPU_SCC|STARPU_MPI_MS;
+		where |= STARPU_MIC|STARPU_SCC|STARPU_MPI_MS;
 	}
+	cl->where = where;
 }
 
 void _starpu_task_check_deprecated_fields(struct starpu_task *task STARPU_ATTRIBUTE_UNUSED)