Browse Source

Merge fbfa1190e1 into e207b3bd13

pull/5471/merge
Jeff Zhou GitHub 9 months ago
parent
commit
41a9df5cd2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
4 changed files with 39 additions and 0 deletions
  1. +20
    -0
      src/gpu.cpp
  2. +10
    -0
      src/gpu.h
  3. +7
    -0
      src/net.cpp
  4. +2
    -0
      src/net.h

+ 20
- 0
src/gpu.cpp View File

@@ -5762,4 +5762,24 @@ int resolve_shader_info(const uint32_t* spv_data, size_t spv_data_size, ShaderIn

} // namespace ncnn

#else

namespace ncnn {

int create_gpu_instance(const char* driver_path)
{
return 0;
}

void destroy_gpu_instance()
{
}

int get_gpu_count()
{
return 0;
}

} // namespace ncnn

#endif // NCNN_VULKAN

+ 10
- 0
src/gpu.h View File

@@ -551,6 +551,16 @@ public:

NCNN_EXPORT int resolve_shader_info(const uint32_t* spv_data, size_t spv_data_size, ShaderInfo& shader_info);

} // namespace ncnn
#else
namespace ncnn {

NCNN_EXPORT int create_gpu_instance(const char* driver_path = 0);

NCNN_EXPORT void destroy_gpu_instance(void);

NCNN_EXPORT int get_gpu_count(void);

} // namespace ncnn

#endif // NCNN_VULKAN


+ 7
- 0
src/net.cpp View File

@@ -2173,6 +2173,13 @@ void Extractor::set_staging_vkallocator(VkAllocator* allocator)
{
d->opt.staging_vkallocator = allocator;
}

#else

void Extractor::set_vulkan_compute(bool enable)
{
}

#endif // NCNN_VULKAN

#if NCNN_STRING


+ 2
- 0
src/net.h View File

@@ -191,6 +191,8 @@ public:
void set_workspace_vkallocator(VkAllocator* allocator);

void set_staging_vkallocator(VkAllocator* allocator);
#else
void set_vulkan_compute(bool enable);
#endif // NCNN_VULKAN

#if NCNN_STRING


Loading…
Cancel
Save