Fix usages of Eigen::array to be compatible with std::array.

This commit is contained in:
Antonio Sánchez
2024-03-29 15:51:15 +00:00
committed by Rasmus Munk Larsen
parent 77833f9320
commit 13092b5d04
8 changed files with 57 additions and 56 deletions

View File

@@ -898,8 +898,8 @@ struct TensorEvaluator<const TensorConvolutionOp<Indices, InputArgType, KernelAr
// num_blocks.x: " << num_blocks.x << " num_blocks.y: " << num_blocks.y << " maxX: " << maxX << " shared_mem: "
// << shared_mem << " in stream " << m_device.stream() << endl;
const array<Index, 1> indices(m_indices[0]);
const array<Index, 1> kernel_dims(m_kernelImpl.dimensions()[0]);
const array<Index, 1> indices{m_indices[0]};
const array<Index, 1> kernel_dims{m_kernelImpl.dimensions()[0]};
internal::IndexMapper<Index, InputDims, 1, Layout> indexMapper(m_inputImpl.dimensions(), kernel_dims, indices);
switch (kernel_size) {
case 4: {
@@ -965,8 +965,8 @@ struct TensorEvaluator<const TensorConvolutionOp<Indices, InputArgType, KernelAr
// " num_blocks.z: " << num_blocks.z << " maxX: " << maxX << " maxY: " << maxY << " maxP: " << maxP << "
// shared_mem: " << shared_mem << " in stream " << m_device.stream() << endl;
const array<Index, 2> indices(m_indices[idxX], m_indices[idxY]);
const array<Index, 2> kernel_dims(m_kernelImpl.dimensions()[idxX], m_kernelImpl.dimensions()[idxY]);
const array<Index, 2> indices{m_indices[idxX], m_indices[idxY]};
const array<Index, 2> kernel_dims{m_kernelImpl.dimensions()[idxX], m_kernelImpl.dimensions()[idxY]};
internal::IndexMapper<Index, InputDims, 2, Layout> indexMapper(m_inputImpl.dimensions(), kernel_dims, indices);
switch (kernel_size_x) {
case 4: {
@@ -1059,9 +1059,9 @@ struct TensorEvaluator<const TensorConvolutionOp<Indices, InputArgType, KernelAr
// block_size.z: " << block_size.z << " num_blocks.x: " << num_blocks.x << " num_blocks.y: " << num_blocks.y <<
// " num_blocks.z: " << num_blocks.z << " shared_mem: " << shared_mem << " in stream " << m_device.stream() <<
// endl;
const array<Index, 3> indices(m_indices[idxX], m_indices[idxY], m_indices[idxZ]);
const array<Index, 3> kernel_dims(m_kernelImpl.dimensions()[idxX], m_kernelImpl.dimensions()[idxY],
m_kernelImpl.dimensions()[idxZ]);
const array<Index, 3> indices{m_indices[idxX], m_indices[idxY], m_indices[idxZ]};
const array<Index, 3> kernel_dims{m_kernelImpl.dimensions()[idxX], m_kernelImpl.dimensions()[idxY],
m_kernelImpl.dimensions()[idxZ]};
internal::IndexMapper<Index, InputDims, 3, Layout> indexMapper(m_inputImpl.dimensions(), kernel_dims, indices);
LAUNCH_GPU_KERNEL((EigenConvolutionKernel3D<TensorEvaluator<InputArgType, GpuDevice>, Index, InputDims>),

View File

@@ -977,11 +977,12 @@ struct TensorReductionEvaluatorBase<const TensorReductionOp<Op, Dims, ArgType, M
// Dimensions of the output of the operation.
Dimensions m_dimensions;
// Precomputed strides for the output tensor.
array<Index, NumOutputDims> m_outputStrides;
array<internal::TensorIntDivisor<Index>, NumOutputDims> m_fastOutputStrides;
array<Index, NumPreservedStrides> m_preservedStrides;
// Avoid zero-sized arrays, since element access fails to compile on GPU.
array<Index, (std::max)(NumOutputDims, 1)> m_outputStrides;
array<internal::TensorIntDivisor<Index>, (std::max)(NumOutputDims, 1)> m_fastOutputStrides;
array<Index, (std::max)(NumPreservedStrides, 1)> m_preservedStrides;
// Map from output to input dimension index.
array<Index, NumOutputDims> m_output_to_input_dim_map;
array<Index, (std::max)(NumOutputDims, 1)> m_output_to_input_dim_map;
// How many values go into each reduction
Index m_numValuesToReduce;