MCPcopy Create free account
hub / github.com/ARM-software/armnn / IsSplitterSupported

Method IsSplitterSupported

src/backends/cl/ClLayerSupport.cpp:1517–1548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1515}
1516
1517bool ClLayerSupport::IsSplitterSupported(const TensorInfo& input,
1518 const std::vector<std::reference_wrapper<TensorInfo>>& outputs,
1519 const ViewsDescriptor& descriptor,
1520 Optional<std::string&> reasonIfUnsupported) const
1521{
1522#if defined(ARMCOMPUTECL_ENABLED)
1523 // Split along the last dimension, cannot use sub-tensors
1524 // as width and height of the sub-tensors do not match
1525 // the width and height of the parent tensor
1526 // in case of input with more than 2D.
1527 std::set<unsigned int> splitAxis = ComputeSplitAxis(descriptor, input.GetShape());
1528 if (descriptor.GetNumDimensions() > 2 && splitAxis.size() == 1 &&
1529 *splitAxis.begin() == descriptor.GetNumDimensions() - 1 )
1530 {
1531 FORWARD_WORKLOAD_VALIDATE_FUNC(ClSplitterWorkloadValidate,
1532 reasonIfUnsupported,
1533 input,
1534 outputs,
1535 *splitAxis.begin());
1536 }
1537#endif
1538 IgnoreUnused(descriptor);
1539 for (auto output : outputs)
1540 {
1541 if (!input.IsTypeSpaceMatch(output)) // Cannot use sub-tensors if the types are not same space
1542 {
1543 SetValueChecked(reasonIfUnsupported, "Cl Splitter: Types and quantization parameters must match.");
1544 return false;
1545 }
1546 }
1547 return true;
1548}
1549
1550bool ClLayerSupport::IsStackSupported(const std::vector<const TensorInfo*>& inputs,
1551 const TensorInfo& output,

Callers 1

Calls 8

ComputeSplitAxisFunction · 0.85
SetValueCheckedFunction · 0.85
IsTypeSpaceMatchMethod · 0.80
IgnoreUnusedFunction · 0.50
GetShapeMethod · 0.45
GetNumDimensionsMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected