Skip to content

Commit 3450ecc

Browse files
DenisVieriu97facebook-github-bot
authored andcommitted
Fix API warning for older SDKs #2 (#5365)
Summary: Fix remaining warnings when building MPS delegate with older iOS SDKs cc shoumikhin, cccclai Pull Request resolved: #5365 Reviewed By: kirklandsign Differential Revision: D62668033 Pulled By: shoumikhin fbshipit-source-id: efcb8449b1f38259914c76337e12dc38487bf36b
1 parent 9b5ba1f commit 3450ecc

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

backends/apple/mps/runtime/operations/OperationUtils.mm

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@
3131
return MPSDataTypeFloat32;
3232
case DataType::mps_data_type_int8:
3333
return MPSDataTypeInt8;
34-
case DataType::mps_data_type_int4:
35-
return MPSDataTypeInt4;
34+
case DataType::mps_data_type_int4: {
35+
if (@available(macOS 15.0, iOS 18.0, tvOS 18.0, *)) {
36+
return MPSDataTypeInt4;
37+
} else {
38+
return ((MPSDataType)(MPSDataTypeSignedBit | 4));
39+
}
40+
}
3641
case DataType::mps_data_type_int16:
3742
return MPSDataTypeInt16;
3843
case DataType::mps_data_type_int32:

0 commit comments

Comments
 (0)