Skip to content

Commit

Permalink
add NCNN_VULKAN option
Browse files Browse the repository at this point in the history
  • Loading branch information
Baiyuetribe committed Aug 1, 2024
1 parent 0278590 commit fea7343
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/c_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,14 +1239,14 @@ void ncnn_net_set_option(ncnn_net_t net, ncnn_option_t opt)
{
((Net*)net->pthis)->opt = *((Option*)opt);
}

#if NCNN_VULKAN
void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index)
{
#if NCNN_VULKAN
((Net*)net->pthis)->set_vulkan_device(device_index);
#else
(void)device_index;
#endif
}
#endif

static ::ncnn::Layer* __Layer_c_api_layer_creator(void* userdata)
{
ncnn_net_custom_layer_factory_t ud = (ncnn_net_custom_layer_factory_t)userdata;
Expand Down
3 changes: 3 additions & 0 deletions src/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,10 @@ NCNN_EXPORT void ncnn_net_destroy(ncnn_net_t net);

NCNN_EXPORT ncnn_option_t ncnn_net_get_option(ncnn_net_t net);
NCNN_EXPORT void ncnn_net_set_option(ncnn_net_t net, ncnn_option_t opt);

#if NCNN_VULKAN
NCNN_EXPORT void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index);
#endif

#if NCNN_STRING
NCNN_EXPORT void ncnn_net_register_custom_layer_by_type(ncnn_net_t net, const char* type, ncnn_layer_creator_t creator, ncnn_layer_destroyer_t destroyer, void* userdata);
Expand Down

0 comments on commit fea7343

Please sign in to comment.