|
@@ -225,8 +225,11 @@ struct starpu_task *_starpu_detect_implicit_data_deps_with_handle(struct starpu_
|
|
struct _starpu_job *pre_sync_job = _starpu_get_job_associated_to_task(pre_sync_task);
|
|
struct _starpu_job *pre_sync_job = _starpu_get_job_associated_to_task(pre_sync_task);
|
|
struct _starpu_job *post_sync_job = _starpu_get_job_associated_to_task(post_sync_task);
|
|
struct _starpu_job *post_sync_job = _starpu_get_job_associated_to_task(post_sync_task);
|
|
|
|
|
|
- if (mode & STARPU_R)
|
|
|
|
- STARPU_ASSERT_MSG(handle->initialized || handle->init_cl, "Handle %p is not initialized, it cannot be read", handle);
|
|
|
|
|
|
+ if (mode & STARPU_R && !handle->initialized) {
|
|
|
|
+ STARPU_ASSERT_MSG(handle->init_cl, "Handle %p is not initialized, it cannot be read", handle);
|
|
|
|
+ /* The task will initialize it with init_cl */
|
|
|
|
+ handle->initialized = 1;
|
|
|
|
+ }
|
|
|
|
|
|
if (mode & STARPU_W || mode == STARPU_REDUX)
|
|
if (mode & STARPU_W || mode == STARPU_REDUX)
|
|
{
|
|
{
|