@@ -444,7 +444,7 @@ struct vk_device_struct {
444
444
// for GGML_VK_PERF_LOGGER
445
445
std::unique_ptr<vk_perf_logger> perf_logger;
446
446
vk::QueryPool query_pool;
447
- uint32_t num_queries;
447
+ int32_t num_queries;
448
448
449
449
~vk_device_struct() {
450
450
VK_LOG_DEBUG("destroy device " << name);
@@ -9513,8 +9513,8 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg
9513
9513
if (ctx->device->query_pool) {
9514
9514
ctx->device->device.destroyQueryPool(ctx->device->query_pool);
9515
9515
}
9516
- VkQueryPoolCreateInfo query_create_info = { VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO } ;
9517
- query_create_info.queryType = VK_QUERY_TYPE_TIMESTAMP ;
9516
+ vk::QueryPoolCreateInfo query_create_info;
9517
+ query_create_info.queryType = vk::QueryType::eTimestamp ;
9518
9518
query_create_info.queryCount = cgraph->n_nodes + 100;
9519
9519
ctx->device->query_pool = ctx->device->device.createQueryPool(query_create_info);
9520
9520
ctx->device->num_queries = query_create_info.queryCount;
@@ -9600,7 +9600,7 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg
9600
9600
9601
9601
// Get the results and pass them to the logger
9602
9602
std::vector<uint64_t> timestamps(cgraph->n_nodes + 1);
9603
- ctx->device->device.getQueryPoolResults(ctx->device->query_pool, 0, cgraph->n_nodes + 1, (cgraph->n_nodes + 1)*sizeof(uint64_t), timestamps.data(), sizeof(uint64_t), vk::QueryResultFlagBits::e64 | vk::QueryResultFlagBits::eWait);
9603
+ VK_CHECK( ctx->device->device.getQueryPoolResults(ctx->device->query_pool, 0, cgraph->n_nodes + 1, (cgraph->n_nodes + 1)*sizeof(uint64_t), timestamps.data(), sizeof(uint64_t), vk::QueryResultFlagBits::e64 | vk::QueryResultFlagBits::eWait), "get timestamp results" );
9604
9604
for (int i = 0; i < cgraph->n_nodes; i++) {
9605
9605
if (!ggml_vk_is_empty(cgraph->nodes[i])) {
9606
9606
ctx->device->perf_logger->log_timing(cgraph->nodes[i], uint64_t((timestamps[i+1] - timestamps[i]) * ctx->device->properties.limits.timestampPeriod));
0 commit comments