Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NP_TMcode
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Giacomo Mulas
NP_TMcode
Commits
512cf50a
Commit
512cf50a
authored
1 month ago
by
Giovanni La Mura
Browse files
Options
Downloads
Patches
Plain Diff
Create a global host work-space to allocate thread-private device work-spaces
parent
938cbc92
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/trapping/cfrfme.cpp
+12
-5
12 additions, 5 deletions
src/trapping/cfrfme.cpp
with
12 additions
and
5 deletions
src/trapping/cfrfme.cpp
+
12
−
5
View file @
512cf50a
...
@@ -401,15 +401,22 @@ void frfme(string data_file, string output_path) {
...
@@ -401,15 +401,22 @@ void frfme(string data_file, string output_path) {
int
size_vkzm
=
nkv
*
nkv
;
int
size_vkzm
=
nkv
*
nkv
;
const
dcomplex
*
vec_tt1_wk
=
tt1
->
wk
;
const
dcomplex
*
vec_tt1_wk
=
tt1
->
wk
;
int
size_tt1_wk
=
nkv
*
nkv
*
nlmmt
;
int
size_tt1_wk
=
nkv
*
nkv
*
nlmmt
;
dcomplex
*
global_vec_w
=
new
dcomplex
[
nkv
*
nkv
*
(
jlml
-
jlmf
+
1
)]();
dcomplex
**
global_w
=
new
dcomplex
*
[
nkv
*
(
jlml
-
jlmf
+
1
)];
int
size_global_vec_w
=
nkv
*
nkv
*
(
jlml
-
jlmf
+
1
);
int
size_global_w
=
nkv
*
(
jlml
-
jlmf
+
1
);
#ifdef USE_TARGET_OFFLOAD
#ifdef USE_TARGET_OFFLOAD
#pragma omp target teams distribute parallel for simd map(tofrom: vec_wsum[0:size_wsum]) map(to:vec_vkzm[0:size_vkzm], vkv[0:nkv], vec_tt1_wk[0:size_tt1_wk], _xv[0:nxv], _yv[0:nyv], _zv[0:nzv], jlmf, jlml, nkv, nlmmt, nrvc, nxv, nyv, nzv, frsh, uim, delks)
#pragma omp target teams distribute parallel for simd map(tofrom: vec_wsum[0:size_wsum]) \
map(to:vec_vkzm[0:size_vkzm], vkv[0:nkv], vec_tt1_wk[0:size_tt1_wk], _xv[0:nxv], _yv[0:nyv], _zv[0:nzv]) \
map(alloc:global_w[0:size_global_w], global_vec_w[0:size_global_vec_w]) \
firstprivate(jlmf, jlml, nkv, nlmmt, nrvc, nxv, nyv, nzv, frsh, uim, delks)
#else
#else
#pragma omp parallel for simd
#pragma omp parallel for simd
#endif
#endif
for
(
int
j80
=
jlmf
-
1
;
j80
<
jlml
;
j80
++
)
{
for
(
int
j80
=
jlmf
-
1
;
j80
<
jlml
;
j80
++
)
{
int
nkvs
=
nkv
*
nkv
;
int
nkvs
=
nkv
*
nkv
;
dcomplex
*
vec_w
=
(
dcomplex
*
)
calloc
(
nkvs
,
sizeof
(
dcomplex
)
);
dcomplex
*
vec_w
=
global_vec_w
+
nkvs
*
(
j80
-
jlmf
+
1
);
dcomplex
**
w
=
(
dcomplex
**
)
calloc
(
nkv
,
sizeof
(
dcomplex
*
)
);
dcomplex
**
w
=
global_w
+
nkv
*
(
j80
-
jlmf
+
1
);
for
(
int
wi
=
0
;
wi
<
nkv
;
wi
++
)
w
[
wi
]
=
vec_w
+
wi
*
nkv
;
for
(
int
wi
=
0
;
wi
<
nkv
;
wi
++
)
w
[
wi
]
=
vec_w
+
wi
*
nkv
;
dcomplex
wk_value
;
dcomplex
wk_value
;
int
wk_index
=
0
;
int
wk_index
=
0
;
...
@@ -449,9 +456,9 @@ void frfme(string data_file, string output_path) {
...
@@ -449,9 +456,9 @@ void frfme(string data_file, string output_path) {
}
// jy60x55 loop
}
// jy60x55 loop
vec_wsum
[((
j80
)
*
nrvc
)
+
ixyz
]
=
sumy
*
delks
;
vec_wsum
[((
j80
)
*
nrvc
)
+
ixyz
]
=
sumy
*
delks
;
}
// ixyz loop
}
// ixyz loop
free
(
vec_w
);
free
(
w
);
}
// j80 loop
}
// j80 loop
delete
[]
global_w
;
delete
[]
global_vec_w
;
#ifdef USE_NVTX
#ifdef USE_NVTX
nvtxRangePop
();
nvtxRangePop
();
nvtxRangePush
(
"Closing operations"
);
nvtxRangePush
(
"Closing operations"
);
...
...
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