Skip to content

Commit

Permalink
fix int8
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Jan 4, 2024
1 parent 69be7f0 commit 35e1178
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1504,6 +1504,13 @@ int Net::load_param(const DataReader& dr)
// pull out layer specific feature disabled set
layer->featmask = pd.get(31, 0);

int lr = layer->load_param(pd);
if (lr != 0)
{
NCNN_LOGE("layer load_param %d %s failed", i, layer_name);
continue;
}

if (layer->support_int8_storage)
{
// no int8 gpu support yet
Expand All @@ -1516,20 +1523,8 @@ int Net::load_param(const DataReader& dr)
{
if (!layer->support_image_storage) opt1.use_image_storage = false;
}
else
{
layer->vkdev = 0;
layer->support_vulkan = false;
}
#endif // NCNN_VULKAN

int lr = layer->load_param(pd);
if (lr != 0)
{
NCNN_LOGE("layer load_param %d %s failed", i, layer_name);
continue;
}

if (layer_support_vulkan && (!layer->support_vulkan || !opt1.use_vulkan_compute))
{
// vulkan layer cannot handle these param, recreate cpu layer
Expand Down Expand Up @@ -1801,11 +1796,6 @@ int Net::load_param_bin(const DataReader& dr)
{
if (!layer->support_image_storage) opt1.use_image_storage = false;
}
else
{
layer->vkdev = 0;
layer->support_vulkan = false;
}
#endif // NCNN_VULKAN

if (layer_support_vulkan && (!layer->support_vulkan || !opt1.use_vulkan_compute))
Expand Down

0 comments on commit 35e1178

Please sign in to comment.