Skip to content

Commit 7b2a9fc

Browse files
committed
Update base for Update on "[ET-VK] Enable FP16 type in operators"
Differential Revision: [D56189470](https://our.internmc.facebook.com/intern/diff/D56189470/) [ghstack-poisoned]
1 parent bf58333 commit 7b2a9fc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

backends/vulkan/runtime/api/Adapter.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
* LICENSE file in the root directory of this source tree.
77
*/
88

9+
// NOLINTBEGIN(clang-diagnostic-missing-field-initializers)
10+
911
#include <executorch/backends/vulkan/runtime/api/Adapter.h>
1012

1113
#include <bitset>

backends/vulkan/runtime/api/Tensor.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,14 @@ vTensor::vTensor(
228228
memory_layout_,
229229
gpu_sizes_,
230230
dtype_,
231-
allocate_memory)) {}
231+
allocate_memory)) {
232+
if (dtype == api::kHalf) {
233+
VK_CHECK_COND(
234+
api::context()->adapter_ptr()->has_16bit_storage(),
235+
"Half dtype is only available if the physical device supports float16 "
236+
"storage buffers!");
237+
}
238+
}
232239

233240
vTensor::vTensor(
234241
api::Context* const context,

0 commit comments

Comments
 (0)