aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported
diff options
context:
space:
mode:
authorGravatar Eugene Zhulenev <ezhulenev@google.com>2020-01-13 11:43:24 -0800
committerGravatar Eugene Zhulenev <ezhulenev@google.com>2020-01-13 11:43:24 -0800
commitb9362fb8f76fbba805b56afbc0f5de0a279631b5 (patch)
tree65af3f09893a5d88067b071b0d8066f0785895f5 /unsupported
parent5a8b97b401e8283637e12a8ad9260f37c3271a16 (diff)
Convert StridedLinearBufferCopy::Kind to enum class
Diffstat (limited to 'unsupported')
-rw-r--r--unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h
index ba395f06d..af30ea3d3 100644
--- a/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h
+++ b/unsupported/Eigen/CXX11/src/Tensor/TensorBlock.h
@@ -999,7 +999,7 @@ class StridedLinearBufferCopy {
public:
// Specifying linear copy kind statically gives ~30% speedup for small sizes.
- enum Kind {
+ enum class Kind {
Linear = 0, // src_stride == 1 && dst_stride == 1
Scatter = 1, // src_stride == 1 && dst_stride != 1
FillLinear = 2, // src_stride == 0 && dst_stride == 1
@@ -1053,7 +1053,7 @@ class StridedLinearBufferCopy {
const IndexType vectorized_size = count - PacketSize;
IndexType i = 0;
- if (kind == Linear) {
+ if (kind == StridedLinearBufferCopy::Kind::Linear) {
// ******************************************************************** //
// Linear copy from `src` to `dst`.
const IndexType unrolled_size = count - 4 * PacketSize;
@@ -1072,7 +1072,7 @@ class StridedLinearBufferCopy {
dst[i] = src[i];
}
// ******************************************************************** //
- } else if (kind == Scatter) {
+ } else if (kind == StridedLinearBufferCopy::Kind::Scatter) {
// Scatter from `src` to `dst`.
eigen_assert(src_stride == 1 && dst_stride != 1);
for (; i <= vectorized_size; i += PacketSize) {
@@ -1083,7 +1083,7 @@ class StridedLinearBufferCopy {
dst[i * dst_stride] = src[i];
}
// ******************************************************************** //
- } else if (kind == FillLinear) {
+ } else if (kind == StridedLinearBufferCopy::Kind::FillLinear) {
// Fill `dst` with value at `*src`.
eigen_assert(src_stride == 0 && dst_stride == 1);
const IndexType unrolled_size = count - 4 * PacketSize;
@@ -1100,7 +1100,7 @@ class StridedLinearBufferCopy {
dst[i] = *src;
}
// ******************************************************************** //
- } else if (kind == FillScatter) {
+ } else if (kind == StridedLinearBufferCopy::Kind::FillScatter) {
// Scatter `*src` into `dst`.
eigen_assert(src_stride == 0 && dst_stride != 1);
Packet p = pload1<Packet>(src);
@@ -1111,7 +1111,7 @@ class StridedLinearBufferCopy {
dst[i * dst_stride] = *src;
}
// ******************************************************************** //
- } else if (kind == Gather) {
+ } else if (kind == StridedLinearBufferCopy::Kind::Gather) {
// Gather from `src` into `dst`.
eigen_assert(dst_stride == 1);
for (; i <= vectorized_size; i += PacketSize) {
@@ -1122,7 +1122,7 @@ class StridedLinearBufferCopy {
dst[i] = src[i * src_stride];
}
// ******************************************************************** //
- } else if (kind == Random) {
+ } else if (kind == StridedLinearBufferCopy::Kind::Random) {
// Random.
for (; i < count; ++i) {
dst[i * dst_stride] = src[i * src_stride];
@@ -1300,17 +1300,17 @@ class TensorBlockIO {
return num_copied;
if (input_stride == 1 && output_stride == 1) {
- COPY_INNER_DIM(LinCopy::Linear);
+ COPY_INNER_DIM(LinCopy::Kind::Linear);
} else if (input_stride == 1 && output_stride != 1) {
- COPY_INNER_DIM(LinCopy::Scatter);
+ COPY_INNER_DIM(LinCopy::Kind::Scatter);
} else if (input_stride == 0 && output_stride == 1) {
- COPY_INNER_DIM(LinCopy::FillLinear);
+ COPY_INNER_DIM(LinCopy::Kind::FillLinear);
} else if (input_stride == 0 && output_stride != 1) {
- COPY_INNER_DIM(LinCopy::FillScatter);
+ COPY_INNER_DIM(LinCopy::Kind::FillScatter);
} else if (output_stride == 1) {
- COPY_INNER_DIM(LinCopy::Gather);
+ COPY_INNER_DIM(LinCopy::Kind::Gather);
} else {
- COPY_INNER_DIM(LinCopy::Random);
+ COPY_INNER_DIM(LinCopy::Kind::Random);
}
#undef COPY_INNER_DIM