未验证 提交 d38871bb 编写于 作者: D daquexian 提交者: GitHub

load bin in a single pass (#4966)

Signed-off-by: Ndaquexian <daquexian566@gmail.com>
上级 cb674ac5
......@@ -1735,6 +1735,18 @@ int Net::load_model(const DataReader& dr)
// load file
int ret = 0;
#if NCNN_VULKAN
if (opt.use_vulkan_compute)
{
if (!opt.pipeline_cache)
{
if (!d->pipeline_cache)
d->pipeline_cache = new PipelineCache(d->vkdev);
opt.pipeline_cache = d->pipeline_cache;
}
}
#endif // NCNN_VULKAN
ModelBinFromDataReader mb(dr);
for (int i = 0; i < layer_count; i++)
{
......@@ -1765,23 +1777,6 @@ int Net::load_model(const DataReader& dr)
// no int8 gpu support yet
opt.use_vulkan_compute = false;
}
}
#if NCNN_VULKAN
if (opt.use_vulkan_compute)
{
if (!opt.pipeline_cache)
{
if (!d->pipeline_cache)
d->pipeline_cache = new PipelineCache(d->vkdev);
opt.pipeline_cache = d->pipeline_cache;
}
}
#endif // NCNN_VULKAN
for (int i = 0; i < layer_count; i++)
{
Layer* layer = d->layers[i];
Option opt1 = get_masked_option(opt, layer->featmask);
#if NCNN_VULKAN
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册