Skip to content

Commit

Permalink
Address CR comment for 7c553a9
Browse files Browse the repository at this point in the history
  • Loading branch information
mahilleb-msft committed Dec 8, 2015
1 parent 438f72d commit b2d1405
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Math/Math/GPUMatrix.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
void GPUMatrix<ElemType>::SetUniformRandomValue(const ElemType low, const ElemType high, unsigned long seed)
{
PrepareDevice();
CreateCurandObject(seed, __FUNCTION__);
CreateCurandObject(seed, __FUNCTION__); // TODO call ResetCurandObject() instead?

cudaEvent_t done = nullptr;
CUDA_CALL(cudaEventCreate(&done));
Expand Down Expand Up @@ -1245,7 +1245,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
void GPUMatrix<ElemType>::SetGaussianRandomValue(const ElemType mean, const ElemType sigma, unsigned long seed)
{
PrepareDevice();
CreateCurandObject(seed, __FUNCTION__);
CreateCurandObject(seed, __FUNCTION__); // TODO call ResetCurandObject() instead?

if (sizeof(ElemType)==sizeof(float))
{
Expand All @@ -1264,7 +1264,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {
void GPUMatrix<ElemType>::SetUniformRandomMask(const ElemType maskRate, const ElemType scaleValue, unsigned long seed)
{
PrepareDevice();
CreateCurandObject(seed, __FUNCTION__);
CreateCurandObject(seed, __FUNCTION__); // TODO call ResetCurandObject() instead?

cudaEvent_t done = nullptr;
CUDA_CALL(cudaEventCreate(&done));
Expand Down Expand Up @@ -4071,6 +4071,7 @@ namespace Microsoft { namespace MSR { namespace CNTK {

if (s_curandGenerator && (seed != USE_TIME_BASED_SEED))
{
// Note: this might be slow.
CURAND_CALL(curandSetPseudoRandomGeneratorSeed(((curandGenerator_t*)s_curandGenerator)[0], seed));
CURAND_CALL(curandSetGeneratorOffset(((curandGenerator_t*)s_curandGenerator)[0], 0));
}
Expand Down

0 comments on commit b2d1405

Please sign in to comment.