MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / BindToMem

Method BindToMem

tests/framework/binding.cpp:1252–1264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1250}
1251
1252void 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
1266void Tensor::InitNoMem(const Device& dev, const VkTensorCreateInfoARM& info) {
1267 device_ = &dev;

Callers 5

InitTensorMethod · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80
TEST_FFunction · 0.80

Calls 4

BindTensorMemoryARMFunction · 0.85
GetMemoryReqsMethod · 0.80
SetMemoryTypeMethod · 0.80
DeviceMemoryClass · 0.70

Tested by

no test coverage detected