vulkan: add null checks in ggml_vk_queue_command_pools_cleanup (#27353)
* Guard against null queue pointers.
This commit is contained in:
@@ -3384,10 +3384,10 @@ static void ggml_vk_queue_command_pools_cleanup(vk_device& device) {
|
|||||||
// Arbitrary frequency to cleanup/reuse command buffers
|
// Arbitrary frequency to cleanup/reuse command buffers
|
||||||
static constexpr uint32_t cleanup_frequency = 10;
|
static constexpr uint32_t cleanup_frequency = 10;
|
||||||
|
|
||||||
if (device->compute_queue->cmd_pool.buffers_in_use() >= cleanup_frequency) {
|
if (device->compute_queue && device->compute_queue->cmd_pool.buffers_in_use() >= cleanup_frequency) {
|
||||||
ggml_vk_command_pool_cleanup(device, device->compute_queue->cmd_pool);
|
ggml_vk_command_pool_cleanup(device, device->compute_queue->cmd_pool);
|
||||||
}
|
}
|
||||||
if (device->transfer_queue->cmd_pool.buffers_in_use() >= cleanup_frequency) {
|
if (device->transfer_queue && device->transfer_queue->cmd_pool.buffers_in_use() >= cleanup_frequency) {
|
||||||
ggml_vk_command_pool_cleanup(device, device->transfer_queue->cmd_pool);
|
ggml_vk_command_pool_cleanup(device, device->transfer_queue->cmd_pool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user