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
|
||||
|
||||
#include <cstdint>
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
typedef int64_t INDEX_TYPE;
|
||||
|
||||
|
@ -16,15 +20,26 @@ struct DynMemRef {
|
|||
INDEX_TYPE *sizes;
|
||||
int64_t *strides;
|
||||
|
||||
#ifdef __cplusplus
|
||||
DynMemRef(int _rank);
|
||||
#endif
|
||||
};
|
||||
|
||||
extern "C" {
|
||||
|
||||
#ifdef __cplusplus
|
||||
// Ordered DynMemRef Dictionary is a data structure for wrapping the input
|
||||
// dynmemrefs so that they can be addressed both by index and by name.
|
||||
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.
|
||||
int numDynMemRefs(OrderedDynMemRefDict *dict);
|
||||
|
||||
|
@ -58,4 +73,7 @@ INDEX_TYPE *getSizes(DynMemRef *);
|
|||
|
||||
// Get ptr to strides array.
|
||||
int64_t *getStrides(DynMemRef *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue