Skip to content

Commit b8d26ff

Browse files
liaoganggangliao
authored andcommitted
fix float except bugs
1 parent aaed5cf commit b8d26ff

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

paddle/gserver/dataproviders/PyDataProvider.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ PyDataProvider::PyDataProvider(const DataConfig& config, bool useGpu,
4646
}
4747

4848
void PyDataProvider::loadData(const std::vector<std::string>& fileList) {
49-
int feFlag = fegetexcept();
5049
VLOG(1) << "module:" << pyModuleName_ << " class:" << pyClassName_;
5150
classInstance_ =
5251
createPythonClass(pyModuleName_, pyClassName_, fileList, pyUserArgs_);
@@ -57,7 +56,7 @@ void PyDataProvider::loadData(const std::vector<std::string>& fileList) {
5756
std::string headerInfo =
5857
std::string(PyString_AsString(obj.get()), PyString_Size(obj.get()));
5958
parseHeaderData(headerInfo);
60-
feenableexcept(feFlag);
59+
feenableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW);
6160
}
6261

6362
void PyDataProvider::parseHeaderData(const std::string& headerData) {

paddle/math/PoolAllocator.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,7 @@ class PoolAllocator {
5353
void printAll();
5454
std::unique_ptr<Allocator> allocator_;
5555
std::mutex mutex_;
56-
#if defined(__APPLE__) || defined(__OSX__)
57-
std::map<size_t, std::vector<void*>> pool_;
58-
#else
5956
std::unordered_map<size_t, std::vector<void*>> pool_;
60-
#endif
6157
size_t sizeLimit_;
6258
size_t poolMemorySize_;
6359
std::string name_;

0 commit comments

Comments
 (0)