Browse Source

fix build with NCNN_STRING off and NCNN_VULKAN on

tags/20210507
nihuini 5 years ago
parent
commit
72ef77a469
2 changed files with 17 additions and 1 deletions
  1. +16
    -0
      src/net.cpp
  2. +1
    -1
      tools/modelwriter.h

+ 16
- 0
src/net.cpp View File

@@ -391,7 +391,11 @@ IMAGE_ALLOCATION_FAILED:

if (image_allocation_failed)
{
#if NCNN_STRING
NCNN_LOGE("forward_layer %d %s image allocation failed, fallback to cpu", layer_index, layer->name.c_str());
#else
NCNN_LOGE("forward_layer %d image allocation failed, fallback to cpu", layer_index);
#endif
}

if (layer->one_blob_only)
@@ -1607,6 +1611,8 @@ int Net::load_param_bin(const DataReader& dr)
{
#if NCNN_STRING
NCNN_LOGE("ParamDict load_param %d %s failed", i, layer->name.c_str());
#else
NCNN_LOGE("ParamDict load_param %d failed", i);
#endif
continue;
}
@@ -1662,6 +1668,8 @@ int Net::load_param_bin(const DataReader& dr)
{
#if NCNN_STRING
NCNN_LOGE("layer load_param %d %s failed", i, layer->name.c_str());
#else
NCNN_LOGE("layer load_param %d failed", i);
#endif
continue;
}
@@ -1696,6 +1704,8 @@ int Net::load_model(const DataReader& dr)
{
#if NCNN_STRING
NCNN_LOGE("load_model error at layer %d %s, parameter file has inconsistent content.", i, layer->name.c_str());
#else
NCNN_LOGE("load_model error at layer %d, parameter file has inconsistent content.", i);
#endif
ret = -1;
break;
@@ -1706,6 +1716,8 @@ int Net::load_model(const DataReader& dr)
{
#if NCNN_STRING
NCNN_LOGE("layer load_model %d %s failed", i, layer->name.c_str());
#else
NCNN_LOGE("layer load_model %d failed", i);
#endif
ret = -1;
break;
@@ -1739,6 +1751,8 @@ int Net::load_model(const DataReader& dr)
{
#if NCNN_STRING
NCNN_LOGE("load_model error at layer %d %s, parameter file has inconsistent content.", i, layer->name.c_str());
#else
NCNN_LOGE("load_model error at layer %d, parameter file has inconsistent content.", i);
#endif
ret = -1;
break;
@@ -1757,6 +1771,8 @@ int Net::load_model(const DataReader& dr)
{
#if NCNN_STRING
NCNN_LOGE("layer create_pipeline %d %s failed", i, layer->name.c_str());
#else
NCNN_LOGE("layer create_pipeline %d failed", i);
#endif
ret = -1;
break;


+ 1
- 1
tools/modelwriter.h View File

@@ -1592,7 +1592,7 @@ int ModelWriter::save(const char* parampath, const char* binpath)

if (mac)
{
fprintf(stderr, "mac = %lld = %.2f M\n", mac, mac / 1000000.0);
fprintf(stderr, "mac = %llu = %.2f M\n", mac, mac / 1000000.0);
}

return 0;


Loading…
Cancel
Save