rondogency commented on a change in pull request #17270: [WIP] Dynamic custom
operator GPU support
URL: https://github.com/apache/incubator-mxnet/pull/17270#discussion_r369335343
##########
File path: src/c_api/c_api.cc
##########
@@ -563,11 +587,21 @@ int MXLoadLib(const char *path) {
}
// create a pointer to hold custom op state object
+ // only create one stateful op depending on passing context
+ // user can add new supported context and call to custom library
void* state_op_inst = nullptr;
- CHECK(callCreateOpState(create_opstate_fp, attr_keys.data(),
attr_vals.data(),
- attr_keys.size(), &state_op_inst))
- << "Error calling CreateOpState for custom operator '" << name_str <<
"'";
-
+ if (ctx.dev_mask() == Context::kCPU) {
+ CHECK(createop_map.count("cpu") > 0) << "CPU CreateOpState not
implemented";
Review comment:
agree
----------------------------------------------------------------
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