Remove HasCast and fix packetmath cast tests.

The use of the `packet_traits<>::HasCast` field is currently inconsistent with
`type_casting_traits<>`, and is unused apart from within
`test/packetmath.cpp`. In addition, those packetmath cast tests do not
currently reflect how casts are performed in practice: they ignore the
`SrcCoeffRatio` and `TgtCoeffRatio` fields, assuming a 1:1 ratio.

Here we remove the unsed `HasCast`, and modify the packet cast tests to
better reflect their usage.
This commit is contained in:
Antonio Sanchez
2020-05-28 10:41:28 -07:00
committed by Antonio Sánchez
parent 463ec86648
commit a7d2552af8
4 changed files with 102 additions and 71 deletions

View File

@@ -53,7 +53,6 @@ static void test_static_reshape() {
Eigen::IndexList<type2index<2>, type2index<3>, type2index<7>> dim;
Tensor<float, 3> reshaped = tensor.reshape(static_cast<Eigen::DSizes<ptrdiff_t,3>>(dim));
for (int i = 0; i < 2; ++i) {
for (int j = 0; j < 3; ++j) {
for (int k = 0; k < 7; ++k) {