Skip to content

Commit

Permalink
Final changes to
Browse files Browse the repository at this point in the history
  • Loading branch information
Amartya Sanyal committed Jun 28, 2017
1 parent ea86390 commit 3dd47e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 71 deletions.
2 changes: 1 addition & 1 deletion lib/THC/THCTensorRandom.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ sampleMultinomialWithoutReplacement(curandStateMtgp32* state,
// The warp determines the distribution
long curDist = curDistBase + threadIdx.y;

// All threads participate in this
// All threads must participate in this
T r = ScalarConvert<float, T>::to(curand_uniform(&state[blockIdx.x]));

if (threadIdx.x == 0 && curDist < distributions) {
Expand Down
24 changes: 12 additions & 12 deletions lib/THC/generic/THCTensorRandom.cu
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ THC_API void THCTensor_(multinomial)(struct THCState *state,
sampleMultinomialWithReplacement
<<<grid, block, 0, THCState_getCurrentStream(state)>>>(
THCTensor_(data)(state, uniform_idx),
n_sample,
THCudaLongTensor_data(state, self),
numDist, numCategories,
THCTensor_(data)(state, prefixSum));
THCTensor_(data)(state, uniform_idx),
n_sample,
THCudaLongTensor_data(state, self),
numDist, numCategories,
THCTensor_(data)(state, prefixSum));
THCTensor_(free)(state, uniform_idx);
} else {
Expand Down Expand Up @@ -245,13 +245,13 @@ THC_API void THCTensor_(multinomial)(struct THCState *state,
// recalculate our distribution
sampleMultinomialWithoutReplacement
<<<grid, block, 0, THCState_getCurrentStream(state)>>>(
gen->gen_states,
n_sample,
sample,
THCudaLongTensor_data(state, self),
numDist, numCategories,
THCTensor_(data)(state, origDist),
THCTensor_(data)(state, prefixSum));
gen->gen_states,
n_sample,
sample,
THCudaLongTensor_data(state, self),
numDist, numCategories,
THCTensor_(data)(state, origDist),
THCTensor_(data)(state, prefixSum));
}
}
Expand Down
58 changes: 0 additions & 58 deletions test/multinomial.lua~

This file was deleted.

0 comments on commit 3dd47e8

Please sign in to comment.