Fix crash in Reduce when non-root ranks have invalid recvbuff

This commit is contained in:
Sylvain Jeaugey 2017-02-22 11:55:51 -08:00
parent 024d1e2678
commit 8e1d6f9b60

View File

@ -1,5 +1,5 @@
/************************************************************************* /*************************************************************************
* Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved. * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved.
* *
* See LICENSE.txt for license information * See LICENSE.txt for license information
************************************************************************/ ************************************************************************/
@ -74,18 +74,17 @@ __global__ void ReduceKernel(const KernelArgs<T> args) {
postReadyToNext); postReadyToNext);
} else if (rank == root) { } else if (rank == root) {
Prims::Reduce( Prims::Reduce(
prevInput + boffset,
thisInput + offset, thisInput + offset,
prevInput + boffset,
thisOutput + offset, thisOutput + offset,
sliceSize, maxOffset, sliceSize, maxOffset,
step, step,
waitReadyFromPrev, waitReadyFromPrev,
postDoneToPrev); postDoneToPrev);
} else { } else {
Prims::ReduceCopy( Prims::Reduce(
thisInput + offset, thisInput + offset,
prevInput + boffset, prevInput + boffset,
thisOutput + offset,
nextOutput + boffset, nextOutput + boffset,
sliceSize, maxOffset, sliceSize, maxOffset,
step, step,