Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ecpcitest
vtk-m
Commits
f3a6931f
Commit
f3a6931f
authored
Mar 02, 2021
by
Kenneth Moreland
Browse files
Fix casting issues in TBB functors
parent
cc5b9a01
Changes
1
Hide whitespace changes
Inline
Side-by-side
vtkm/cont/tbb/internal/FunctorsTBB.h
View file @
f3a6931f
...
...
@@ -460,14 +460,17 @@ struct ReduceBody
template
<
class
InputPortalType
,
typename
T
,
class
BinaryOperationType
>
VTKM_CONT
static
T
ReducePortals
(
InputPortalType
inputPortal
,
T
initialValue
,
BinaryOperationType
binaryOperation
)
VTKM_CONT
static
auto
ReducePortals
(
InputPortalType
inputPortal
,
T
initialValue
,
BinaryOperationType
binaryOperation
)
->
decltype
(
binaryOperation
(
initialValue
,
inputPortal
.
Get
(
0
)))
{
using
WrappedBinaryOp
=
internal
::
WrappedBinaryOperator
<
T
,
BinaryOperationType
>
;
using
ResultType
=
decltype
(
binaryOperation
(
initialValue
,
inputPortal
.
Get
(
0
)));
using
WrappedBinaryOp
=
internal
::
WrappedBinaryOperator
<
ResultType
,
BinaryOperationType
>
;
WrappedBinaryOp
wrappedBinaryOp
(
binaryOperation
);
ReduceBody
<
InputPortalType
,
T
,
WrappedBinaryOp
>
body
(
inputPortal
,
initialValue
,
wrappedBinaryOp
);
ReduceBody
<
InputPortalType
,
ResultType
,
WrappedBinaryOp
>
body
(
inputPortal
,
initialValue
,
wrappedBinaryOp
);
vtkm
::
Id
arrayLength
=
inputPortal
.
GetNumberOfValues
();
if
(
arrayLength
>
1
)
...
...
@@ -484,7 +487,7 @@ VTKM_CONT static T ReducePortals(InputPortalType inputPortal,
else
// arrayLength == 0
{
// ReduceBody does not work with an array of size 0.
return
initialValue
;
return
static_cast
<
ResultType
>
(
initialValue
)
;
}
}
...
...
Atkins, Charles Vernon
@atkins3
mentioned in commit
91d13bdf
·
Mar 08, 2021
mentioned in commit
91d13bdf
mentioned in commit 91d13bdfb260f244fa20af258ac977876ebbf3dd
Toggle commit list
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