mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-27 07:29:52 +08:00
Made sure to use a tensor of rank 0 to store the result of a full reduction in the tensor thread pool test
This commit is contained in:
parent
d0db95f730
commit
2053478c56
@ -239,15 +239,15 @@ void test_multithreaded_reductions() {
|
||||
Tensor<float, 2, DataLayout> t1(num_rows, num_cols);
|
||||
t1.setRandom();
|
||||
|
||||
Tensor<float, 1, DataLayout> full_redux(1);
|
||||
Tensor<float, 0, DataLayout> full_redux;
|
||||
full_redux = t1.sum();
|
||||
|
||||
Tensor<float, 1, DataLayout> full_redux_tp(1);
|
||||
Tensor<float, 0, DataLayout> full_redux_tp;
|
||||
full_redux_tp.device(thread_pool_device) = t1.sum();
|
||||
|
||||
// Check that the single threaded and the multi threaded reductions return
|
||||
// the same result.
|
||||
VERIFY_IS_APPROX(full_redux(0), full_redux_tp(0));
|
||||
VERIFY_IS_APPROX(full_redux(), full_redux_tp());
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user