Skip to content

Commit 8b1d309

Browse files
Update
[ghstack-poisoned]
2 parents 094b8bb + 81c4588 commit 8b1d309

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

backends/apple/metal/runtime/shims/memory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
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);

0 commit comments

Comments
 (0)