Fixed the type casting benchmark for float16

This commit is contained in:
Benoit Steiner 2016-04-07 22:45:54 -07:00
parent 7d5b17087f
commit 166b56bc61

View File

@ -48,6 +48,10 @@ template <typename Device, typename T> class BenchmarkSuite {
Eigen::array<TensorIndex, 2> sizes; Eigen::array<TensorIndex, 2> sizes;
sizes[0] = m_; sizes[0] = m_;
sizes[1] = k_; sizes[1] = k_;
if (sizeof(T) < sizeof(int)) {
sizes[0] = m_ * sizeof(T) / sizeof(int);
sizes[1] = k_ * sizeof(T) / sizeof(int);
}
const TensorMap<Tensor<int, 2, 0, TensorIndex>, Eigen::Aligned> A((int*)a_, sizes); const TensorMap<Tensor<int, 2, 0, TensorIndex>, Eigen::Aligned> A((int*)a_, sizes);
TensorMap<Tensor<T, 2, 0, TensorIndex>, Eigen::Aligned> B(b_, sizes); TensorMap<Tensor<T, 2, 0, TensorIndex>, Eigen::Aligned> B(b_, sizes);