Fixed error in SDK and test

This commit is contained in:
Bill Sun
2022-09-15 21:21:49 +08:00
parent bc66663491
commit 8f3b648c53
14 changed files with 1128 additions and 919 deletions
+11
View File
@@ -75,4 +75,15 @@ extern void register_memory(void* ptr, deallocator_t deallocator);
__AQEXPORT__(void) init_session(Context* cxt);
#define __AQ_NO_SESSION__ __AQEXPORT__(void) init_session(Context*) {}
void* memcpy(void*, void*, unsigned long long);
struct ColRef_storage {
void* container;
unsigned int capacity, size;
const char* name;
int ty; // what if enum is not int?
template <class Ty, template <typename> class VT>
ColRef_storage(const VT<Ty>& vt) {
memcpy(this, &vt, sizeof(ColRef_storage));
}
};
#endif
+1
View File
@@ -2,6 +2,7 @@
#include <memory>
#include <cstdlib>
#include <cstring>
#include <unordered_map>
Session* session;
+5 -2
View File
@@ -2,10 +2,13 @@
// __AQ_NO_SESSION__
#include "../server/table.h"
__AQEXPORT__(ColRef<float>) mulvec(int a, ColRef<float> b){
__AQEXPORT__(ColRef_storage) mulvec(int a, ColRef<float> b){
return a * b;
}
__AQEXPORT__(double) mydiv(int a, int b){
return a / (double)b;
printf("%d, %d\n", a, b);
double d = a/(double)b;
printf("%lf", d);
return d;
}