Changesets · Branches · Tags · Compare
| Changeset | a509dc3392152abfb7ecfba71aa2fd28f3a44d9e754c758fa17c5c73466d1f38 |
|---|---|
| Author | 佰阅 <43716063+Baiyuetribe@users.noreply.github.com> · 2024-08-01 21:06 +08:00 |
| Committer | GitHub <noreply@github.com> · 2024-08-01 21:06 +08:00 |
| Parents | e91df65e9177 |
2 files changed
modified src/c_api.cpp +7 −0
| @@ -1240,6 +1240,13 @@ | ||
| 1240 | 1240 | ((Net*)net->pthis)->opt = *((Option*)opt); |
| 1241 | 1241 | } |
| 1242 | 1242 | |
| 1243 | +#if NCNN_VULKAN | |
| 1244 | +void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index) | |
| 1245 | +{ | |
| 1246 | + ((Net*)net->pthis)->set_vulkan_device(device_index); | |
| 1247 | +} | |
| 1248 | +#endif | |
| 1249 | + | |
| 1243 | 1250 | static ::ncnn::Layer* __Layer_c_api_layer_creator(void* userdata) |
| 1244 | 1251 | { |
| 1245 | 1252 | ncnn_net_custom_layer_factory_t ud = (ncnn_net_custom_layer_factory_t)userdata; |
modified src/c_api.h +4 −0
| @@ -275,6 +275,10 @@ | ||
| 275 | 275 | NCNN_EXPORT ncnn_option_t ncnn_net_get_option(ncnn_net_t net); |
| 276 | 276 | NCNN_EXPORT void ncnn_net_set_option(ncnn_net_t net, ncnn_option_t opt); |
| 277 | 277 | |
| 278 | +#if NCNN_VULKAN | |
| 279 | +NCNN_EXPORT void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index); | |
| 280 | +#endif | |
| 281 | + | |
| 278 | 282 | #if NCNN_STRING |
| 279 | 283 | 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); |
| 280 | 284 | #endif /* NCNN_STRING */ |