rondogency commented on a change in pull request #17762: Custom Operator Random
Number Generator Support
URL: https://github.com/apache/incubator-mxnet/pull/17762#discussion_r388083204
##########
File path: src/c_api/c_api.cc
##########
@@ -177,10 +177,39 @@ void CustomFComputeDispatcher(const std::string op_name,
return static_cast<void*>((*gpualloc)(size));
};
+ // MXNet random number generator lambda to be invoked by custom library
+ // custom library will use gpu rng whenever possible
+ auto rng_caller = [&](RandGenType rand_type, int seed) {
+#if MXNET_USE_CUDA
Review comment:
thanks for the timely review. we can let user pass in a "cpu" or "gpu"
string to decide it, just like the forward/backward function
Also I am just wondering if we should make a default choice of device?
----------------------------------------------------------------
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