| 98 | class GeometryTensorArrayRead : public GeometryComputer { |
| 99 | public: |
| 100 | virtual bool onCompute(const Op* op, const std::vector<Tensor*>& inputs, const std::vector<Tensor*>& outputs, |
| 101 | Context& context, CommandBuffer& res) const override { |
| 102 | auto tensorArrayInput = inputs[2]; |
| 103 | if (TensorUtils::getDescribe(tensorArrayInput)->tensorArrayAttr == nullptr) { |
| 104 | MNN_ASSERT(false); |
| 105 | return false; |
| 106 | } |
| 107 | auto output = outputs[0]; |
| 108 | auto outputDes = TensorUtils::getDescribe(output); |
| 109 | outputDes->memoryType = Tensor::InsideDescribe::MEMORY_VIRTUAL; |
| 110 | outputDes->regions.resize(1); |
| 111 | auto& reg = outputDes->regions[0]; |
| 112 | auto index = inputs[1]->host<uint32_t>()[0]; |
| 113 | auto elemSize = getElemSize(tensorArrayInput, index); |
| 114 | reg.origin = tensorArrayInput; |
| 115 | reg.src.offset = elemSize.first; |
| 116 | reg.src.stride[0] = 1; |
| 117 | reg.src.stride[1] = 1; |
| 118 | reg.src.stride[2] = 1; |
| 119 | reg.dst.offset = 0; |
| 120 | reg.dst.stride[0] = 1; |
| 121 | reg.dst.stride[1] = 1; |
| 122 | reg.dst.stride[2] = 1; |
| 123 | reg.size[0] = elemSize.second; |
| 124 | reg.size[1] = 1; |
| 125 | reg.size[2] = 1; |
| 126 | return true; |
| 127 | } |
| 128 | }; |
| 129 | |
| 130 | class GeometryTensorArrayWrite : public GeometryComputer { |
nothing calls this directly
no test coverage detected