Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lammps
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
Container Registry
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
multiscale
lammps
Commits
7fb4faa4
Commit
7fb4faa4
authored
8 years ago
by
Dan Ibanez
Browse files
Options
Downloads
Patches
Plain Diff
draft CUDA-callable version of Domain::unmap
parent
41c9357d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/KOKKOS/domain_kokkos.h
+25
-0
25 additions, 0 deletions
src/KOKKOS/domain_kokkos.h
with
25 additions
and
0 deletions
src/KOKKOS/domain_kokkos.h
+
25
−
0
View file @
7fb4faa4
...
...
@@ -16,6 +16,7 @@
#include
"domain.h"
#include
"kokkos_type.h"
#include
"kokkos_few.h"
namespace
LAMMPS_NS
{
...
...
@@ -54,6 +55,10 @@ class DomainKokkos : public Domain {
KOKKOS_INLINE_FUNCTION
void
operator
()(
TagDomain_x2lamda
,
const
int
&
)
const
;
static
KOKKOS_INLINE_FUNCTION
Few
<
double
,
3
>
unmap
(
Few
<
double
,
3
>
prd
,
Few
<
double
,
6
>
h
,
int
triclinic
,
Few
<
double
,
3
>
x
,
imageint
image
);
private
:
double
lo
[
3
],
hi
[
3
],
period
[
3
];
int
n_flip
,
m_flip
,
p_flip
;
...
...
@@ -61,6 +66,26 @@ class DomainKokkos : public Domain {
ArrayTypes
<
LMPDeviceType
>::
t_imageint_1d
image
;
};
KOKKOS_INLINE_FUNCTION
Few
<
double
,
3
>
DomainKokkos
::
unmap
(
Few
<
double
,
3
>
prd
,
Few
<
double
,
6
>
h
,
int
triclinic
,
Few
<
double
,
3
>
x
,
imageint
image
)
{
int
xbox
=
(
image
&
IMGMASK
)
-
IMGMAX
;
int
ybox
=
(
image
>>
IMGBITS
&
IMGMASK
)
-
IMGMAX
;
int
zbox
=
(
image
>>
IMG2BITS
)
-
IMGMAX
;
Few
<
double
,
3
>
y
;
if
(
triclinic
==
0
)
{
y
[
0
]
=
x
[
0
]
+
xbox
*
prd
[
0
];
y
[
1
]
=
x
[
1
]
+
ybox
*
prd
[
1
];
y
[
2
]
=
x
[
2
]
+
zbox
*
prd
[
2
];
}
else
{
y
[
0
]
=
x
[
0
]
+
h
[
0
]
*
xbox
+
h
[
5
]
*
ybox
+
h
[
4
]
*
zbox
;
y
[
1
]
=
x
[
1
]
+
h
[
1
]
*
ybox
+
h
[
3
]
*
zbox
;
y
[
2
]
=
x
[
2
]
+
h
[
2
]
*
zbox
;
}
return
y
;
}
}
#endif
...
...
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