Skip to content

Commit

Permalink
updates...
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavsharma committed Aug 15, 2019
1 parent fe09f6d commit 1f0a904
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions include/onnxruntime/core/session/onnxruntime_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ ORT_API_STATUS(OrtAllocatorAlloc, _Inout_ OrtAllocator* ptr, size_t size, _Outpt
ORT_API_STATUS(OrtAllocatorFree, _Inout_ OrtAllocator* ptr, void* p);
ORT_API_STATUS(OrtAllocatorGetInfo, _In_ const OrtAllocator* ptr, _Out_ const OrtAllocatorInfo** out);

// The returned pointer doesn't have to be freed.
// Always returns the same instance on every invocation.
ORT_API_STATUS(OrtGetDefaultAllocator, _Outptr_ OrtAllocator** out);

ORT_API(const char*, OrtGetVersionString);
Expand Down
5 changes: 3 additions & 2 deletions include/onnxruntime/core/session/onnxruntime_cxx_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ struct Exception : std::exception {
#define ORT_DEFINE_RELEASE(NAME) \
inline void OrtRelease(Ort##NAME* ptr) { OrtRelease##NAME(ptr); }

ORT_DEFINE_RELEASE(Allocator);
ORT_DEFINE_RELEASE(AllocatorInfo);
ORT_DEFINE_RELEASE(CustomOpDomain);
ORT_DEFINE_RELEASE(Env);
Expand Down Expand Up @@ -229,11 +230,11 @@ struct Value : Base<OrtValue> {
TensorTypeAndShapeInfo GetTensorTypeAndShapeInfo() const;
};

struct Allocator : Base<OrtAllocator> {
struct Allocator : Unowned<Base<OrtAllocator>> {
static Allocator GetDefault();

explicit Allocator(nullptr_t) {}
explicit Allocator(OrtAllocator* p) : Base<OrtAllocator>{p} {}
explicit Allocator(OrtAllocator* p) : Unowned<Base<OrtAllocator>>{p} {}

void* Alloc(size_t size);
void Free(void* p);
Expand Down

0 comments on commit 1f0a904

Please sign in to comment.