Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Sreekanth Arikatla
VTK-m
Commits
bdb9c37e
Commit
bdb9c37e
authored
Jan 17, 2018
by
Li-Ta Lo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update based on issues pointed out by Robert
parent
a713a0d8
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
24 deletions
+20
-24
vtkm/worklet/connectivities/CellSetConnectivity.h
vtkm/worklet/connectivities/CellSetConnectivity.h
+4
-3
vtkm/worklet/connectivities/CellSetDualGraph.h
vtkm/worklet/connectivities/CellSetDualGraph.h
+4
-4
vtkm/worklet/connectivities/GraphConnectivity.h
vtkm/worklet/connectivities/GraphConnectivity.h
+9
-9
vtkm/worklet/connectivities/InnerJoin.h
vtkm/worklet/connectivities/InnerJoin.h
+0
-3
vtkm/worklet/testing/UnitTestCellSetConnectivity.cpp
vtkm/worklet/testing/UnitTestCellSetConnectivity.cpp
+1
-1
vtkm/worklet/testing/UnitTestInnerJoin.cxx
vtkm/worklet/testing/UnitTestInnerJoin.cxx
+2
-4
No files found.
vtkm/worklet/connectivities/CellSetConnectivity.h
View file @
bdb9c37e
...
...
@@ -25,12 +25,13 @@
#include <vtkm/worklet/connectivities/CellSetDualGraph.h>
#include <vtkm/worklet/connectivities/GraphConnectivity.h>
template
<
typename
DeviceAdapter
>
class
CellSetConnectivity
{
public:
template
<
template
<
typename
>
class
CellSetType
,
typename
T
>
void
Run
(
const
CellSetType
<
T
>&
cellSet
,
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>&
componentArray
)
const
template
<
typename
CellSetType
,
typename
DeviceAdapter
>
void
Run
(
const
CellSetType
&
cellSet
,
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>&
componentArray
,
DeviceAdapter
)
const
{
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
numIndicesArray
;
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
indexOffsetArray
;
...
...
vtkm/worklet/connectivities/CellSetDualGraph.h
View file @
bdb9c37e
...
...
@@ -62,7 +62,7 @@ struct EdgeExtract : public vtkm::worklet::WorkletMapPointToCell
typename
EdgeIndexVecType
>
VTKM_EXEC
void
operator
()(
CellShapeTag
cellShape
,
CellIndexType
cellIndex
,
PointIndexVecType
&
pointIndices
,
const
PointIndexVecType
&
pointIndices
,
vtkm
::
IdComponent
visitIndex
,
CellIndexType
&
cellIndexOut
,
EdgeIndexVecType
&
edgeIndices
)
const
...
...
@@ -119,12 +119,12 @@ public:
{
// Get number of edges for each cell and use it as scatter count.
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
IdComponent
>
numEdgesPerCell
;
vtkm
::
worklet
::
DispatcherMapTopology
<
EdgeCount
>
edgesPerCellDisp
;
vtkm
::
worklet
::
DispatcherMapTopology
<
EdgeCount
,
DeviceAdapter
>
edgesPerCellDisp
;
edgesPerCellDisp
.
Invoke
(
cellSet
,
numEdgesPerCell
);
// Get uncompress Cell to Edge mapping
vtkm
::
worklet
::
ScatterCounting
scatter
{
numEdgesPerCell
,
DeviceAdapter
()
};
vtkm
::
worklet
::
DispatcherMapTopology
<
EdgeExtract
>
edgeExtractDisp
{
scatter
};
vtkm
::
worklet
::
DispatcherMapTopology
<
EdgeExtract
,
DeviceAdapter
>
edgeExtractDisp
{
scatter
};
edgeExtractDisp
.
Invoke
(
cellSet
,
cellIds
,
cellEdges
);
}
...
...
@@ -166,7 +166,7 @@ public:
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
connTo
;
connFrom
.
Allocate
(
sharedEdges
.
GetNumberOfValues
()
*
2
);
connTo
.
Allocate
(
sharedEdges
.
GetNumberOfValues
()
*
2
);
vtkm
::
worklet
::
DispatcherMapField
<
CellToCellConnectivity
>
c2cDisp
;
vtkm
::
worklet
::
DispatcherMapField
<
CellToCellConnectivity
,
DeviceAdapter
>
c2cDisp
;
c2cDisp
.
Invoke
(
lb
,
cellIds
,
connFrom
,
connTo
);
// Turn dual graph into Compressed Sparse Row format
...
...
vtkm/worklet/connectivities/GraphConnectivity.h
View file @
bdb9c37e
...
...
@@ -67,11 +67,11 @@ public:
template
<
typename
InOutPortalType
>
VTKM_EXEC
void
operator
()(
vtkm
::
Id
index
,
InOutPortalType
&
comp
)
const
{
while
(
comp
.
Get
(
comp
.
Get
(
index
))
!=
comp
.
Get
(
index
))
comp
.
S
et
(
index
,
comp
.
Get
(
comp
.
Get
(
index
))
);
//vtkm::Id parent =
comp.
G
et(index);
//comp.Set(index, comp.Get(comp.Get(index)));
// keep updating component id until we reach the root of the tree.
for
(
auto
parent
=
comp
.
G
et
(
index
);
comp
.
Get
(
parent
)
!=
parent
;
parent
=
comp
.
Get
(
index
))
{
comp
.
S
et
(
index
,
comp
.
Get
(
parent
)
);
}
};
};
...
...
@@ -113,16 +113,16 @@ public:
do
{
vtkm
::
worklet
::
DispatcherMapField
<
Graft
>
graftDispatcher
;
vtkm
::
worklet
::
DispatcherMapField
<
Graft
,
DeviceAdapter
>
graftDispatcher
;
graftDispatcher
.
Invoke
(
cellIds
,
indexOffsetArray
,
numIndexArray
,
connectivityArray
,
components
);
// Detection of allStar has come before pointer jumping. Don't try to rearrange it.
vtkm
::
worklet
::
DispatcherMapField
<
IsStar
>
isStarDisp
;
// Detection of allStar has
to
come before pointer jumping. Don't try to rearrange it.
vtkm
::
worklet
::
DispatcherMapField
<
IsStar
,
DeviceAdapter
>
isStarDisp
;
isStarDisp
.
Invoke
(
cellIds
,
components
,
isStar
);
allStar
=
Algorithm
::
Reduce
(
isStar
,
true
,
vtkm
::
LogicalAnd
());
vtkm
::
worklet
::
DispatcherMapField
<
PointerJumping
>
pointJumpingDispatcher
;
vtkm
::
worklet
::
DispatcherMapField
<
PointerJumping
,
DeviceAdapter
>
pointJumpingDispatcher
;
pointJumpingDispatcher
.
Invoke
(
cellIds
,
components
);
}
while
(
!
allStar
);
...
...
vtkm/worklet/connectivities/InnerJoin.h
View file @
bdb9c37e
...
...
@@ -100,9 +100,6 @@ public:
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
counts
;
Algorithm
::
Transform
(
ubs
,
lbs
,
counts
,
vtkm
::
Subtract
());
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
output_offset
;
Algorithm
::
ScanExclusive
(
counts
,
output_offset
);
vtkm
::
worklet
::
ScatterCounting
scatter
{
counts
,
DeviceAdapter
()
};
Merge
merge
(
scatter
);
vtkm
::
worklet
::
DispatcherMapField
<
Merge
,
DeviceAdapter
>
mergeDisp
(
merge
);
...
...
vtkm/worklet/testing/UnitTestCellSetConnectivity.cpp
View file @
bdb9c37e
...
...
@@ -135,7 +135,7 @@ public:
auto
cellSet
=
outputData
.
GetCellSet
().
Cast
<
vtkm
::
cont
::
CellSetSingleType
<>>
();
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
componentArray
;
CellSetConnectivity
<
DeviceAdapter
>
().
Run
(
cellSet
,
componentArray
);
CellSetConnectivity
().
Run
(
cellSet
,
componentArray
,
DeviceAdapter
()
);
using
Algorithm
=
vtkm
::
cont
::
DeviceAdapterAlgorithm
<
DeviceAdapter
>
;
Algorithm
::
Sort
(
componentArray
);
...
...
vtkm/worklet/testing/UnitTestInnerJoin.cxx
View file @
bdb9c37e
...
...
@@ -60,10 +60,8 @@ public:
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
idxA
;
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
idxB
;
Algorithm
::
Copy
(
vtkm
::
cont
::
ArrayHandleCounting
<
vtkm
::
Id
>
(
0
,
1
,
A_arr
.
GetNumberOfValues
()),
idxA
);
Algorithm
::
Copy
(
vtkm
::
cont
::
ArrayHandleCounting
<
vtkm
::
Id
>
(
0
,
1
,
B_arr
.
GetNumberOfValues
()),
idxB
);
Algorithm
::
Copy
(
vtkm
::
cont
::
ArrayHandleIndex
(
A_arr
.
GetNumberOfValues
()),
idxA
);
Algorithm
::
Copy
(
vtkm
::
cont
::
ArrayHandleIndex
(
B_arr
.
GetNumberOfValues
()),
idxB
);
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
joinedIndex
;
vtkm
::
cont
::
ArrayHandle
<
vtkm
::
Id
>
outA
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment