Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
bff71102
Commit
bff71102
authored
6 years ago
by
Stéphane Del Pino
Browse files
Options
Downloads
Patches
Plain Diff
Use SFINAE to forbid specification of sub_item_type = item_type
parent
af463f72
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!6
Feature/crs
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mesh/SubItemValuePerItem.hpp
+19
-7
19 additions, 7 deletions
src/mesh/SubItemValuePerItem.hpp
with
19 additions
and
7 deletions
src/mesh/SubItemValuePerItem.hpp
+
19
−
7
View file @
bff71102
...
@@ -10,15 +10,27 @@
...
@@ -10,15 +10,27 @@
#include
<ConnectivityUtils.hpp>
#include
<ConnectivityUtils.hpp>
template
<
typename
DataType
,
template
<
typename
DataType
,
ItemType
SubItemType
,
ItemType
sub_item_type
,
ItemType
ItemType
>
ItemType
item_type
,
class
SubItemValuePerItem
typename
Allowed
=
void
>
class
SubItemValuePerItem
;
template
<
typename
DataType
,
ItemType
sub_item_type
,
ItemType
item_type
>
class
SubItemValuePerItem
<
DataType
,
sub_item_type
,
item_type
,
std
::
enable_if_t
<
sub_item_type
!=
item_type
>>
{
{
private:
private:
ConnectivityMatrix
::
HostRowType
m_host_row_map
;
ConnectivityMatrix
::
HostRowType
m_host_row_map
;
Kokkos
::
View
<
DataType
*>
m_values
;
Kokkos
::
View
<
DataType
*>
m_values
;
friend
SubItemValuePerItem
<
std
::
add_const_t
<
DataType
>
,
SubItemType
,
ItemType
>
;
// Allows const version to access our data
friend
SubItemValuePerItem
<
std
::
add_const_t
<
DataType
>
,
sub_item_type
,
item_type
>
;
public:
public:
class
SubView
class
SubView
...
@@ -132,7 +144,7 @@ class SubItemValuePerItem
...
@@ -132,7 +144,7 @@ class SubItemValuePerItem
template
<
typename
DataType2
>
template
<
typename
DataType2
>
KOKKOS_INLINE_FUNCTION
KOKKOS_INLINE_FUNCTION
SubItemValuePerItem
&
SubItemValuePerItem
&
operator
=
(
const
SubItemValuePerItem
<
DataType2
,
S
ub
I
tem
T
ype
,
I
tem
T
ype
>&
sub_item_value_per_item
)
operator
=
(
const
SubItemValuePerItem
<
DataType2
,
s
ub
_i
tem
_t
ype
,
i
tem
_t
ype
>&
sub_item_value_per_item
)
{
{
// ensures that DataType is the same as source DataType2
// ensures that DataType is the same as source DataType2
static_assert
(
std
::
is_same
<
std
::
remove_const_t
<
DataType
>
,
std
::
remove_const_t
<
DataType2
>>
(),
static_assert
(
std
::
is_same
<
std
::
remove_const_t
<
DataType
>
,
std
::
remove_const_t
<
DataType2
>>
(),
...
@@ -148,7 +160,7 @@ class SubItemValuePerItem
...
@@ -148,7 +160,7 @@ class SubItemValuePerItem
template
<
typename
DataType2
>
template
<
typename
DataType2
>
KOKKOS_INLINE_FUNCTION
KOKKOS_INLINE_FUNCTION
SubItemValuePerItem
(
const
SubItemValuePerItem
<
DataType2
,
S
ub
I
tem
T
ype
,
I
tem
T
ype
>&
sub_item_value_per_item
)
SubItemValuePerItem
(
const
SubItemValuePerItem
<
DataType2
,
s
ub
_i
tem
_t
ype
,
i
tem
_t
ype
>&
sub_item_value_per_item
)
{
{
this
->
operator
=
(
sub_item_value_per_item
);
this
->
operator
=
(
sub_item_value_per_item
);
}
}
...
@@ -158,7 +170,7 @@ class SubItemValuePerItem
...
@@ -158,7 +170,7 @@ class SubItemValuePerItem
SubItemValuePerItem
(
const
IConnectivity
&
connectivity
)
SubItemValuePerItem
(
const
IConnectivity
&
connectivity
)
{
{
ConnectivityMatrix
connectivity_matrix
ConnectivityMatrix
connectivity_matrix
=
connectivity
.
getMatrix
(
I
tem
T
ype
,
SubI
tem
T
ype
);
=
connectivity
.
getMatrix
(
i
tem
_t
ype
,
sub_i
tem
_t
ype
);
m_host_row_map
=
connectivity_matrix
.
rowsMap
();
m_host_row_map
=
connectivity_matrix
.
rowsMap
();
m_values
=
Kokkos
::
View
<
DataType
*>
(
"values"
,
connectivity_matrix
.
numEntries
());
m_values
=
Kokkos
::
View
<
DataType
*>
(
"values"
,
connectivity_matrix
.
numEntries
());
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment