Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
waLBerla
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sudesh Rathnayake
waLBerla
Commits
0da4cd55
Commit
0da4cd55
authored
1 year ago
by
Philipp Suffa
Browse files
Options
Downloads
Patches
Plain Diff
Allow multiGPU by setting correct device to MPI process[skip ci]
parent
5cf0f412
Branches
suffa/SYCL
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/tutorials/sycl/SYCLTest.cpp
+13
-3
13 additions, 3 deletions
apps/tutorials/sycl/SYCLTest.cpp
apps/tutorials/sycl/SYCLTest.prm
+1
-1
1 addition, 1 deletion
apps/tutorials/sycl/SYCLTest.prm
with
14 additions
and
4 deletions
apps/tutorials/sycl/SYCLTest.cpp
+
13
−
3
View file @
0da4cd55
...
@@ -142,8 +142,19 @@ int main(int argc, char** argv)
...
@@ -142,8 +142,19 @@ int main(int argc, char** argv)
auto
blocks
=
blockforest
::
createUniformBlockGridFromConfig
(
walberlaEnv
.
config
());
auto
blocks
=
blockforest
::
createUniformBlockGridFromConfig
(
walberlaEnv
.
config
());
#if defined(WALBERLA_BUILD_WITH_SYCL)
#if defined(WALBERLA_BUILD_WITH_SYCL)
WALBERLA_LOG_PROGRESS
(
"Create SYCL queue"
)
WALBERLA_LOG_PROGRESS
(
"Create SYCL queue"
)
auto
syclQueue
=
make_shared
<
sycl
::
queue
>
(
sycl
::
default_selector_v
);
auto
mpiRank
=
mpi
::
MPIManager
::
instance
()
->
worldRank
();
WALBERLA_LOG_INFO
(
"Running SYCL for MPI process "
<<
mpi
::
MPIManager
::
instance
()
->
worldRank
()
<<
" on "
<<
(
*
syclQueue
).
get_device
().
get_info
<
cl
::
sycl
::
info
::
device
::
name
>
())
//FOR MULTI GPU
std
::
vector
<
sycl
::
device
>
Devs
;
for
(
const
auto
&
plt
:
sycl
::
platform
::
get_platforms
())
{
if
(
plt
.
get_backend
()
==
sycl
::
backend
::
ext_oneapi_cuda
)
Devs
.
push_back
(
plt
.
get_devices
()[
0
]);
}
auto
syclQueue
=
make_shared
<
sycl
::
queue
>
(
Devs
[
mpiRank
]);
//FOR CPU
//auto syclQueue = make_shared<sycl::queue> (sycl::default_selector_v);
WALBERLA_LOG_INFO
(
"Running SYCL for MPI process "
<<
mpiRank
<<
" on "
<<
(
*
syclQueue
).
get_device
().
get_info
<
cl
::
sycl
::
info
::
device
::
name
>
())
//WALBERLA_LOG_INFO("Max hardware threads are " << sycl::default_selector().select_device().get_info<sycl::info::device::max_compute_units>());
//WALBERLA_LOG_INFO("Max hardware threads are " << sycl::default_selector().select_device().get_info<sycl::info::device::max_compute_units>());
blocks
->
setSYCLQueue
(
syclQueue
);
blocks
->
setSYCLQueue
(
syclQueue
);
#endif
#endif
...
@@ -239,7 +250,6 @@ int main(int argc, char** argv)
...
@@ -239,7 +250,6 @@ int main(int argc, char** argv)
// Timeloop
// Timeloop
if
(
timestepStrategy
==
"fullSim"
)
{
if
(
timestepStrategy
==
"fullSim"
)
{
communication
();
timeloop
.
add
()
<<
BeforeFunction
(
communication
,
"communication"
)
<<
Sweep
(
deviceSyncWrapper
(
SYCLTestSweep
),
"SYCL Sweep"
);
timeloop
.
add
()
<<
BeforeFunction
(
communication
,
"communication"
)
<<
Sweep
(
deviceSyncWrapper
(
SYCLTestSweep
),
"SYCL Sweep"
);
}
}
else
if
(
timestepStrategy
==
"kernelOnly"
)
{
else
if
(
timestepStrategy
==
"kernelOnly"
)
{
...
...
This diff is collapsed.
Click to expand it.
apps/tutorials/sycl/SYCLTest.prm
+
1
−
1
View file @
0da4cd55
...
@@ -22,7 +22,7 @@ ShearFlowSetup
...
@@ -22,7 +22,7 @@ ShearFlowSetup
DomainSetup
DomainSetup
{
{
blocks <
1
, 1, 1 >;
blocks <
2
, 1, 1 >;
cellsPerBlock < 1000, 1000, 1 >;
cellsPerBlock < 1000, 1000, 1 >;
periodic < 0, 0, 0 >;
periodic < 0, 0, 0 >;
oneBlockPerProcess true;
oneBlockPerProcess true;
...
...
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