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 all commits
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
1 change: 0 additions & 1 deletion paddle/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ cc_test(place_test SRCS place_test.cc DEPS place glog gflags)
add_subdirectory(dynload)

cc_test(enforce_test SRCS enforce_test.cc DEPS stringpiece)
cc_test(environment_test SRCS environment_test.cc DEPS stringpiece)

IF(WITH_GPU)
set(GPU_CTX_DEPS dynload_cuda dynamic_loader)
Expand Down
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.

8 changes: 0 additions & 8 deletions paddle/platform/gpu_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License. */
#include "gflags/gflags.h"

#include "paddle/platform/enforce.h"
#include "paddle/platform/environment.h"

DEFINE_double(fraction_of_gpu_memory_to_use, 0.95,
"Default use 95% of GPU memory for PaddlePaddle,"
Expand Down Expand Up @@ -75,13 +74,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