-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Hi, we are using dash in a student project to implement matrix transpose in distributed memory, we want implement a block data copy from global to global by dash::copy. But there is a complied error.(try on development and bug-656-copy). If this is my code's own error, sorry about that.
Thanks
Error:
1.couldn't deduce template parameter 'ValueType' dash::copy(src_g_begin, src_g_end, des_g_begin); GlobOutputIt copy
2. mismatched types 'ValueType*' and 'dash::GlobIter<float, dash::BlockPattern<2 (dash::MemArrange)1, long int>, dash::GlobStaticMemdash::HostSpace, dash::GlobPtr<float, dash::GlobStaticMemdash::HostSpace >, dash::GlobRef >' dash::copy(src_g_begin, src_g_end, des_g_begin);
This is the function code like example bench.07.local-copy:
for (index_t i = 0; i < blockDimy; i++) {
for (index_t j = 0; j < blockDimx; j++) {
index_t src_block_index = i * blockDimy + j;
index_t des_block_index = j * blockDimx + i;
auto source_block = data_temp.block(src_block_index);
auto dest_block = data_out.block(des_block_index);
size_t block_size = source_block.size();
index_t copy_start_index = source_block.offset(0);
index_t copy_end_index = copy_start_index + block_size;
auto des_start_index = dest_block.offset(0);
auto src_g_begin = data_temp.begin() + copy_start_index;
auto src_g_end = data_temp.begin() + copy_end_index;
auto des_g_begin = data_out.begin() + des_start_index;
dash::copy(src_g_begin, src_g_end, des_g_begin);
}
}
and the patterns are:
dash::TeamSpec<2> ts;
dash::SizeSpec<2> ss(testcase, testcase);
dash::DistributionSpec<2> ds(dash::TILE(TILESIZE), dash::TILE(TILESIZE)); // TUNING
ts.balance_extents();
dash::Pattern<2> pattern(ss, ds, ts);
Array_t data_in(pattern);
Array_t data_out(pattern);
Array_t data_temp(pattern);