summaryrefslogtreecommitdiff
path: root/htk_io/src/cwrapper.cpp
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2016-02-24 17:00:40 +0800
committerDeterminant <[email protected]>2016-02-24 17:00:40 +0800
commit39b1967870e6fabe6764360bccefad8a2a9db24d (patch)
tree0a60f3e6d5137b6b32f82e496b9701e13e52f9d4 /htk_io/src/cwrapper.cpp
parent3f742c01540b8bad940d66331d562082a63d975b (diff)
adjust the code according to the changes made in nerv/wrapped-handleswrapped-handles
Diffstat (limited to 'htk_io/src/cwrapper.cpp')
-rw-r--r--htk_io/src/cwrapper.cpp15
1 files changed, 9 insertions, 6 deletions
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<TNet::Matrix<float> > 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)