Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ScalFMM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
solverstack
ScalFMM
Commits
25288237
Commit
25288237
authored
Oct 05, 2016
by
Quentin Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FAdaptiveTask: change to new kernel interface
parent
494c57c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
45 additions
and
25 deletions
+45
-25
Src/Adaptive/new/FAdaptiveTask.hpp
Src/Adaptive/new/FAdaptiveTask.hpp
+45
-25
No files found.
Src/Adaptive/new/FAdaptiveTask.hpp
View file @
25288237
...
...
@@ -23,15 +23,15 @@
#include "Kernels/FKernelConcepts.hpp"
template
<
class
_Tree
,
class
_Kernel
,
typename
std
::
enable_if
<
scalfmm
::
sfinae
::
has_P2M
<
_Tree
,
_Kernel
>
::
value
>::
type
*
=
nullptr
,
typename
std
::
enable_if
<
scalfmm
::
sfinae
::
has_M2M
<
_Tree
,
_Kernel
>::
value
>::
type
*
=
nullptr
,
typename
std
::
enable_if
<
scalfmm
::
sfinae
::
has_M2L
<
_Tree
,
_Kernel
>::
value
>::
type
*
=
nullptr
,
typename
std
::
enable_if
<
scalfmm
::
sfinae
::
has_L2L
<
_Tree
,
_Kernel
>::
value
>::
type
*
=
nullptr
,
typename
std
::
enable_if
<
scalfmm
::
sfinae
::
has_L2P
<
_Tree
,
_Kernel
>::
value
>::
type
*
=
nullptr
,
typename
std
::
enable_if
<
scalfmm
::
sfinae
::
has_partial_P2P
<
_Tree
,
_Kernel
>::
value
>::
type
*
=
nullptr
,
typename
std
::
enable_if
<
scalfmm
::
sfinae
::
has_M2P
<
_Tree
,
_Kernel
>::
value
>::
type
*
=
nullptr
,
typename
std
::
enable_if
<
scalfmm
::
sfinae
::
has_P2L
<
_Tree
,
_Kernel
>::
value
>::
type
*
=
nullptr
template
<
class
_Tree
,
class
_Kernel
//
,
//
typename std::enable_if<scalfmm::sfinae::has_P2M<_Tree, _Kernel>::value>::type* = nullptr,
//
typename std::enable_if<scalfmm::sfinae::has_M2M<_Tree, _Kernel>::value>::type* = nullptr,
//
typename std::enable_if<scalfmm::sfinae::has_M2L<_Tree, _Kernel>::value>::type* = nullptr,
//
typename std::enable_if<scalfmm::sfinae::has_L2L<_Tree, _Kernel>::value>::type* = nullptr,
//
typename std::enable_if<scalfmm::sfinae::has_L2P<_Tree, _Kernel>::value>::type* = nullptr,
//
typename std::enable_if<scalfmm::sfinae::has_partial_P2P<_Tree, _Kernel>::value>::type* = nullptr,
//
typename std::enable_if<scalfmm::sfinae::has_M2P<_Tree, _Kernel>::value>::type* = nullptr,
//
typename std::enable_if<scalfmm::sfinae::has_P2L<_Tree, _Kernel>::value>::type* = nullptr
>
class
FAdaptiveTask
:
public
FAlgorithmInterface
,
public
FAlgorithmTimers
{
public:
...
...
@@ -297,7 +297,10 @@ public:
depend(inout: m_dep[:1])
{
const
int
thread_num
=
omp_get_thread_num
();
_kernels
[
thread_num
]
->
P2M
(
leaf
->
getData
(),
leaf
->
getParticleContainer
());
_kernels
[
thread_num
]
->
P2M
(
&
(
leaf
->
getData
()
->
getMultipoleData
()),
&
(
leaf
->
getSymbolicData
()),
leaf
->
getParticleContainer
());
}
}
...
...
@@ -346,15 +349,15 @@ public:
const
int
thread_num
=
omp_get_thread_num
();
// Fill array of children data
std
::
array
<
typename
node_t
::
data_t
*
,
node_t
::
child_count
>
child_data
;
typename
node_t
::
data_t
::
multipole_t
*
child_data
[
node_t
::
child_count
]
=
{}
;
for
(
node_t
*
child
:
node
->
getChildren
())
{
// Last bits of child index give the index relative to parent
child_data
[
child
->
getIndex
()
&
(
node_t
::
child_count
-
1
)]
=
child
->
getData
(
);
child_data
[
child
->
getIndex
()
&
(
node_t
::
child_count
-
1
)]
=
&
(
child
->
getData
()
->
getMultipoleData
()
);
}
// Call kernel module
this
->
_kernels
[
thread_num
]
->
M2M
(
node
->
getData
(),
child_data
.
data
(),
static_cast
<
int
>
(
node
->
getDepth
()));
this
->
_kernels
[
thread_num
]
->
M2M
(
&
(
node
->
getData
()
->
getMultipoleData
()),
child_data
,
static_cast
<
int
>
(
node
->
getDepth
()));
}
}
...
...
@@ -750,7 +753,7 @@ public:
const
int
thread_num
=
omp_get_thread_num
();
std
::
vector
<
decltype
(
std
::
declval
<
const
node_t
>
().
getData
())
>
v_item_data_list
;
std
::
vector
<
typename
node_t
::
data_t
::
multipole_t
*
>
v_item_data_list
;
std
::
vector
<
int
>
v_item_indices
;
// Needed to compute offset between boxes
for
(
node_t
*
v_item
:
node
->
V
)
{
...
...
@@ -759,11 +762,16 @@ public:
continue
;
}
v_item_indices
.
push_back
(
compute_box_offset_index
(
node
,
v_item
,
3
));
v_item_data_list
.
push_back
(
v_item
->
getData
(
));
v_item_data_list
.
push_back
(
&
(
v_item
->
getData
()
->
getMultipoleData
()
));
}
// Call kernel M2L operator
this
->
_kernels
[
thread_num
]
->
M2L
(
node
->
getData
(),
v_item_data_list
.
data
(),
v_item_indices
.
data
(),
static_cast
<
int
>
(
v_item_data_list
.
size
()),
static_cast
<
int
>
(
node
->
getDepth
()));
this
->
_kernels
[
thread_num
]
->
M2L
(
&
(
node
->
getData
()
->
getLocalExpansionData
()),
v_item_data_list
.
data
(),
v_item_indices
.
data
(),
static_cast
<
int
>
(
v_item_data_list
.
size
()),
static_cast
<
int
>
(
node
->
getDepth
()));
}
}
...
...
@@ -800,7 +808,10 @@ public:
#pragma omp task firstprivate(leaf, w_item) depend(in: ps_dep[:1]) depend(inout: w_dep[:1])
{
const
int
thread_num
=
omp_get_thread_num
();
this
->
_kernels
[
thread_num
]
->
P2L
(
w_item
->
getData
(),
leaf
->
getParticleContainer
());
this
->
_kernels
[
thread_num
]
->
P2L
(
&
(
w_item
->
getData
()
->
getLocalExpansionData
()),
&
(
w_item
->
getSymbolicData
()),
leaf
->
getParticleContainer
());
}
}
}
...
...
@@ -847,11 +858,14 @@ public:
{
const
int
thread_num
=
omp_get_thread_num
();
typename
node_t
::
data_t
*
child_data
[
node_t
::
child_count
];
typename
node_t
::
data_t
::
local_expansion_t
*
child_data
[
node_t
::
child_count
];
for
(
std
::
size_t
i
=
0
;
i
<
node_t
::
child_count
;
++
i
)
{
child_data
[
i
]
=
node
->
getChild
(
i
)
->
getData
(
);
child_data
[
i
]
=
&
(
node
->
getChild
(
i
)
->
getData
()
->
getLocalExpansionData
()
);
}
this
->
_kernels
[
thread_num
]
->
L2L
(
node
->
getData
(),
child_data
,
static_cast
<
int
>
(
node
->
getDepth
()));
this
->
_kernels
[
thread_num
]
->
L2L
(
&
(
node
->
getData
()
->
getLocalExpansionData
()),
child_data
,
static_cast
<
int
>
(
node
->
getDepth
()));
}
}
...
...
@@ -884,7 +898,10 @@ public:
#pragma omp task depend(inout: pt_dep[:1]) depend(in: w_dep[:1])
{
const
int
thread_num
=
omp_get_thread_num
();
this
->
_kernels
[
thread_num
]
->
M2P
(
w_item
->
getData
(),
leaf
->
getParticleContainer
());
this
->
_kernels
[
thread_num
]
->
M2P
(
&
(
w_item
->
getData
()
->
getMultipoleData
()),
&
(
w_item
->
getSymbolicData
()),
leaf
->
getParticleContainer
());
}
}
}
...
...
@@ -911,7 +928,10 @@ public:
#pragma omp task depend(inout: pt_dep[:1]) depend(in: data_dep[:1])
{
const
int
thread_num
=
omp_get_thread_num
();
this
->
_kernels
[
thread_num
]
->
L2P
(
leaf
->
getData
(),
leaf
->
getParticleContainer
());
this
->
_kernels
[
thread_num
]
->
L2P
(
&
(
leaf
->
getData
()
->
getLocalExpansionData
()),
&
(
leaf
->
getSymbolicData
()),
leaf
->
getParticleContainer
());
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment