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
851c3271
Commit
851c3271
authored
3 years ago
by
Gunther Weber
Browse files
Options
Downloads
Patches
Plain Diff
Clean-up 0f CopyArrayByIndices and CopyVecArrayByIndices helpers
parent
89fc3be8
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!2615
Draft: DONTMERGE ME: TEST FOR 1.7.0-rc1 is our 9th official release of VTK-m.
,
!2443
Contour tree performance improvements (ContourTreeMesh)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vtkm/worklet/contourtree_augmented/meshtypes/ContourTreeMesh.h
+20
-14
20 additions, 14 deletions
...worklet/contourtree_augmented/meshtypes/ContourTreeMesh.h
with
20 additions
and
14 deletions
vtkm/worklet/contourtree_augmented/meshtypes/ContourTreeMesh.h
+
20
−
14
View file @
851c3271
...
...
@@ -416,36 +416,42 @@ inline ContourTreeMesh<FieldType>::ContourTreeMesh(const IdArrayType& nodes,
#endif
}
// Helper function to copy select set of indices of source array into
// select set of inidces of destination array. Important: srcIndices
// and dstIndices must contain the same number of values.
template
<
typename
PT1
,
typename
PT2
,
typename
PT3
,
typename
PT4
>
inline
void
CopyArrayByIndices
(
const
PT1
&
srcArray
,
const
PT2
&
srcIndices
,
PT3
&
tg
tArray
,
const
PT4
&
tg
tIndices
)
PT3
&
ds
tArray
,
const
PT4
&
ds
tIndices
)
{
VTKM_ASSERT
(
srcIndices
.
GetNumberOfValues
()
==
tg
tIndices
.
GetNumberOfValues
());
VTKM_ASSERT
(
srcIndices
.
GetNumberOfValues
()
==
ds
tIndices
.
GetNumberOfValues
());
auto
srcPermutation
=
make_ArrayHandlePermutation
(
srcIndices
,
srcArray
);
auto
tg
tPermuation
=
make_ArrayHandlePermutation
(
tg
tIndices
,
tg
tArray
);
vtkm
::
cont
::
Algorithm
::
Copy
(
srcPermutation
,
tg
tPermuation
);
auto
ds
tPermuation
=
make_ArrayHandlePermutation
(
ds
tIndices
,
ds
tArray
);
vtkm
::
cont
::
Algorithm
::
Copy
(
srcPermutation
,
ds
tPermuation
);
}
// Helper function doing the same as previous function, but for
// arrays of vector. This is necessary since we use an array
// created with ArrayHandleGroupVecVariable as destination,
// which breaks some conventions of ArrayHandle and does not work
// with vtkm::cont::Algorithm::Copy.
template
<
typename
PT1
,
typename
PT2
,
typename
PT3
,
typename
PT4
>
inline
void
CopyVecArrayByIndices
(
const
PT1
&
srcArray
,
const
PT2
&
srcIndices
,
PT3
&
tg
tArray
,
const
PT4
&
tg
tIndices
)
PT3
&
ds
tArray
,
const
PT4
&
ds
tIndices
)
{
VTKM_ASSERT
(
srcIndices
.
GetNumberOfValues
()
==
tg
tIndices
.
GetNumberOfValues
());
VTKM_ASSERT
(
srcIndices
.
GetNumberOfValues
()
==
ds
tIndices
.
GetNumberOfValues
());
auto
srcPermutation
=
make_ArrayHandlePermutation
(
srcIndices
,
srcArray
);
auto
tgtPermuation
=
make_ArrayHandlePermutation
(
tgtIndices
,
tgtArray
);
auto
dstPermuation
=
make_ArrayHandlePermutation
(
dstIndices
,
dstArray
);
// Use a worklet for copying data since ArrayHandleGroupVecVariable does
// not work as destination for vtkm::cont::Algorithm::Copy.
vtkm
::
cont
::
Invoker
invoke
;
invoke
(
contourtree_mesh_inc_ns
::
CopyIntoCombinedNeighborsWorklet
{},
srcPermutation
,
tgtPermuation
);
// Why doesn't the following copy work instead?
//vtkm::cont::Algorithm::Copy(srcPermutation, tgtPermuation);
contourtree_mesh_inc_ns
::
CopyIntoCombinedNeighborsWorklet
{},
srcPermutation
,
dstPermuation
);
}
// Initalize the contour tree from the arcs array
template
<
typename
FieldType
>
inline
void
ContourTreeMesh
<
FieldType
>::
InitializeNeighborConnectivityFromArcs
(
...
...
This diff is collapsed.
Click to expand it.
Gunther Weber
@ghweber
mentioned in commit
6c7a062b
·
3 years ago
mentioned in commit
6c7a062b
mentioned in commit 6c7a062b019bb4cce8a4ed8395312ae9103bcd1c
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