mirror of
https://github.com/sgjzfzzf/triton-tvm-ffi.git
synced 2026-07-01 08:51:56 +08:00
put typedvalues initialization into cpp
Signed-off-by: Jinjie Liu <jjliu@baai.ac.cn>
This commit is contained in:
@@ -25,6 +25,15 @@ private:
|
||||
const std::string message_;
|
||||
};
|
||||
|
||||
class UnmatchedArgumentException : public std::exception {
|
||||
public:
|
||||
UnmatchedArgumentException(std::string_view name, size_t len, size_t expect);
|
||||
const char *what() const noexcept override;
|
||||
|
||||
private:
|
||||
const std::string message_;
|
||||
};
|
||||
|
||||
class UnknownTypeException : public std::exception {
|
||||
public:
|
||||
UnknownTypeException(Type type);
|
||||
|
||||
+2
-3
@@ -2,8 +2,7 @@
|
||||
#define TRITON_TVM_FFI_TYPE_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <tvm/ffi/object.h>
|
||||
#include <tvm/ffi/string.h>
|
||||
#include <tvm/ffi/tvm_ffi.h>
|
||||
#include <type_traits>
|
||||
|
||||
namespace triton_tvm_ffi {
|
||||
@@ -35,7 +34,7 @@ enum class Type : int64_t {
|
||||
};
|
||||
|
||||
const char *TypeToString(Type type);
|
||||
tvm::ffi::Optional<Type> StringToType(tvm::ffi::String str);
|
||||
tvm::ffi::Optional<Type> StringToType(const tvm::ffi::String &name);
|
||||
|
||||
template <Type T> struct type_to_ctype;
|
||||
#define DEFINE_TYPE_TO_CTYPE(type, str, ctype) \
|
||||
|
||||
@@ -40,6 +40,13 @@ public:
|
||||
TypedValueObj);
|
||||
};
|
||||
|
||||
tvm::ffi::Optional<TypedValue> MakeTypedValue(const tvm::ffi::String &type,
|
||||
const tvm::ffi::Any &value);
|
||||
|
||||
tvm::ffi::Array<TypedValue>
|
||||
MakeTypedValues(const tvm::ffi::Array<tvm::ffi::String> &types,
|
||||
const tvm::ffi::Array<tvm::ffi::Any> &values);
|
||||
|
||||
} // namespace triton_tvm_ffi
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user