Commit f030f6e5 authored by Quentin Khan's avatar Quentin Khan

FAdaptiveSequential: refactor M2L to reduce call count

parent 329d98bc
......@@ -147,14 +147,21 @@ public:
// M2L
void v_list_step() {
std::vector<decltype(std::declval<const node_t>().getData())> v_item_data_list;
std::vector<int> v_item_indices;
for(node_t& node : _tree.in_order_walk()) {
v_item_data_list.clear();
v_item_indices.clear();
// Needed to compute offset between boxes
for(node_t* v_item : node.V) {
int v_item_index[1] = {compute_box_offset_index(&node, v_item, 3)};
const typename node_t::data_t* v_item_data[1] = {v_item->getData()};
v_item_indices.push_back(compute_box_offset_index(&node, v_item, 3));
v_item_data_list.push_back(v_item->getData());
// Call kernel M2L operator
_kernel.M2L(node.getData(), v_item_data, v_item_index, 1, static_cast<int>(node.getDepth()));
}
_kernel.M2L(node.getData(), v_item_data_list.data(), v_item_indices.data(), static_cast<int>(node.V.size()), static_cast<int>(node.getDepth()));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment