small fixes to make things compile and pass regression tests

This commit is contained in:
Marcin Junczys-Dowmunt 2018-06-07 15:14:54 -07:00
parent 7bb558ecfc
commit 7447dcba4f
3 changed files with 16 additions and 4 deletions

View File

@ -85,10 +85,10 @@ find_library(MKL_CORE_LIBRARY
set(MKL_INCLUDE_DIRS ${MKL_INCLUDE_DIR})
set(MKL_LIBRARIES ${MKL_INTERFACE_LIBRARY} ${MKL_SEQUENTIAL_LAYER_LIBRARY} ${MKL_CORE_LIBRARY})
message("1 ${MKL_INCLUDE_DIR}")
message("2 ${MKL_INTERFACE_LIBRARY}")
message("3 ${MKL_SEQUENTIAL_LAYER_LIBRARY}")
message("4 ${MKL_CORE_LIBRARY}")
# message("1 ${MKL_INCLUDE_DIR}")
# message("2 ${MKL_INTERFACE_LIBRARY}")
# message("3 ${MKL_SEQUENTIAL_LAYER_LIBRARY}")
# message("4 ${MKL_CORE_LIBRARY}")
if (MKL_INCLUDE_DIR AND
MKL_INTERFACE_LIBRARY AND

View File

@ -29,3 +29,14 @@ std::basic_istream<CharT,Traits>& GetLine(std::basic_istream<CharT,Traits>& in,
line.pop_back();
return in;
}
// wrapper around std::getline() that handles Windows input files with extra CR chars at the line end
template< class CharT, class Traits, class Allocator >
std::basic_istream<CharT,Traits>& GetLine(std::basic_istream<CharT,Traits>& in,
std::basic_string<CharT,Traits,Allocator>& line,
CharT delim) {
std::getline(in, line, delim);
if (in && !line.empty() && line.back() == in.widen('\r')) // strip terminal CR if present
line.pop_back();
return in;
}

View File

@ -8,6 +8,7 @@
#include <vector>
#include "common/config.h"
#include "common/utils.h"
// Constants for Iris example
const int NUM_FEATURES = 4;