From e87767ea00f9e27ef986ad97cca8d84c7c928b7c Mon Sep 17 00:00:00 2001 From: TFbunny Date: Tue, 13 Oct 2020 09:30:32 -0400 Subject: [PATCH] fix casting problem --- .../backend/kernel_compiler/gpu/cuda_impl/random_op_impl.cu | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/random_op_impl.cu b/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/random_op_impl.cu index 6f6f606c8e..e2376ecd1f 100644 --- a/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/random_op_impl.cu +++ b/mindspore/ccsrc/backend/kernel_compiler/gpu/cuda_impl/random_op_impl.cu @@ -12,7 +12,7 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - */ + */ #include "random_op_impl.cuh" template @@ -29,7 +29,7 @@ __global__ void UniformIntKernel(int seed, curandState *globalState, T *input1, T *input2, size_t input_size_2, T *output, size_t count) { for (size_t i = blockIdx.x * blockDim.x + threadIdx.x; i < (count); i += blockDim.x * gridDim.x) { curand_init(seed, i, 0, &globalState[i]); - output[i] = (T)(curand_uniform(&globalState[i])) * (input2[0] - input1[0]) + input1[0]; + output[i] = (T)(curand_uniform(&globalState[i]) * (input2[0] - input1[0])) + input1[0]; } return; }