Makes the DynMemRef.h usable from C (#101)
This commit is contained in:
parent
64ed03295f
commit
e785a75705
|
@ -1,6 +1,10 @@
|
||||||
|
#ifdef __cplusplus
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#else
|
||||||
|
#include <stdint.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef int64_t INDEX_TYPE;
|
typedef int64_t INDEX_TYPE;
|
||||||
|
|
||||||
|
@ -16,15 +20,26 @@ struct DynMemRef {
|
||||||
INDEX_TYPE *sizes;
|
INDEX_TYPE *sizes;
|
||||||
int64_t *strides;
|
int64_t *strides;
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
DynMemRef(int _rank);
|
DynMemRef(int _rank);
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
extern "C" {
|
#ifdef __cplusplus
|
||||||
|
|
||||||
// Ordered DynMemRef Dictionary is a data structure for wrapping the input
|
// Ordered DynMemRef Dictionary is a data structure for wrapping the input
|
||||||
// dynmemrefs so that they can be addressed both by index and by name.
|
// dynmemrefs so that they can be addressed both by index and by name.
|
||||||
struct OrderedDynMemRefDict;
|
struct OrderedDynMemRefDict;
|
||||||
|
|
||||||
|
#else
|
||||||
|
typedef struct DynMemRef DynMemRef;
|
||||||
|
typedef struct _OrderedDynMemRefDict OrderedDynMemRefDict;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// Get number of dynamic memrefs in OrderedDynMemRefDict dict.
|
// Get number of dynamic memrefs in OrderedDynMemRefDict dict.
|
||||||
int numDynMemRefs(OrderedDynMemRefDict *dict);
|
int numDynMemRefs(OrderedDynMemRefDict *dict);
|
||||||
|
|
||||||
|
@ -58,4 +73,7 @@ INDEX_TYPE *getSizes(DynMemRef *);
|
||||||
|
|
||||||
// Get ptr to strides array.
|
// Get ptr to strides array.
|
||||||
int64_t *getStrides(DynMemRef *);
|
int64_t *getStrides(DynMemRef *);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue