mirror of
https://github.com/zebrajr/tensorflow.git
synced 2025-12-06 12:20:11 +01:00
[xla:ffi] Add xla::ffi::MakeTypeInfo
PiperOrigin-RevId: 825230372
This commit is contained in:
parent
1d829c0f02
commit
3ea8166731
6
third_party/xla/xla/ffi/api/ffi.h
vendored
6
third_party/xla/xla/ffi/api/ffi.h
vendored
|
|
@ -1503,11 +1503,17 @@ inline ThreadPool::ThreadPool(const XLA_FFI_Api* api,
|
|||
// Type Registration
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// TODO(ezhulenev): Remove this once everyone migrates to MakeTypeInfo.
|
||||
template <typename T>
|
||||
constexpr XLA_FFI_TypeInfo TypeInfo() {
|
||||
return XLA_FFI_TypeInfo{[](void* ptr) { delete static_cast<T*>(ptr); }};
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr XLA_FFI_TypeInfo MakeTypeInfo() {
|
||||
return XLA_FFI_TypeInfo{[](void* ptr) { delete static_cast<T*>(ptr); }};
|
||||
}
|
||||
|
||||
#define XLA_FFI_REGISTER_TYPE(API, NAME, TYPE_ID, TYPE_INFO) \
|
||||
XLA_FFI_REGISTER_TYPE_(API, NAME, TYPE_ID, TYPE_INFO, __COUNTER__)
|
||||
#define XLA_FFI_REGISTER_TYPE_(API, NAME, TYPE_ID, TYPE_INFO, N) \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user