larroy commented on a change in pull request #13964: Addresses comments in 
runtime feature discovery
URL: https://github.com/apache/incubator-mxnet/pull/13964#discussion_r250146123
 
 

 ##########
 File path: include/mxnet/c_api.h
 ##########
 @@ -208,6 +208,24 @@ MXNET_DLL const char *MXGetLastError();
 //-------------------------------------
 // Part 0: Global State setups
 //-------------------------------------
+
+/*!
+ * \brief Check if a feature is enabled in the runtime
+ * \param feature to check mxruntime.h
+ * \param out set to true if the feature is enabled, false otherwise
+ * \return 0 when success, -1 when failure happens.
+ */
+MXNET_DLL int MXRuntimeHasFeature(const mx_uint feature, bool *out);
 
 Review comment:
   Agree, I can return the enum values, but they are also implicit on the index 
of the strings. One of the reasons why I like having a function to test if the 
feature is present is that is much simpler and faster than fiddling with 
strings and it doesn't allocate any memory. If we remove this function then we 
should have two functions, features available and features enabled. I think 
they are functionally equivalent, there has to be some part of the code that 
test the feature flags anyway, exposed or not.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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