@@ -444,7 +444,7 @@ struct vk_device_struct {
444444 // for GGML_VK_PERF_LOGGER
445445 std::unique_ptr<vk_perf_logger> perf_logger;
446446 vk::QueryPool query_pool;
447- uint32_t num_queries;
447+ int32_t num_queries;
448448
449449 ~vk_device_struct() {
450450 VK_LOG_DEBUG("destroy device " << name);
@@ -9513,8 +9513,8 @@ static ggml_status ggml_backend_vk_graph_compute(ggml_backend_t backend, ggml_cg
95139513 if (ctx->device->query_pool) {
95149514 ctx->device->device.destroyQueryPool(ctx->device->query_pool);
95159515 }
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 ;
95189518 query_create_info.queryCount = cgraph->n_nodes + 100;
95199519 ctx->device->query_pool = ctx->device->device.createQueryPool(query_create_info);
95209520 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
96009600
96019601 // Get the results and pass them to the logger
96029602 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" );
96049604 for (int i = 0; i < cgraph->n_nodes; i++) {
96059605 if (!ggml_vk_is_empty(cgraph->nodes[i])) {
96069606 ctx->device->perf_logger->log_timing(cgraph->nodes[i], uint64_t((timestamps[i+1] - timestamps[i]) * ctx->device->properties.limits.timestampPeriod));
0 commit comments