@@ -672,6 +672,17 @@ static char* dump_local_assignments( void** elem, void* arg )
672672 if ( dos > 0 ) {
673673 string_arena_init (info -> sa );
674674 string_arena_add_string (info -> sa , "const int %s = %s%s.value;" , def -> name , info -> holder , def -> name );
675+ #if 0
676+ jdf_expr_t * type_str = jdf_find_property ( def -> properties , "type" , NULL );
677+ if ( NULL == type_str ) {
678+ string_arena_add_string (info -> sa , "const int %s = %s%s.value;" , def -> name , info -> holder , def -> name );
679+ } else {
680+ expr_info_t expr_info = {.sa = info -> sa , .prefix = "" , .suffix = "" , .assignments = "locals" };
681+ string_arena_add_string (info -> sa , "const %s %s = %s%s.value;" ,
682+ dump_expr ((void * * )type_str , & expr_info ),
683+ def -> name , info -> holder , def -> name );
684+ }
685+ #endif
675686 if ( dos > 1 )
676687 string_arena_add_string (info -> sa , " (void)%s;" , def -> name );
677688 return string_arena_get_string (info -> sa );
@@ -5649,12 +5660,19 @@ jdf_generate_code_call_initialization(const jdf_t *jdf, const jdf_call_t *call,
56495660
56505661 /* Code to create & fulfill a reshape promise locally in case this input dependency is typed */
56515662 jdf_generate_code_reshape_input_from_dep (jdf , f , flow , dl , spaces );
5652- coutput ("%s this_task->data._f_%s.data_out = parsec_data_get_copy(chunk->original, target_device);\n"
5653- "#if defined(PARSEC_PROF_GRAPHER) && defined(PARSEC_PROF_TRACE)\n"
5663+ /* TODO: Setting the data_out here is kind of random, especially as some copy of the input flow. The only thing
5664+ * that would make sense here is to set the data_out to the dep outputs back into the user memory (output
5665+ * dep with a target into a data collection), to give the opportunity to the accelerator components to
5666+ * do a pushout to the desired location (instead of the current approach that will do a pushout to the
5667+ * data_copy on device 0 followed by a memcpy into the desired location).
5668+ */
5669+ //coutput("%s this_task->data._f_%s.data_out = parsec_data_get_copy(chunk->original, target_device);\n",
5670+ // spaces, flow->varname);
5671+
5672+ coutput ("#if defined(PARSEC_PROF_GRAPHER) && defined(PARSEC_PROF_TRACE)\n"
56545673 "%s parsec_prof_grapher_data_input(chunk->original, (parsec_task_t*)this_task, &%s, 0);\n"
56555674 "#endif\n"
56565675 "%s }\n" ,
5657- spaces , flow -> varname ,
56585676 spaces , JDF_OBJECT_ONAME ( flow ),
56595677 spaces );
56605678 }
@@ -6512,10 +6530,10 @@ jdf_generate_code_data_lookup(const jdf_t *jdf,
65126530 * This way, it's only retained once during release_deps.
65136531 */
65146532 coutput (" if( NULL == this_task->repo_entry ){\n"
6515- " this_task->repo_entry = data_repo_lookup_entry_and_create(es, %s_repo, "
6533+ " this_task->repo_entry = data_repo_lookup_entry_and_create(es, %s_repo, \n "
65166534 " %s((const parsec_taskpool_t*)__parsec_tp, (const parsec_assignment_t*)&this_task->locals));\n"
6517- " data_repo_entry_addto_usage_limit(%s_repo, this_task->repo_entry->ht_item.key, 1);"
6518- " this_task->repo_entry ->generator = (void*)this_task; /* for AYU */\n"
6535+ " data_repo_entry_addto_usage_limit(%s_repo, this_task->repo_entry->ht_item.key, 1);\n "
6536+ " this_task->repo_entry->generator = (void*)this_task; /* for AYU */\n"
65196537 "#if defined(PARSEC_SIM)\n"
65206538 " assert(this_task->repo_entry ->sim_exec_date == 0);\n"
65216539 " this_task->repo_entry ->sim_exec_date = this_task->sim_exec_date;\n"
@@ -6525,7 +6543,7 @@ jdf_generate_code_data_lookup(const jdf_t *jdf,
65256543 jdf_property_get_string (f -> properties , JDF_PROP_UD_MAKE_KEY_FN_NAME , NULL ),
65266544 f -> fname );
65276545
6528- coutput (" /* The reshape repo is the current task repo. */"
6546+ coutput (" /* The reshape repo is the current task repo. */\n "
65296547 " reshape_repo = %s_repo;\n"
65306548 " reshape_entry_key = %s((const parsec_taskpool_t*)__parsec_tp, (const parsec_assignment_t*)&this_task->locals) ;\n"
65316549 " reshape_entry = this_task->repo_entry;\n" ,
@@ -7033,6 +7051,12 @@ static void jdf_generate_code_hook(const jdf_t *jdf,
70337051 output = UTIL_DUMP_LIST (sa , f -> dataflow , next ,
70347052 dump_data_initialization_from_data_array , & ai2 , "" , "" , "" , "" );
70357053 if ( 0 != strlen (output ) ) {
7054+ coutput ("/* Make sure we have the data_out set to the data_in */\n" );
7055+ for ( fl = f -> dataflow ; fl != NULL ; fl = fl -> next ) {
7056+ if ( fl -> flow_flags & JDF_FLOW_TYPE_CTL ) continue ;
7057+ coutput (" this_task->data._f_%s.data_out = this_task->data._f_%s.data_in;\n" ,
7058+ fl -> varname , fl -> varname );
7059+ }
70367060 coutput (" /** Declare the variables that will hold the data, and all the accounting for each */\n"
70377061 "%s\n" ,
70387062 output );
0 commit comments