diff --git a/paddle/fluid/memory/buffer.h b/paddle/fluid/memory/buffer.h index e29ade18adc9ac0c1f0b76e47057cb5154d0f628..8418970eade9a5e89a9a93cd751ae6160a483d06 100644 --- a/paddle/fluid/memory/buffer.h +++ b/paddle/fluid/memory/buffer.h @@ -50,7 +50,7 @@ class Buffer { allocation_ && allocation_->size() > 0 ? allocation_->ptr() : nullptr); } - size_t Size() const { return allocation_ ? 0 : allocation_->size(); } + size_t Size() const { return allocation_ ? allocation_->size() : 0; } platform::Place GetPlace() const { return place_; } diff --git a/paddle/phi/kernels/funcs/squared_l2_norm.h b/paddle/phi/kernels/funcs/squared_l2_norm.h index 21deecd5a746ca64276a5692d54c6e53e2f0f1f2..13aa430c623f5f6bbeb5390676fa28e530061ffe 100644 --- a/paddle/phi/kernels/funcs/squared_l2_norm.h +++ b/paddle/phi/kernels/funcs/squared_l2_norm.h @@ -82,7 +82,8 @@ void SquaredL2Norm(const phi::GPUContext& ctx, y, numel, cub::Sum(), - static_cast(0))); + static_cast(0), + stream)); } } #endif