Skip to content

Commit

Permalink
fix create_pipeline crash in vulkan-enabled layer without calling loa…
Browse files Browse the repository at this point in the history
…d_param/load_model first (Tencent#5410)
  • Loading branch information
nihui authored and sen.li committed May 7, 2024
1 parent 97a5cc7 commit c5534ff
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,16 @@ class Layer_final : public Layer
#if NCNN_VULKAN
if (layer_vulkan)
{
int ret = layer_vulkan->create_pipeline(opt);
get_layer_properties();
return ret;
if (vkdev)
{
int ret = layer_vulkan->create_pipeline(opt);
get_layer_properties();
return ret;
}

// fallback to cpu layer
delete layer_vulkan;
layer_vulkan = 0;
}
#endif // NCNN_VULKAN

Expand Down

0 comments on commit c5534ff

Please sign in to comment.