Skip to content

Commit

Permalink
Fix API warning for older SDKs #2 (pytorch#5365)
Browse files Browse the repository at this point in the history
Summary:
Fix remaining warnings when building MPS delegate with older iOS SDKs

cc shoumikhin, cccclai

Pull Request resolved: pytorch#5365

Reviewed By: kirklandsign

Differential Revision: D62668033

Pulled By: shoumikhin

fbshipit-source-id: efcb8449b1f38259914c76337e12dc38487bf36b
  • Loading branch information
DenisVieriu97 authored and facebook-github-bot committed Sep 13, 2024
1 parent 9b5ba1f commit 3450ecc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions backends/apple/mps/runtime/operations/OperationUtils.mm
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,13 @@
return MPSDataTypeFloat32;
case DataType::mps_data_type_int8:
return MPSDataTypeInt8;
case DataType::mps_data_type_int4:
return MPSDataTypeInt4;
case DataType::mps_data_type_int4: {
if (@available(macOS 15.0, iOS 18.0, tvOS 18.0, *)) {
return MPSDataTypeInt4;
} else {
return ((MPSDataType)(MPSDataTypeSignedBit | 4));
}
}
case DataType::mps_data_type_int16:
return MPSDataTypeInt16;
case DataType::mps_data_type_int32:
Expand Down

0 comments on commit 3450ecc

Please sign in to comment.