Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiqiu committed Jul 29, 2022
1 parent c73144b commit dd31a84
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion paddle/fluid/framework/details/broadcast_op_handle_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct TestBroadcastOpHandle {
for (int i = 0; i < count; ++i) {
auto p = p::CUDAPlace(i);
place_list_.push_back(p);
ctxs_.emplace_back(new p::phi::GPUContext(p));
ctxs_.emplace_back(new phi::GPUContext(p));
}
nccl_ctxs_.reset(new platform::NCCLContextMap(place_list_));
#else
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/framework/details/gather_op_handle_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ struct TestGatherOpHandle {
for (int i = 0; i < count; ++i) {
auto p = p::CUDAPlace(i);
gpu_list_.push_back(p);
ctxs_.emplace_back(new p::phi::GPUContext(p));
ctxs_.emplace_back(new phi::GPUContext(p));
}
#else
PADDLE_THROW(
Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/memory/malloc_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ void MultiStreamCompute(float **data,
#endif
}

TEST(Malloc, phi::GPUContextMultiStream) {
TEST(Malloc, GPUContextMultiStream) {
auto place = platform::CUDAPlace(0);
platform::SetDeviceId(0);

Expand Down Expand Up @@ -142,7 +142,7 @@ TEST(Malloc, phi::GPUContextMultiStream) {
}
}

TEST(Malloc, phi::GPUContextMultiThreadMultiStream) {
TEST(Malloc, GPUContextMultiThreadMultiStream) {
auto place = platform::CUDAPlace(0);
platform::SetDeviceId(0);

Expand Down
4 changes: 2 additions & 2 deletions paddle/fluid/operators/copy_cross_scope_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void Compare2(f::Scope* scope,
#ifdef PADDLE_WITH_CUDA
TEST(copy_cross_scope, CUDA_fp32) {
f::Scope scope;
p::phi::GPUContext ctx(p::CUDAPlace(0));
phi::GPUContext ctx(p::CUDAPlace(0));
ctx.SetAllocator(paddle::memory::allocation::AllocatorFacade::Instance()
.GetAllocator(p::CUDAPlace(0), ctx.stream())
.get());
Expand All @@ -142,7 +142,7 @@ TEST(copy_cross_scope, CUDA_fp32) {

TEST(copy_cross_scope_to_main_scope, CUDA_fp32) {
f::Scope scope;
p::phi::GPUContext ctx(p::CUDAPlace(0));
phi::GPUContext ctx(p::CUDAPlace(0));
ctx.SetAllocator(paddle::memory::allocation::AllocatorFacade::Instance()
.GetAllocator(p::CUDAPlace(0), ctx.stream())
.get());
Expand Down
6 changes: 3 additions & 3 deletions paddle/fluid/operators/nccl/nccl_op_test.cu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class NCCLTester : public ::testing::Test {
paddle::platform::CPUPlace cpu_place;
for (size_t i = 0; i < gpu_list_.size(); ++i) {
p::CUDAPlace place(i);
auto *ctx = new p::phi::GPUContext(place);
auto *ctx = new phi::GPUContext(place);
ctx->SetAllocator(paddle::memory::allocation::AllocatorFacade::Instance()
.GetAllocator(place, ctx->stream())
.get());
Expand Down Expand Up @@ -184,7 +184,7 @@ void NCCLTester::testNcclAllReduceOp() {
result_tensor->Resize(kDims);
auto *ct = result_tensor->mutable_data<float>(cpu_place);

auto *dev_ctx = static_cast<p::phi::GPUContext *>(dev_ctxs_[i]);
auto *dev_ctx = static_cast<phi::GPUContext *>(dev_ctxs_[i]);
paddle::memory::Copy(cpu_place,
ct,
p::CUDAPlace(gpu_list_[i]),
Expand Down Expand Up @@ -296,7 +296,7 @@ void NCCLTester::testNcclBcastOp() {
result_tensor->Resize(kDims);
auto *ct = result_tensor->mutable_data<float>(cpu_place);

auto *dev_ctx = static_cast<p::phi::GPUContext *>(dev_ctxs_[idx]);
auto *dev_ctx = static_cast<phi::GPUContext *>(dev_ctxs_[idx]);
paddle::memory::Copy(cpu_place,
ct,
p::CUDAPlace(gpu_list_[idx]),
Expand Down
2 changes: 1 addition & 1 deletion paddle/fluid/platform/device_context_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TEST(Device, Init) {
}
}

TEST(Device, phi::GPUContext) {
TEST(Device, GPUContext) {
using paddle::platform::CUDAPlace;
using phi::GPUContext;

Expand Down

0 comments on commit dd31a84

Please sign in to comment.