mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 19:59:05 +08:00
Fixed a few compilation warnings
This commit is contained in:
parent
3f1ee45833
commit
6720b38fbf
@ -41,7 +41,10 @@ class TensorStorage<T, FixedDimensions, Options_>
|
|||||||
private:
|
private:
|
||||||
static const std::size_t Size = FixedDimensions::total_size;
|
static const std::size_t Size = FixedDimensions::total_size;
|
||||||
|
|
||||||
EIGEN_ALIGN_MAX T m_data[Size];
|
// Allocate an array of size at least one to prevent compiler warnings.
|
||||||
|
static const std::size_t MinSize = max_n_1<Size>::size;
|
||||||
|
EIGEN_ALIGN_MAX T m_data[MinSize];
|
||||||
|
|
||||||
FixedDimensions m_dimensions;
|
FixedDimensions m_dimensions;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -16,16 +16,20 @@ static void test_empty_tensor()
|
|||||||
{
|
{
|
||||||
Tensor<float, 2> source;
|
Tensor<float, 2> source;
|
||||||
Tensor<float, 2> tgt1 = source;
|
Tensor<float, 2> tgt1 = source;
|
||||||
Tensor<float, 2> tgt2;
|
Tensor<float, 2> tgt2(source);
|
||||||
tgt2 = source;
|
Tensor<float, 2> tgt3;
|
||||||
|
tgt3 = tgt1;
|
||||||
|
tgt3 = tgt2;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_empty_fixed_size_tensor()
|
static void test_empty_fixed_size_tensor()
|
||||||
{
|
{
|
||||||
TensorFixedSize<float, Sizes<0>> source;
|
TensorFixedSize<float, Sizes<0>> source;
|
||||||
TensorFixedSize<float, Sizes<0>> tgt1 = source;
|
TensorFixedSize<float, Sizes<0>> tgt1 = source;
|
||||||
TensorFixedSize<float, Sizes<0>> tgt2;
|
TensorFixedSize<float, Sizes<0>> tgt2(source);
|
||||||
tgt2 = source;
|
TensorFixedSize<float, Sizes<0>> tgt3;
|
||||||
|
tgt3 = tgt1;
|
||||||
|
tgt3 = tgt2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user