Skip to content

Commit

Permalink
Change mutable_data to ctx.Alloc. (#49001)
Browse files Browse the repository at this point in the history
  • Loading branch information
Xreki authored Dec 14, 2022
1 parent 3c81d0c commit ceba70c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions paddle/fluid/framework/details/nan_inf_utils_detail.cu
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,12 @@ void TensorCheckerVisitor<phi::GPUContext>::apply(
phi::DenseTensor block_num_nan_inf;
block_num_nan_inf.Resize({static_cast<int64_t>(2 * numel_max_min)});
int64_t* block_num_nan_ptr =
block_num_nan_inf.mutable_data<int64_t>(tensor.place());
dev_ctx->template Alloc<int64_t>(&block_num_nan_inf);
int64_t* block_num_inf_ptr = block_num_nan_ptr + numel_max_min;

phi::DenseTensor tensor_block_max_min;
tensor_block_max_min.Resize({static_cast<int64_t>(3 * numel_max_min)});
MT* tensor_block_max_ptr =
tensor_block_max_min.mutable_data<MT>(tensor.place());
MT* tensor_block_max_ptr = dev_ctx->template Alloc<MT>(&tensor_block_max_min);
MT* tensor_block_min_ptr = tensor_block_max_ptr + numel_max_min;
MT* tensor_block_mean_ptr = tensor_block_max_ptr + 2 * numel_max_min;

Expand Down

0 comments on commit ceba70c

Please sign in to comment.