1 #include <gtest/gtest.h> 7 void XLAFree(
void *ptr) {
11 void* XLAMalloc(ptrdiff_t size) {
17 auto* ptr = XLAMalloc(size);
18 return {ptr, ptr, &XLAFree, at::DeviceType::XLA};
20 at::DeleterFnPtr raw_deleter()
const override {
25 TEST(XlaTensorTest, TestNoStorage) {
27 auto storage =
Storage(caffe2::TypeMeta::Make<float>(), 0, &allocator,
true);
28 auto tensor_impl = c10::make_intrusive<TensorImpl, UndefinedTensorImpl>(
33 ASSERT_TRUE(t.device() == DeviceType::XLA);
Flush-To-Zero and Denormals-Are-Zero mode.