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
32cdc1f7
Commit
32cdc1f7
authored
May 20, 2016
by
Quentin Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
FKernelConcepts: SFINAE classes to check kernel capacities
The adaptive algorithm have been updated to use them.
parent
652a8070
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
178 additions
and
4 deletions
+178
-4
Src/Adaptive/new/FAdaptiveSequential.hpp
Src/Adaptive/new/FAdaptiveSequential.hpp
+13
-3
Src/Adaptive/new/FAdaptiveTask.hpp
Src/Adaptive/new/FAdaptiveTask.hpp
+13
-1
Src/Kernels/FKernelConcepts.hpp
Src/Kernels/FKernelConcepts.hpp
+152
-0
No files found.
Src/Adaptive/new/FAdaptiveSequential.hpp
View file @
32cdc1f7
...
...
@@ -12,9 +12,19 @@
#include "Containers/FTreeCoordinate.hpp"
#include "Utils/FAlgorithmTimers.hpp"
template
<
class
_Tree
,
class
_Kernel
>
#include "Kernels/FKernelConcepts.hpp"
template
<
class
_Tree
,
class
_Kernel
,
typename
std
::
enable_if
<
true
&&
scalfmm
::
sfinae
::
has_P2M
<
_Tree
,
_Kernel
>
::
value
&&
scalfmm
::
sfinae
::
has_M2M
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_M2L
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_L2L
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_L2P
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_P2P
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_M2P
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_P2L
<
_Tree
,
_Kernel
>::
value
>
::
type
*
=
nullptr
>
class
FAdaptiveSequential
:
public
FAlgorithmInterface
,
public
FAlgorithmTimers
{
public:
using
tree_t
=
_Tree
;
...
...
Src/Adaptive/new/FAdaptiveTask.hpp
View file @
32cdc1f7
...
...
@@ -21,7 +21,19 @@
#include "Containers/FTreeCoordinate.hpp"
#include "Utils/FAlgorithmTimers.hpp"
template
<
class
_Tree
,
class
_Kernel
>
#include "Kernels/FKernelConcepts.hpp"
template
<
class
_Tree
,
class
_Kernel
,
typename
std
::
enable_if
<
true
&&
scalfmm
::
sfinae
::
has_P2M
<
_Tree
,
_Kernel
>
::
value
&&
scalfmm
::
sfinae
::
has_M2M
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_M2L
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_L2L
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_L2P
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_partial_P2P
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_M2P
<
_Tree
,
_Kernel
>::
value
&&
scalfmm
::
sfinae
::
has_P2L
<
_Tree
,
_Kernel
>::
value
>
::
type
*
=
nullptr
>
class
FAdaptiveTask
:
public
FAlgorithmInterface
,
public
FAlgorithmTimers
{
public:
using
tree_t
=
_Tree
;
...
...
Src/Kernels/FKernelConcepts.hpp
0 → 100644
View file @
32cdc1f7
#ifndef FKERNEL_CONCEPTS_HPP
#define FKERNEL_CONCEPTS_HPP
#include <type_traits>
#include "Containers/FTreeCoordinate.hpp"
namespace
scalfmm
{
namespace
sfinae
{
namespace
details
{
#ifdef declare_has_method
#error declare_has_method macro is already defined... This needs fixing.
#endif
#define declare_has_method(name) \
template<typename K, typename Ret, typename ... Args> \
struct has_##name { \
template<typename...> using void_t = void; \
template<typename k, typename = void_t<> > \
struct check : std::false_type {}; \
template<typename k> \
struct check<k, void_t<decltype(std::declval<k>(). name(std::declval<Args>()...))> > \
: std::true_type {}; \
constexpr static const bool value = check<K>::value; \
};
declare_has_method
(
P2M
);
declare_has_method
(
P2L
);
declare_has_method
(
M2M
);
declare_has_method
(
M2P
);
declare_has_method
(
M2L
);
declare_has_method
(
L2L
);
declare_has_method
(
L2P
);
declare_has_method
(
P2P
);
#undef declare_has_method
}
template
<
typename
Tree
,
typename
Kernel
>
struct
has_M2P
{
enum
:
bool
{
value
=
details
::
has_M2P
<
Kernel
,
void
,
typename
Tree
::
node_t
::
data_t
*
,
typename
Tree
::
node_t
::
particle_container_t
*
>::
value
};
};
template
<
typename
Tree
,
typename
Kernel
>
struct
has_P2L
{
enum
:
bool
{
value
=
details
::
has_P2L
<
Kernel
,
void
,
typename
Tree
::
node_t
::
data_t
*
,
typename
Tree
::
node_t
::
particle_container_t
*
>::
value
};
};
template
<
typename
Tree
,
typename
Kernel
>
struct
has_P2M
{
enum
:
bool
{
value
=
details
::
has_P2M
<
Kernel
,
void
,
typename
Tree
::
node_t
::
data_t
*
,
typename
Tree
::
node_t
::
particle_container_t
*
>::
value
};
};
template
<
typename
Tree
,
typename
Kernel
>
struct
has_M2M
{
enum
:
bool
{
value
=
details
::
has_M2M
<
Kernel
,
void
,
typename
Tree
::
node_t
::
data_t
*
,
typename
Tree
::
node_t
::
data_t
**
,
int
>::
value
};
};
template
<
typename
Tree
,
typename
Kernel
>
struct
has_M2L
{
enum
:
bool
{
value
=
details
::
has_M2L
<
Kernel
,
void
,
typename
Tree
::
node_t
::
data_t
*
,
typename
Tree
::
node_t
::
data_t
const
**
,
int
*
,
int
,
int
>::
value
};
};
template
<
typename
Tree
,
typename
Kernel
>
struct
has_L2L
{
enum
:
bool
{
value
=
details
::
has_L2L
<
Kernel
,
void
,
typename
Tree
::
node_t
::
data_t
*
,
typename
Tree
::
node_t
::
data_t
**
,
int
>::
value
};
};
template
<
typename
Tree
,
typename
Kernel
>
struct
has_L2P
{
enum
:
bool
{
value
=
details
::
has_L2P
<
Kernel
,
void
,
typename
Tree
::
node_t
::
data_t
*
,
typename
Tree
::
node_t
::
particle_container_t
*
>::
value
};
};
template
<
typename
Tree
,
typename
Kernel
>
struct
has_P2P
{
enum
:
bool
{
value
=
details
::
has_P2P
<
Kernel
,
void
,
FTreeCoordinate
,
typename
Tree
::
node_t
::
particle_container_t
*
,
typename
Tree
::
node_t
::
particle_container_t
*
,
typename
Tree
::
node_t
::
particle_container_t
**
,
int
*
,
int
>::
value
};
};
template
<
typename
Tree
,
typename
Kernel
>
struct
has_partial_P2P
{
enum
:
bool
{
value
=
details
::
has_P2P
<
Kernel
,
void
,
FTreeCoordinate
,
typename
Tree
::
node_t
::
particle_container_t
*
,
typename
Tree
::
node_t
::
particle_container_t
*
,
typename
Tree
::
node_t
::
particle_container_t
**
,
int
*
,
int
,
bool
>::
value
};
};
}
}
#endif
/* FKERNEL_CONCEPTS_HPP */
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