File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
backends/apple/metal/runtime/shims Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 1212#include < executorch/backends/apple/metal/runtime/shims/tensor_attribute.h>
1313#include < executorch/backends/apple/metal/runtime/shims/utils.h>
1414#include < executorch/runtime/platform/log.h>
15- #include < cstdint>
1615#include < cstdint> // Ensure we have int64_t, int32_t definitions
1716#include < cstdio>
1817#include < cstdlib>
@@ -144,7 +143,8 @@ AOTITorchError aoti_torch_empty_strided(
144143 dtype);
145144 int64_t nbytes = numel * element_size;
146145
147- if (device_type == 2 ) { // Metal/MPS
146+ int32_t mps_device_type = aoti_torch_device_type_mps (); // Returns 13
147+ if (device_type == mps_device_type) {
148148 ptr = metal_allocate_buffer (nbytes);
149149 if (!ptr) {
150150 ET_LOG (Error, " Failed to allocate %lld bytes on Metal device" , nbytes);
You can’t perform that action at this time.
0 commit comments