apeforest commented on a change in pull request #12374: Fix/public internal
header
URL: https://github.com/apache/incubator-mxnet/pull/12374#discussion_r214101664
##########
File path: include/mxnet/random_generator.h
##########
@@ -150,14 +149,9 @@ class RandGenerator<gpu, DType> {
curandStatePhilox4_32_10_t state_;
}; // class RandGenerator<gpu, DType>::Impl
- static void AllocState(RandGenerator<gpu, DType> *inst) {
- CUDA_CALL(cudaMalloc(&inst->states_,
- kNumRandomStates *
sizeof(curandStatePhilox4_32_10_t)));
- }
+ static void AllocState(RandGenerator<gpu, DType> *inst);
Review comment:
I guess my question is not well phrased. What I meant is why move out from
header file while leaving the same function for CPU in the header
See line:
https://github.com/apache/incubator-mxnet/pull/12374/files#diff-ba5bcd7d0b76b85a2df1f793dc4d3302R82
Aside from that, I think these functions are inside the inner class Impl
which is supposed to handle all the implementation. Therefore I think it is
very logical to leave them here in the header file. Not to mention the
performance advantage of calling inline function.
----------------------------------------------------------------
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