mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 21:33:55 +00:00
Merge branch 'implicit_shortening_on_mult'
This commit is contained in:
commit
0748cdb320
12
vtkm/Types.h
12
vtkm/Types.h
@ -1159,12 +1159,16 @@ T dot(const vtkm::Vec<T,4> &a, const vtkm::Vec<T,4> &b)
|
||||
return (a[0]*b[0]) + (a[1]*b[1]) + (a[2]*b[2]) + (a[3]*b[3]);
|
||||
}
|
||||
|
||||
//Integer types of a width less than an integer get implicitly casted to
|
||||
//an integer when doing a multiplication.
|
||||
#define VTK_M_INTEGER_PROMOTION_SCALAR_DOT(type) \
|
||||
VTKM_EXEC_CONT_EXPORT type dot(type a, type b) { return static_cast<type>(a * b); }
|
||||
VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::Int8)
|
||||
VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::UInt8)
|
||||
VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::Int16)
|
||||
VTK_M_INTEGER_PROMOTION_SCALAR_DOT(vtkm::UInt16)
|
||||
#define VTK_M_SCALAR_DOT(type) \
|
||||
VTKM_EXEC_CONT_EXPORT type dot(type a, type b) { return a * b; }
|
||||
VTK_M_SCALAR_DOT(vtkm::Int8)
|
||||
VTK_M_SCALAR_DOT(vtkm::UInt8)
|
||||
VTK_M_SCALAR_DOT(vtkm::Int16)
|
||||
VTK_M_SCALAR_DOT(vtkm::UInt16)
|
||||
VTK_M_SCALAR_DOT(vtkm::Int32)
|
||||
VTK_M_SCALAR_DOT(vtkm::UInt32)
|
||||
VTK_M_SCALAR_DOT(vtkm::Int64)
|
||||
|
Loading…
Reference in New Issue
Block a user