| 1250 | } |
| 1251 | |
| 1252 | void Tensor::BindToMem(VkFlags required_flags, VkFlags forbidden_flags) { |
| 1253 | VkMemoryRequirements2 mem_reqs = this->GetMemoryReqs(); |
| 1254 | |
| 1255 | VkMemoryAllocateInfo tensor_alloc_info = vku::InitStructHelper(); |
| 1256 | tensor_alloc_info.allocationSize = mem_reqs.memoryRequirements.size; |
| 1257 | device_->Physical().SetMemoryType(mem_reqs.memoryRequirements.memoryTypeBits, &tensor_alloc_info, required_flags, |
| 1258 | forbidden_flags); |
| 1259 | memory_ = vkt::DeviceMemory(*device_, tensor_alloc_info); |
| 1260 | VkBindTensorMemoryInfoARM bind_info = vku::InitStructHelper(); |
| 1261 | bind_info.tensor = *this; |
| 1262 | bind_info.memory = memory_; |
| 1263 | vk::BindTensorMemoryARM(*device_, 1, &bind_info); |
| 1264 | } |
| 1265 | |
| 1266 | void Tensor::InitNoMem(const Device& dev, const VkTensorCreateInfoARM& info) { |
| 1267 | device_ = &dev; |
no test coverage detected