samskalicky commented on a change in pull request #15489: [WIP] Dynamic Library 
Loading Support
URL: https://github.com/apache/incubator-mxnet/pull/15489#discussion_r306125014
 
 

 ##########
 File path: src/c_api/c_api.cc
 ##########
 @@ -90,6 +92,20 @@ inline int MXAPIGetFunctionRegInfo(const FunRegType *e,
 
 // NOTE: return value is added in API_END
 
+int MXLoadLib(const char *path) {
+  API_BEGIN();
+  void *lib = load_lib(path);
+  if(!lib)
+    LOG(FATAL) << "Unable to load library";
+
+  initialize_t initialize = get_func<initialize_t>(lib, 
const_cast<char*>(INITIALIZE_STR));
+  int version = MXNET_VERSION;
+  int flag = initialize(version);
 
 Review comment:
   Can we just inline some of this code?
   
   if(initialize((int)MXNET_VERSION))
      LOG(FATAL)...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to