Explorar o código

assert that we're not adding a dependency between a tag and itself

Samuel Thibault %!s(int64=15) %!d(string=hai) anos
pai
achega
a0078d07d2
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      src/core/dependencies/tags.c

+ 2 - 0
src/core/dependencies/tags.c

@@ -229,6 +229,7 @@ void starpu_tag_declare_deps_array(starpu_tag_t id, unsigned ndeps, starpu_tag_t
 		 * so cg should be among dep_id's successors*/
 		STARPU_TRACE_CODELET_TAG_DEPS(id, dep_id);
 		struct starpu_tag_s *tag_dep = gettag_struct(dep_id);
+		STARPU_ASSERT(tag_dep != tag_child);
 		_starpu_spin_lock(&tag_dep->lock);
 		_starpu_tag_add_succ(tag_dep, cg);
 		_starpu_spin_unlock(&tag_dep->lock);
@@ -261,6 +262,7 @@ void starpu_tag_declare_deps(starpu_tag_t id, unsigned ndeps, ...)
 		 * so cg should be among dep_id's successors*/
 		STARPU_TRACE_CODELET_TAG_DEPS(id, dep_id);
 		struct starpu_tag_s *tag_dep = gettag_struct(dep_id);
+		STARPU_ASSERT(tag_dep != tag_child);
 		_starpu_spin_lock(&tag_dep->lock);
 		_starpu_tag_add_succ(tag_dep, cg);
 		_starpu_spin_unlock(&tag_dep->lock);