Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unused code #5219

Merged
merged 3 commits into from
Oct 31, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 0 additions & 60 deletions paddle/platform/environment.h

This file was deleted.

54 changes: 0 additions & 54 deletions paddle/platform/environment_test.cc

This file was deleted.

7 changes: 0 additions & 7 deletions paddle/platform/gpu_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@ size_t GpuMaxChunkSize() {

GpuMemoryUsage(available, total);

if (IsEnvVarDefined(kEnvFractionGpuMemoryToUse)) {
Copy link
Collaborator

@wangkuiyi wangkuiyi Jan 30, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that we don't need platform/environment.{h,cc}, which looks too heavy. This segment of code could be

if (std::getenv(kEnvFractionGpuMemoryToUse)) {
  *FLAG_fraction_of_gpu_memory_to_use = std::strtod(std::getenv(kEnvFractionGpuMemoryToUse), nullptr);
  PADDLE_ENFORCE_GT(val, 0.0);		
  PADDLE_ENFORCE_LE(val, 1.0);
}

auto val = std::stod(GetEnvValue(kEnvFractionGpuMemoryToUse));
PADDLE_ENFORCE_GT(val, 0.0);
PADDLE_ENFORCE_LE(val, 1.0);
FLAGS_fraction_of_gpu_memory_to_use = val;
}

// Reserving the rest memory for page tables, etc.
size_t reserving = (1 - FLAGS_fraction_of_gpu_memory_to_use) * total;

Expand Down