Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
VTK-m
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
VTK
VTK-m
Commits
a9d092ef
Commit
a9d092ef
authored
6 years ago
by
Robert Maynard
Browse files
Options
Downloads
Patches
Plain Diff
Optimize TransferInfo / VirtualObjectTransfer for shared memory systems
parent
ee6917a5
No related branches found
No related tags found
1 merge request
!1498
first round of optimizations to reduce array handle virtual binary size
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vtkm/cont/StorageVirtual.hxx
+30
-1
30 additions, 1 deletion
vtkm/cont/StorageVirtual.hxx
with
30 additions
and
1 deletion
vtkm/cont/StorageVirtual.hxx
+
30
−
1
View file @
a9d092ef
...
...
@@ -24,6 +24,8 @@
#include
<vtkm/cont/TryExecute.h>
#include
<vtkm/cont/internal/TransferInfo.h>
#include
<vtkm/cont/internal/VirtualObjectTransferShareWithControl.h>
namespace
vtkm
{
namespace
cont
...
...
@@ -34,12 +36,39 @@ template <typename DerivedPortal>
struct
TransferToDevice
{
template
<
typename
DeviceAdapterTag
,
typename
Payload
,
typename
...
Args
>
bool
operator
()(
DeviceAdapterTag
devId
,
Payload
&&
payload
,
Args
&&
...
args
)
const
inline
bool
operator
()(
DeviceAdapterTag
devId
,
Payload
&&
payload
,
Args
&&
...
args
)
const
{
using
TransferType
=
cont
::
internal
::
VirtualObjectTransfer
<
DerivedPortal
,
DeviceAdapterTag
>
;
using
shared_memory_transfer
=
std
::
is_base_of
<
vtkm
::
cont
::
internal
::
VirtualObjectTransferShareWithControl
<
DerivedPortal
>
,
TransferType
>
;
return
this
->
Transfer
(
devId
,
shared_memory_transfer
{},
std
::
forward
<
Payload
>
(
payload
),
std
::
forward
<
Args
>
(
args
)...);
}
template
<
typename
DeviceAdapterTag
,
typename
Payload
,
typename
...
Args
>
inline
bool
Transfer
(
DeviceAdapterTag
devId
,
std
::
true_type
,
Payload
&&
payload
,
Args
&&
...
args
)
const
{
//shared memory transfer so we just need
auto
smp_ptr
=
new
DerivedPortal
(
std
::
forward
<
Args
>
(
args
)...);
auto
host
=
std
::
unique_ptr
<
DerivedPortal
>
(
smp_ptr
);
payload
.
updateDevice
(
devId
,
std
::
move
(
host
),
smp_ptr
,
nullptr
);
return
true
;
}
template
<
typename
DeviceAdapterTag
,
typename
Payload
,
typename
...
Args
>
inline
bool
Transfer
(
DeviceAdapterTag
devId
,
std
::
false_type
,
Payload
&&
payload
,
Args
&&
...
args
)
const
{
//separate memory transfer
//construct all new transfer payload
using
TransferType
=
cont
::
internal
::
VirtualObjectTransfer
<
DerivedPortal
,
DeviceAdapterTag
>
;
auto
host
=
std
::
unique_ptr
<
DerivedPortal
>
(
new
DerivedPortal
(
std
::
forward
<
Args
>
(
args
)...));
auto
transfer
=
std
::
make_shared
<
TransferType
>
(
host
.
get
());
auto
device
=
transfer
->
PrepareForExecution
(
true
);
...
...
This diff is collapsed.
Click to expand it.
Robert Maynard
@robertmaynard
mentioned in commit
831a0bf8
·
6 years ago
mentioned in commit
831a0bf8
mentioned in commit 831a0bf844e5f46c104b9d75c3f0f9f3431163c3
Toggle commit list
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