Source/Readers/LMSequenceReader/: also build SequenceWriter on Linux

This commit is contained in:
Mark Hillebrand 2015-12-15 12:39:43 +00:00
Родитель edbecc4213
Коммит 02d0405118
3 изменённых файлов: 23 добавлений и 18 удалений

Просмотреть файл

@ -309,6 +309,7 @@ LMSEQUENCEREADER_SRC =\
$(SOURCEDIR)/Readers/LMSequenceReader/Exports.cpp \
$(SOURCEDIR)/Readers/LMSequenceReader/SequenceParser.cpp \
$(SOURCEDIR)/Readers/LMSequenceReader/SequenceReader.cpp \
$(SOURCEDIR)/Readers/LMSequenceReader/SequenceWriter.cpp \
LMSEQUENCEREADER_OBJ := $(patsubst %.cpp, $(OBJDIR)/%.o, $(LMSEQUENCEREADER_SRC))

Просмотреть файл

@ -4,10 +4,10 @@
// </copyright>
//
//
#include "stdafx.h"
#ifdef _WIN32
#include <objbase.h>
#endif
#include "Basics.h"
#include <fstream>
#include <algorithm>

Просмотреть файл

@ -12,21 +12,6 @@
namespace Microsoft { namespace MSR { namespace CNTK {
template<class ElemType>
void DATAWRITER_API GetWriter(IDataWriter<ElemType>** pwriter)
{
*pwriter = new LMSequenceWriter<ElemType>();
}
extern "C" DATAWRITER_API void GetWriterF(IDataWriter<float>** pwriter)
{
GetWriter(pwriter);
}
extern "C" DATAWRITER_API void GetWriterD(IDataWriter<double>** pwriter)
{
GetWriter(pwriter);
}
template<class ElemType>
class LMSequenceWriter : public IDataWriter<ElemType>
{
@ -65,8 +50,10 @@ namespace Microsoft { namespace MSR { namespace CNTK {
}
public:
using LabelType = typename IDataWriter<ElemType>::LabelType;
using LabelIdType = typename IDataWriter<ElemType>::LabelIdType;
void GetSections(std::map<std::wstring, SectionType, nocase_compare>& /*sections*/){}
void SaveMapping(std::wstring saveId, const std::map<typename LabelIdType, typename LabelType>& /*labelMapping*/){}
void SaveMapping(std::wstring saveId, const std::map<LabelIdType, LabelType>& /*labelMapping*/){}
public:
template<class ConfigRecordType>
@ -77,4 +64,21 @@ namespace Microsoft { namespace MSR { namespace CNTK {
virtual bool SaveData(size_t recordStart, const std::map<std::wstring, void*, nocase_compare>& matrices, size_t numRecords, size_t datasetSize, size_t byteVariableSized);
};
template<class ElemType>
void DATAWRITER_API GetWriter(IDataWriter<ElemType>** pwriter)
{
assert(pwriter != nullptr);
*pwriter = new LMSequenceWriter<ElemType>();
assert(*pwriter != nullptr);
}
extern "C" DATAWRITER_API void GetWriterF(IDataWriter<float>** pwriter)
{
GetWriter(pwriter);
}
extern "C" DATAWRITER_API void GetWriterD(IDataWriter<double>** pwriter)
{
GetWriter(pwriter);
}
}}}