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

Method createTimestampQueryPool

src/Sequence.cpp:341–367  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

339}
340
341void
342Sequence::createTimestampQueryPool(uint32_t totalTimestamps)
343{
344 KP_LOG_DEBUG("Kompute Sequence creating query pool");
345 if (!this->isInit()) {
346 throw std::runtime_error(
347 "createTimestampQueryPool() called on uninitialized Sequence");
348 }
349 if (!this->mPhysicalDevice) {
350 throw std::runtime_error("Kompute Sequence physical device is null");
351 }
352
353 vk::PhysicalDeviceProperties physicalDeviceProperties =
354 this->mPhysicalDevice->getProperties();
355
356 if (physicalDeviceProperties.limits.timestampComputeAndGraphics) {
357 vk::QueryPoolCreateInfo queryPoolInfo;
358 queryPoolInfo.setQueryCount(totalTimestamps);
359 queryPoolInfo.setQueryType(vk::QueryType::eTimestamp);
360 this->timestampQueryPool = std::make_shared<vk::QueryPool>(
361 this->mDevice->createQueryPool(queryPoolInfo));
362
363 KP_LOG_DEBUG("Query pool for timestamps created");
364 } else {
365 throw std::runtime_error("Device does not support timestamps");
366 }
367}
368
369std::vector<std::uint64_t>
370Sequence::getTimestamps()

Callers 1

SequenceMethod · 0.95

Calls 1

isInitMethod · 0.95

Tested by

no test coverage detected