Skip to content

Commit

Permalink
Merge pull request NVIDIA#6 from egaburov/cub-fixes
Browse files Browse the repository at this point in the history
http://nvbugs/1904217
Former-commit-id: f5c46e7272b9e33b3c6bbdf9145a0e43dc47ea39
  • Loading branch information
dumerrill authored May 20, 2017
2 parents 3a22fac + 6d3d084 commit aa6ea7c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
5 changes: 4 additions & 1 deletion cub/thread/thread_operators.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ public:
__host__ __device__ __forceinline__
T operator()(const T &a, const T &b)
{
return scan_op(b, a);
T _a(a);
T _b(b);

return scan_op(_b, _a);
}
};

Expand Down
5 changes: 1 addition & 4 deletions cub/warp/specializations/warp_reduce_shfl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,7 @@ struct WarpReduceShfl
int offset, ///< [in] Up-offset to pull from
Int2Type<true> /*is_small_unsigned*/) ///< [in] Marker type indicating whether T is a small unsigned integer
{
// Recast as uint32 to take advantage of any specializations
unsigned int temp = reinterpret_cast<unsigned int &>(input);
temp = ReduceStep(temp, reduction_op, last_lane, offset);
return reinterpret_cast<_T&>(temp);
return ReduceStep(input, reduction_op, last_lane, offset);
}


Expand Down
6 changes: 1 addition & 5 deletions cub/warp/specializations/warp_scan_shfl.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -411,11 +411,7 @@ struct WarpScanShfl
int offset, ///< [in] Up-offset to pull from
Int2Type<true> /*is_small_unsigned*/) ///< [in] Marker type indicating whether T is a small integer
{
unsigned int temp = reinterpret_cast<unsigned int &>(input);

temp = InclusiveScanStep(temp, scan_op, first_lane, offset);

return reinterpret_cast<_T&>(temp);
return InclusiveScanStep(input, scan_op, first_lane, offset);
}


Expand Down

0 comments on commit aa6ea7c

Please sign in to comment.