| 57 | } |
| 58 | |
| 59 | void |
| 60 | OpTensorCopy::postEval(const vk::CommandBuffer& /*commandBuffer*/) |
| 61 | { |
| 62 | KP_LOG_DEBUG("Kompute OpTensorCopy postEval called"); |
| 63 | |
| 64 | // Do not copy on CPU side if source is storage tensor |
| 65 | if (this->mTensors[0]->tensorType() == kp::Tensor::TensorTypes::eStorage) |
| 66 | { |
| 67 | KP_LOG_DEBUG("Kompute OpTensorCopy not copying tensor source given it's of eStorage type"); |
| 68 | return; |
| 69 | } |
| 70 | void* data = this->mTensors[0]->rawData(); |
| 71 | |
| 72 | // Copy the data from the first tensor into all the tensors |
| 73 | for (size_t i = 1; i < this->mTensors.size(); i++) { |
| 74 | if (this->mTensors[i]->tensorType() == kp::Tensor::TensorTypes::eStorage) { |
| 75 | KP_LOG_DEBUG("Kompute OpTensorCopy not copying to tensor dest given it's of eStorage type"); |
| 76 | continue; |
| 77 | } |
| 78 | this->mTensors[i]->setRawData(data); |
| 79 | } |
| 80 | } |
| 81 | |
| 82 | } |
no test coverage detected