MCPcopy Create free account
hub / github.com/KomputeProject/kompute / postEval

Method postEval

src/OpTensorCopy.cpp:59–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57}
58
59void
60OpTensorCopy::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}

Callers 1

evalAwaitMethod · 0.45

Calls 4

tensorTypeMethod · 0.80
rawDataMethod · 0.80
sizeMethod · 0.80
setRawDataMethod · 0.80

Tested by

no test coverage detected