From 39b1967870e6fabe6764360bccefad8a2a9db24d Mon Sep 17 00:00:00 2001 From: Determinant Date: Wed, 24 Feb 2016 17:00:40 +0800 Subject: adjust the code according to the changes made in nerv/wrapped-handles --- htk_io/src/cwrapper.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'htk_io/src/cwrapper.cpp') diff --git a/htk_io/src/cwrapper.cpp b/htk_io/src/cwrapper.cpp index b7ce2d5..efb5628 100644 --- a/htk_io/src/cwrapper.cpp +++ b/htk_io/src/cwrapper.cpp @@ -8,9 +8,10 @@ extern "C" { #include "cwrapper.h" #include "string.h" -#include "nerv/common.h" +#include "nerv/lib/common.h" +#include "nerv/lib/matrix/mmatrix.h" - extern Matrix *nerv_matrix_host_float_create(long nrow, long ncol, Status *status); + extern Matrix *nerv_matrix_host_float_create(long nrow, long ncol, MContext *context, Status *status); struct TNetFeatureRepo { TNet::FeatureRepository feature_repo; @@ -53,7 +54,8 @@ extern "C" { return repo; } - Matrix *tnet_feature_repo_read_utterance(TNetFeatureRepo *repo, lua_State *L, int debug) { + Matrix *tnet_feature_repo_read_utterance(TNetFeatureRepo *repo, lua_State *L, + int debug, MContext *context) { Matrix *mat; /* nerv implementation */ repo->feature_repo.ReadFullMatrix(repo->feats_host); std::string utter_str = repo->feature_repo.Current().Logical(); @@ -61,7 +63,7 @@ extern "C" { int n = repo->feats_host.Rows(); int m = repo->feats_host.Cols(); Status status; - mat = nerv_matrix_host_float_create(n, m, &status); + mat = nerv_matrix_host_float_create(n, m, context, &status); NERV_LUA_CHECK_STATUS(L, status); size_t stride = mat->stride; if (debug) @@ -119,7 +121,8 @@ extern "C" { size_t sample_rate, const char *tag, lua_State *L, - int debug) { + int debug, + MContext *context) { std::vector > labs_hosts; /* KaldiLib implementation */ Matrix *mat; repo->label_repo.GenDesiredMatrixExt(labs_hosts, frames, @@ -127,7 +130,7 @@ extern "C" { int n = labs_hosts[0].Rows(); int m = labs_hosts[0].Cols(); Status status; - mat = nerv_matrix_host_float_create(n, m, &status); + mat = nerv_matrix_host_float_create(n, m, context, &status); NERV_LUA_CHECK_STATUS(L, status); size_t stride = mat->stride; if (debug) -- cgit v1.2.3