You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to migrate a TTG task to another process. To do this, migrate() calls migrate_data() for each input data index of the task.
void migrate(parsec_task_t* parsec_task, int dst )
{
int nb_input = parsec_task->task_class->dependencies_goal;
if constexpr (!ttg::meta::is_void_v<keyT> )
{
keyT key;
unpack(key, parsec_task->ttg_key, 0);
for(int i = 0; i < nb_input; i++)
migrate_data(i, key, parsec_task, dst);
auto &world_impl = world.impl();
world_impl.taskpool()->tdm.module->taskpool_addto_nb_tasks(world_impl.taskpool(), -1);
}
}
template <typename Key>
void migrate_data(int data_index, const Key &key, parsec_task_t* parsec_task, int dst )
{
using valueT = typename std::tuple_element<data_index, input_terminals_type>::type::value_type;
parsec_data_copy_t *copy;
copy = parsec_task->data[data_index].data_in;
auto data = copy->device_private;
using decvalueT = std::decay_t<valueT>;
decvalueT val;
pack(val, data, 0);
set_arg_impl<data_index>(key, std::move(val), dst);
}
To get the type of data to use pack() I used
using valueT = typename std::tuple_element<data_index, input_terminals_type>::type::value_type;
But when I do this I get an error:
ttg/ttg/ttg/parsec/ttg.h:568:84: error: ‘data_index’ is not a constant expression
568 | using valueT = typename std::tuple_element<data_index, input_terminals_type>::type::value_type;
Is there a way to overcome this?
The text was updated successfully, but these errors were encountered:
The problem is that the argument to tuple_element has to be a compile-time constant. Try something like this:
template <typename Key, int data_index>
void migrate_data(const Key &key, parsec_task_t* parsec_task, int dst )
{
using valueT = typename std::tuple_element<data_index, input_terminals_type>::type::value_type;
...
}
You can then recursively iterate over the std::tuple_size_v<input_terminals_type> using make_integer_sequence. For an example, check out register_input_callbacks in the PaRSEC ttg backend :)
I am trying to migrate a TTG task to another process. To do this, migrate() calls migrate_data() for each input data index of the task.
To get the type of data to use pack() I used
But when I do this I get an error:
Is there a way to overcome this?
The text was updated successfully, but these errors were encountered: