@@ -1492,9 +1492,9 @@ namespace ttg_parsec {
14921492
14931493 auto discard_tmp_flows = [&](){
14941494 for (int i = 0 ; i < MAX_PARAM_COUNT ; ++i) {
1495- if (gpu_task->flow [i]->flow_flags & TTG_PARSEC_FLOW_ACCESS_TMP ) {
1495+ if (gpu_task->flow_info [i]. flow ->flow_flags & TTG_PARSEC_FLOW_ACCESS_TMP ) {
14961496 /* temporary flow, discard by setting it to read-only to avoid evictions */
1497- const_cast < parsec_flow_t *>( gpu_task->flow [i]) ->flow_flags = PARSEC_FLOW_ACCESS_READ ;
1497+ gpu_task->flow_info [i]. flow ->flow_flags = PARSEC_FLOW_ACCESS_READ ;
14981498 task->parsec_task .data [i].data_out ->readers = 1 ;
14991499 }
15001500 }
@@ -1534,10 +1534,14 @@ namespace ttg_parsec {
15341534 if (task->dev_ptr ->gpu_task == nullptr ) {
15351535
15361536 /* set up a device task */
1537- parsec_gpu_task_t *gpu_task;
1537+ /* *
1538+ * TODO: don't use gpu_dsl_task here! We store out own set of flows.
1539+ */
1540+ parsec_gpu_dsl_task_t *dsl_gpu_task;
15381541 /* PaRSEC wants to free the gpu_task, because F***K ownerships */
1539- gpu_task = static_cast <parsec_gpu_task_t *>(std::calloc (1 , sizeof (*gpu_task)));
1540- PARSEC_OBJ_CONSTRUCT (gpu_task, parsec_list_item_t );
1542+ dsl_gpu_task = static_cast <parsec_gpu_dsl_task_t *>(std::calloc (1 , sizeof (*dsl_gpu_task)));
1543+ PARSEC_OBJ_CONSTRUCT (dsl_gpu_task, parsec_gpu_dsl_task_t );
1544+ parsec_gpu_task_t *gpu_task = &dsl_gpu_task->super ;
15411545 gpu_task->ec = parsec_task;
15421546 gpu_task->task_type = 0 ; // user task
15431547 gpu_task->last_data_check_epoch = std::numeric_limits<uint64_t >::max (); // used internally
@@ -1546,7 +1550,7 @@ namespace ttg_parsec {
15461550 parsec_flow_t *flows = task->dev_ptr ->flows ;
15471551 /* set up flow information so it is available for pushout */
15481552 for (uint8_t i = 0 ; i < MAX_PARAM_COUNT ; ++i) {
1549- gpu_task->flow [i] = &flows[i]; // will be set in register_device_memory
1553+ gpu_task->flow_info [i]. flow = &flows[i]; // will be set in register_device_memory
15501554 /* ignore the flow */
15511555 flows[i] = parsec_flow_t {.name = nullptr ,
15521556 .sym_type = PARSEC_FLOW_ACCESS_NONE ,
@@ -1579,10 +1583,11 @@ namespace ttg_parsec {
15791583
15801584 // input flows are set up during register_device_memory as part of the first invocation above
15811585 for (int i = 0 ; i < MAX_PARAM_COUNT ; ++i) {
1582- tc.in [i] = gpu_task->flow [i];
1583- tc.out [i] = gpu_task->flow [i];
1586+ tc.in [i] = gpu_task->flow_info [i]. flow ;
1587+ tc.out [i] = gpu_task->flow_info [i]. flow ;
15841588 }
15851589 tc.nb_flows = MAX_PARAM_COUNT ;
1590+ gpu_task->nb_flows = MAX_PARAM_COUNT ;
15861591
15871592 /* set the device hint on the data */
15881593 TT *tt = task->tt ;
@@ -2262,13 +2267,13 @@ namespace ttg_parsec {
22622267 } else if constexpr (!ttg::has_split_metadata<decvalueT>::value) {
22632268 if (inline_data) {
22642269 detail::foreach_parsec_data (val, [&](parsec_data_t * data){
2265- read_inline_data (ttg::iovec{data->nb_elts , data->device_copies [data->owner_device ]->device_private });
2270+ read_inline_data (ttg::iovec{data->span , data->device_copies [data->owner_device ]->device_private });
22662271 });
22672272 } else {
22682273 auto activation = create_activation_fn ();
22692274 detail::foreach_parsec_data (val, [&](parsec_data_t * data){
22702275 parsec_atomic_fetch_inc_int32 (&data->device_copies [data->owner_device ]->readers );
2271- handle_iovec_fn (ttg::iovec{data->nb_elts , data->device_copies [data->owner_device ]->device_private }, activation);
2276+ handle_iovec_fn (ttg::iovec{data->span , data->device_copies [data->owner_device ]->device_private }, activation);
22722277 });
22732278 }
22742279 }
@@ -2819,7 +2824,7 @@ namespace ttg_parsec {
28192824 } else {
28202825 /* TODO: how can we query the iovecs of the buffers here without actually packing the data? */
28212826 metadata_size = ttg::default_data_descriptor<ttg::meta::remove_cvr_t <Value>>::payload_size (value_ptr);
2822- detail::foreach_parsec_data (*value_ptr, [&](parsec_data_t * data){ iov_size += data->nb_elts ; });
2827+ detail::foreach_parsec_data (*value_ptr, [&](parsec_data_t * data){ iov_size += data->span ; });
28232828 }
28242829 /* key is packed at the end */
28252830 std::size_t key_pack_size = ttg::default_data_descriptor<Key>::payload_size (&key);
@@ -2968,7 +2973,7 @@ namespace ttg_parsec {
29682973 /* Try to find a device that is not the host and has the latest version. */
29692974 std::tie (device, device_copy) = detail::find_device_copy (data);
29702975 }
2971- handle_iovec_fn (ttg::iovec{data->nb_elts , data->device_copies [device]->device_private },
2976+ handle_iovec_fn (ttg::iovec{data->span , data->device_copies [device]->device_private },
29722977 device_copy);
29732978 });
29742979 }
@@ -3159,7 +3164,7 @@ namespace ttg_parsec {
31593164 /* Try to find a device that is not the host and has the latest version. */
31603165 std::tie (device, device_copy) = detail::find_device_copy (data);
31613166 }
3162- handle_iov_fn (ttg::iovec{data->nb_elts ,
3167+ handle_iov_fn (ttg::iovec{data->span ,
31633168 data->device_copies [device]->device_private },
31643169 device_copy);
31653170 });
@@ -3533,8 +3538,8 @@ namespace ttg_parsec {
35333538 /* find the flow */
35343539 int flowidx = 0 ;
35353540 while (flowidx < MAX_PARAM_COUNT &&
3536- gpu_task->flow [flowidx] != nullptr &&
3537- gpu_task->flow [flowidx]->flow_flags != PARSEC_FLOW_ACCESS_NONE ) {
3541+ gpu_task->flow_info [flowidx]. flow != nullptr &&
3542+ gpu_task->flow_info [flowidx]. flow ->flow_flags != PARSEC_FLOW_ACCESS_NONE ) {
35383543 if (detail::parsec_ttg_caller->parsec_task .data [flowidx].data_in ->original == data) {
35393544 /* found the right data, set the corresponding flow as pushout */
35403545 break ;
@@ -3544,14 +3549,14 @@ namespace ttg_parsec {
35443549 if (flowidx == MAX_PARAM_COUNT ) {
35453550 throw std::runtime_error (" Cannot add more than MAX_PARAM_COUNT flows to a task!" );
35463551 }
3547- if (gpu_task->flow [flowidx]->flow_flags == PARSEC_FLOW_ACCESS_NONE ) {
3552+ if (gpu_task->flow_info [flowidx]. flow ->flow_flags == PARSEC_FLOW_ACCESS_NONE ) {
35483553 /* no flow found, add one and mark it pushout */
35493554 detail::parsec_ttg_caller->parsec_task .data [flowidx].data_in = data->device_copies [0 ];
35503555 detail::parsec_ttg_caller->parsec_task .data [flowidx].data_out = data->device_copies [data->owner_device ];
3551- gpu_task->flow_nb_elts [flowidx] = data->nb_elts ;
3556+ gpu_task->flow_info [flowidx]. flow_span = data->span ;
35523557 }
35533558 /* need to mark the flow WRITE, otherwise PaRSEC will not do the pushout */
3554- (( parsec_flow_t *) gpu_task->flow [flowidx])->flow_flags |= PARSEC_FLOW_ACCESS_WRITE ;
3559+ const_cast < parsec_flow_t *>( gpu_task->flow_info [flowidx]. flow )->flow_flags |= PARSEC_FLOW_ACCESS_WRITE ;
35553560 gpu_task->pushout |= 1 <<flowidx;
35563561 }
35573562 };
0 commit comments