Commit b80b34f5 authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Remove redundant parameter in helper lambda function

parent 87d41af6
...@@ -232,15 +232,13 @@ struct DevicePermute ...@@ -232,15 +232,13 @@ struct DevicePermute
static bool IsSupportedArgument(const Argument& arg) static bool IsSupportedArgument(const Argument& arg)
{ {
constexpr auto IsScalarPerVectorValid = [](const std::array<index_t, NumDim>& lengths, constexpr auto IsScalarPerVectorValid =
const std::array<index_t, NumDim>& strides, [](index_t length, index_t stride, index_t scalarPerVector) {
index_t vectorDim, if(stride == 1 && length % scalarPerVector == 0)
index_t scalarPerVector) {
if(strides[vectorDim] == 1 && lengths[vectorDim] % scalarPerVector == 0)
{ {
return true; return true;
} }
else if(strides[vectorDim] != 1 && scalarPerVector == 1) else if(stride != 1 && scalarPerVector == 1)
{ {
return true; return true;
} }
...@@ -248,10 +246,12 @@ struct DevicePermute ...@@ -248,10 +246,12 @@ struct DevicePermute
return false; return false;
}; };
return IsScalarPerVectorValid( return IsScalarPerVectorValid(arg.inLengths_[SrcVectorDim],
arg.inLengths_, arg.inStrides_, SrcVectorDim, SrcScalarPerVector) && arg.inStrides_[SrcVectorDim],
IsScalarPerVectorValid( SrcScalarPerVector) &&
arg.outLengths_, arg.outStrides_, DstVectorDim, DstScalarPerVector) && IsScalarPerVectorValid(arg.outLengths_[DstVectorDim],
arg.outStrides_[DstVectorDim],
DstScalarPerVector) &&
GridwisePermute::CheckValidity(arg.in_grid_desc_, arg.out_grid_desc_); GridwisePermute::CheckValidity(arg.in_grid_desc_, arg.out_grid_desc_);
}; };
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment