Skip to content
Closed
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
26 changes: 0 additions & 26 deletions paddle/fluid/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ cc_library(
SRCS denormal.cc
DEPS)

cc_test(
errors_test
SRCS errors_test.cc
DEPS phi common enforce)

set(enforce_deps phi)
if(WITH_GPU)
set(enforce_deps ${enforce_deps} external_error_proto)
Expand All @@ -18,28 +13,11 @@ cc_library(
SRCS enforce.cc
DEPS ${enforce_deps})
cc_library(monitor SRCS monitor.cc)
cc_test(
enforce_test
SRCS enforce_test.cc
DEPS enforce common)

cc_test(
cpu_info_test
SRCS cpu_info_test.cc
DEPS phi common)
cc_test(
os_info_test
SRCS os_info_test.cc
DEPS phi common)

cc_library(
place
SRCS place.cc
DEPS enforce phi common)
cc_test(
place_test
SRCS place_test.cc
DEPS place glog phi common)

if(WITH_MKLDNN)
set(MKLDNN_CTX_DEPS mkldnn)
Expand All @@ -54,10 +32,6 @@ cc_library(
cpu_helper
SRCS cpu_helper.cc
DEPS cblas enforce common)
cc_test(
cpu_helper_test
SRCS cpu_helper_test.cc
DEPS cpu_helper)

set(dgc_deps "")
if(WITH_DGC)
Expand Down
2 changes: 1 addition & 1 deletion paddle/phi/backends/cpu/cpu_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace cpu {
size_t CpuTotalPhysicalMemory();

//! Get the maximum allocation size for a machine.
size_t CpuMaxAllocSize();
TEST_API size_t CpuMaxAllocSize();

//! Get the maximum allocation size for a machine.
size_t CUDAPinnedMaxAllocSize();
Expand Down
12 changes: 6 additions & 6 deletions paddle/phi/core/os_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,30 +45,30 @@ struct ThreadId {
};

// Better performance than GetCurrentThreadId
uint64_t GetCurrentThreadStdId();
TEST_API uint64_t GetCurrentThreadStdId();

// Better performance than GetCurrentThreadId
uint64_t GetCurrentThreadSysId();

ThreadId GetCurrentThreadId();
TEST_API ThreadId GetCurrentThreadId();

// Return the map from StdTid to ThreadId
// Returns current snapshot of all threads. Make sure there is no thread
// create/destory when using it.
std::unordered_map<uint64_t, ThreadId> GetAllThreadIds();
TEST_API std::unordered_map<uint64_t, ThreadId> GetAllThreadIds();

static constexpr const char* kDefaultThreadName = "unnamed";
// Returns kDefaultThreadName if SetCurrentThreadName is never called.
std::string GetCurrentThreadName();
TEST_API std::string GetCurrentThreadName();

// Return the map from StdTid to ThreadName
// Returns current snapshot of all threads. Make sure there is no thread
// create/destory when using it.
std::unordered_map<uint64_t, std::string> GetAllThreadNames();
TEST_API std::unordered_map<uint64_t, std::string> GetAllThreadNames();

// Thread name is immutable, only the first call will succeed.
// Returns false on failure.
bool SetCurrentThreadName(const std::string& name);
TEST_API bool SetCurrentThreadName(const std::string& name);

uint32_t GetProcessId();

Expand Down
26 changes: 26 additions & 0 deletions test/cpp/fluid/platform/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,28 @@
add_subdirectory(device)
add_subdirectory(profiler)

paddle_test(errors_test SRCS errors_test.cc)

nv_test(
enforce_test
SRCS enforce_test.cc
DEPS enforce common)

paddle_test(cpu_info_test SRCS cpu_info_test.cc DEPS common)
paddle_test(os_info_test SRCS os_info_test.cc DEPS common)

cc_test(
place_test
SRCS place_test.cc
DEPS place glog phi common)

cc_test(
cpu_helper_test
SRCS cpu_helper_test.cc
DEPS cpu_helper)

if(WITH_ONNXRUNTIME AND WIN32)
# Copy onnxruntime for some c++ test in Windows, since the test will
# be build only in CI, so suppose the generator in Windows is Ninja.
copy_onnx(errors_test)
endif()