Elffuss BraidHub

kikocis/ncnn public

c_api surpport set_vulkan_device (#5610)

Changeseta509dc3392152abfb7ecfba71aa2fd28f3a44d9e754c758fa17c5c73466d1f38
Author佰阅 <43716063+Baiyuetribe@users.noreply.github.com> · 2024-08-01 21:06 +08:00
CommitterGitHub <noreply@github.com> · 2024-08-01 21:06 +08:00
Parentse91df65e9177

Browse the files at this changeset

2 files changed

modified src/c_api.cpp +7 −0
@@ -1240,6 +1240,13 @@
12401240 ((Net*)net->pthis)->opt = *((Option*)opt);
12411241 }
12421242
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+
12431250 static ::ncnn::Layer* __Layer_c_api_layer_creator(void* userdata)
12441251 {
12451252 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 @@
275275 NCNN_EXPORT ncnn_option_t ncnn_net_get_option(ncnn_net_t net);
276276 NCNN_EXPORT void ncnn_net_set_option(ncnn_net_t net, ncnn_option_t opt);
277277
278+#if NCNN_VULKAN
279+NCNN_EXPORT void ncnn_net_set_vulkan_device(ncnn_net_t net, int device_index);
280+#endif
281+
278282 #if NCNN_STRING
279283 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);
280284 #endif /* NCNN_STRING */