mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Fixed the type casting benchmark for float16
This commit is contained in:
parent
7d5b17087f
commit
166b56bc61
@ -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);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user