瀏覽代碼

src/util/starpu_insert_task_utils.c: use macros to access codelet
modes

Nathalie Furmento 12 年之前
父節點
當前提交
d85294aa48
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      src/util/starpu_insert_task_utils.c

+ 6 - 4
src/util/starpu_insert_task_utils.c

@@ -241,17 +241,19 @@ int _starpu_insert_task_create_and_submit(void *arg_buffer, size_t arg_buffer_si
 			STARPU_ASSERT(cl != NULL);
 
 			_STARPU_TASK_SET_HANDLE((*task), handle, current_buffer);
-			if (cl->modes[current_buffer])
+			if (_STARPU_CODELET_GET_MODE(cl, current_buffer))
 			{
-				STARPU_ASSERT_MSG(cl->modes[current_buffer] == mode, "The codelet <%s> defines the access mode %d for the buffer %d which is different from the mode %d given to starpu_insert_task\n",
-						  cl->name, cl->modes[current_buffer], current_buffer, mode);
+				STARPU_ASSERT_MSG(_STARPU_CODELET_GET_MODE(cl, current_buffer) == mode,
+						   "The codelet <%s> defines the access mode %d for the buffer %d which is different from the mode %d given to starpu_insert_task\n",
+						  cl->name, _STARPU_CODELET_GET_MODE(cl, current_buffer),
+						  current_buffer, mode);
 			}
 			else
 			{
 #ifdef STARPU_DEVEL
 #  warning shall we print a warning to the user
 #endif
-				cl->modes[current_buffer] = mode;
+				_STARPU_CODELET_SET_MODE(cl, mode, current_buffer);
 			}
 
 			current_buffer++;