-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FFI][RUNTIME] Introduce runtime boxed types for int/float/bool #16183
Changes from all commits
3b866d1
bc7cdcc
4e394be
1d48545
c2ad012
6d55c9a
2704203
4f14e1f
4ce83f6
a60f5df
035cee6
549e1d5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ | |
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include <stdint.h> | ||
|
||
|
@@ -186,11 +187,12 @@ typedef enum { | |
kTVMBytes = 12U, | ||
kTVMNDArrayHandle = 13U, | ||
kTVMObjectRValueRefArg = 14U, | ||
kTVMArgBool = 15U, | ||
// Extension codes for other frameworks to integrate TVM PackedFunc. | ||
// To make sure each framework's id do not conflict, use first and | ||
// last sections to mark ranges. | ||
// Open an issue at the repo if you need a section of code. | ||
kTVMExtBegin = 15U, | ||
kTVMExtBegin = 16U, | ||
kTVMNNVMFirst = 16U, | ||
kTVMNNVMLast = 20U, | ||
// The following section of code is used for non-reserved types. | ||
|
@@ -207,6 +209,7 @@ typedef DLTensor* TVMArrayHandle; | |
*/ | ||
typedef union { | ||
int64_t v_int64; | ||
bool v_bool; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. likely v_bool is not needed and we can simply store value in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call, and implemented in #17240. |
||
double v_float64; | ||
void* v_handle; | ||
const char* v_str; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let us consider update the caller to Int as well so we don't have this path, as converting from IntImm -> Int can be less relevant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I've made the draft PR #17241 to remove the backwards-compatibility handler, in order to run CI and see which callers relied on it.