mnemonic-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject incubator-mnemonic git commit: MNEMONIC-387 Compilation error in mnemonic-computing-services module
Date Fri, 27 Oct 2017 05:30:56 GMT
Repository: incubator-mnemonic
Updated Branches:
  refs/heads/master 0a3e2929d -> 6ee99e72f


MNEMONIC-387 Compilation error in mnemonic-computing-services module


Project: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/commit/6ee99e72
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/tree/6ee99e72
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/diff/6ee99e72

Branch: refs/heads/master
Commit: 6ee99e72f60bb3f796e665ed2447a1dfd7130429
Parents: 0a3e292
Author: Yanhui Zhao <yzhao@apache.org>
Authored: Sun Oct 15 22:36:05 2017 -0700
Committer: Yanhui Zhao <yzhao@apache.org>
Committed: Thu Oct 26 22:14:00 2017 -0700

----------------------------------------------------------------------
 .../src/main/native/common.c                    | 54 ++++++++++----------
 .../src/main/native/common.h                    |  6 ++-
 ...omputing_internal_VectorizationServiceImpl.c |  8 ---
 3 files changed, 31 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/6ee99e72/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.c
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.c
b/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.c
index e6aecd5..b7621ce 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.c
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.c
@@ -31,7 +31,7 @@
  */
 void throw(JNIEnv* env, const char* msg) {
   if (msg == NULL)
-    msg = sys_errlist[errno];
+    msg = strerror(errno);
 
   jclass xklass = (*env)->FindClass(env, "java/lang/RuntimeException");
   (*env)->ThrowNew(env, xklass, msg);
@@ -389,31 +389,6 @@ long handleValueInfo(JNIEnv* env, struct NValueInfo *nvinfo, valueHandler
valhan
   return nvinfo->handler;
 }
 
-long handleVectorInfo(JNIEnv* env, struct NValueInfo *nvinfo, vecValueHandler valhandler,
long dc_handler, long dc_size, long* count) {
-  if (NULL == nvinfo->frames || 0 >= nvinfo->framessz) {
-    return 0L;
-  }
-  void *chk_addr = to_e(env, nvinfo, dc_handler); 
-  size_t dims[nvinfo->framessz];
-  long *itmaddrs[nvinfo->framessz];
-  long *nxtfitmaddrs[nvinfo->framessz];
-  long pendings[nvinfo->framessz];
-  long hdls[nvinfo->framessz];
-  long position = 0;
-  size_t i;
-  for (i = 0; i < nvinfo->framessz; ++i) {
-    dims[i] = 0;
-    itmaddrs[i] = NULL;
-    nxtfitmaddrs[i] = NULL;
-    pendings[i] = 0L;
-    hdls[i] = 0L;
-  }
-  hdls[0] = nvinfo->handler;
-  itmaddrs[0] = &nvinfo->handler;
-  vectorIterTensor(env, nvinfo, dims, itmaddrs, &nxtfitmaddrs, &pendings, hdls, -1,
chk_addr, dc_size, &position, count);
-  return nvinfo->handler;
-}
-
 void vectorIterTensor(JNIEnv* env, struct NValueInfo *nvinfo,
     size_t dims[], long *itmaddrs[], long *(* const nxtfitmaddrs)[],
     long (* const pendings)[], long hdls[],
@@ -434,7 +409,7 @@ void vectorIterTensor(JNIEnv* env, struct NValueInfo *nvinfo,
         itmaddrs[dimidx + 1] = (long*)(to_e(env, nvinfo, hdls[dimidx]) + curnloff);
         hdls[dimidx + 1] = *itmaddrs[dimidx + 1];
         (*nxtfitmaddrs)[dimidx] = (long*)(to_e(env, nvinfo, hdls[dimidx]) + curoff);
-        vectorIterTensor(env, nvinfo, dims, itmaddrs, nxtfitmaddrs, pendings, hdls, dimidx,
valhandler, chkaddr, chksize, *vposition, vcount);
+        vectorIterTensor(env, nvinfo, dims, itmaddrs, nxtfitmaddrs, pendings, hdls, dimidx,
valhandler, chkaddr, chksize, vposition, vcount);
         itmaddrs[dimidx] = (*nxtfitmaddrs)[dimidx];
         hdls[dimidx] = *itmaddrs[dimidx];
         ++dims[dimidx];
@@ -472,3 +447,28 @@ void vectorIterTensor(JNIEnv* env, struct NValueInfo *nvinfo,
     }
   }
 }
+
+long handleVectorInfo(JNIEnv* env, struct NValueInfo *nvinfo, vecValueHandler valhandler,
long dc_handler, long dc_size, long* count) {
+  if (NULL == nvinfo->frames || 0 >= nvinfo->framessz) {
+    return 0L;
+  }
+  void *chk_addr = to_e(env, nvinfo, dc_handler); 
+  size_t dims[nvinfo->framessz];
+  long *itmaddrs[nvinfo->framessz];
+  long *nxtfitmaddrs[nvinfo->framessz];
+  long pendings[nvinfo->framessz];
+  long hdls[nvinfo->framessz];
+  long position = 0;
+  size_t i;
+  for (i = 0; i < nvinfo->framessz; ++i) {
+    dims[i] = 0;
+    itmaddrs[i] = NULL;
+    nxtfitmaddrs[i] = NULL;
+    pendings[i] = 0L;
+    hdls[i] = 0L;
+  }
+  hdls[0] = nvinfo->handler;
+  itmaddrs[0] = &nvinfo->handler;
+  vectorIterTensor(env, nvinfo, dims, itmaddrs, &nxtfitmaddrs, &pendings, hdls, -1,
valhandler, chk_addr, dc_size, &position, count);
+  return nvinfo->handler;
+}

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/6ee99e72/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.h
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.h
b/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.h
index 4f87abe..21d9796 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.h
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/common.h
@@ -114,12 +114,12 @@ jlongArray constructJLongArray(JNIEnv* env, long arr[], size_t sz);
 /**
  * translate portable addr. to effective addr.
  */
-inline void *to_e(JNIEnv* env, struct NValueInfo *nvinfo, long p);
+void *to_e(JNIEnv* env, struct NValueInfo *nvinfo, long p);
 
 /**
  * translate effective addr. to portable addr.
  */
-inline long to_p(JNIEnv* env, struct NValueInfo *nvinfo, void *e);
+long to_p(JNIEnv* env, struct NValueInfo *nvinfo, void *e);
 
 /**
  * handle one native value info.
@@ -127,6 +127,8 @@ inline long to_p(JNIEnv* env, struct NValueInfo *nvinfo, void *e);
  */
 long handleValueInfo(JNIEnv* env, struct NValueInfo *nvinfo, valueHandler valhandler);
 
+long handleVectorInfo(JNIEnv* env, struct NValueInfo *nvinfo, vecValueHandler valhandler,
long dc_handler, long dc_size, long* count);
+
 #ifdef __cplusplus
 }
 #endif

http://git-wip-us.apache.org/repos/asf/incubator-mnemonic/blob/6ee99e72/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computing_internal_VectorizationServiceImpl.c
----------------------------------------------------------------------
diff --git a/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computing_internal_VectorizationServiceImpl.c
b/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computing_internal_VectorizationServiceImpl.c
index 03ed490..f6569ea 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computing_internal_VectorizationServiceImpl.c
+++ b/mnemonic-computing-services/mnemonic-utilities-service/src/main/native/org_apache_mnemonic_service_computing_internal_VectorizationServiceImpl.c
@@ -42,48 +42,40 @@ void valVectorizationHandler(JNIEnv* env, size_t dims[], size_t dimidx,
     return;
   }
 
-  char* curr = (char*)dc_addr + *position;
-
   switch(dtype) {
     case DURABLE_BOOLEAN:
     case DURABLE_CHARACTER:
     case DURABLE_BYTE:
-      curr = &*(char*)addr;
       if (*position + 1 < dc_size) {
         *position += 1;
         *count += 1;
       }
       break;
     case DURABLE_SHORT:
-      curr = &*(short*)addr;
       if (*position + 2 < dc_size) {
         *position += 2;
         *count += 1;
       }
       break;
     case DURABLE_INTEGER:
-      curr = &*(int*)addr;
       if (*position + 4 < dc_size) {
         *position += 4;
         *count += 1;
       }
       break;
     case DURABLE_LONG:
-      curr = &*(long*)addr;
       if (*position + 8 < dc_size) {
         *position += 8;
         *count += 1;
       }
       break;
     case DURABLE_FLOAT:
-      curr = &*(float*)addr;
       if (*position + 4 < dc_size) {
         *position += 4;
         *count += 1;
       }
       break;
     case DURABLE_DOUBLE:
-      curr =&*(double*)addr;
       if (*position + 8 < dc_size) {
         *position += 8;
         *count += 1;


Mime
View raw message