| 46 | } // namespace |
| 47 | |
| 48 | int64_t EncodeStreamIdToInt64(const StreamId& stream_id) { |
| 49 | int64_t id = static_cast<int64_t>(stream_id.stream_index()); |
| 50 | id |= static_cast<int64_t>(stream_id.device_index()) << kDeviceIndexShift; |
| 51 | id |= static_cast<int64_t>(stream_id.device_type()) << kDeviceTypeShift; |
| 52 | id |= static_cast<int64_t>(stream_id.rank()) << kRankShift; |
| 53 | return id; |
| 54 | } |
| 55 | |
| 56 | StreamId DecodeStreamIdFromInt64(int64_t stream_id_val) { |
| 57 | int64_t rank = (stream_id_val & kRankInt64Mask) >> kRankShift; |
no test coverage detected