| 54 | } |
| 55 | |
| 56 | StreamId DecodeStreamIdFromInt64(int64_t stream_id_val) { |
| 57 | int64_t rank = (stream_id_val & kRankInt64Mask) >> kRankShift; |
| 58 | int64_t device_type = (stream_id_val & kDeviceTypeInt64Mask) >> kDeviceTypeShift; |
| 59 | int64_t device_index = (stream_id_val & kDeviceIndexInt64Mask) >> kDeviceIndexShift; |
| 60 | int64_t stream_index = (stream_id_val & kStreamIndexInt64Mask); |
| 61 | return StreamId{static_cast<DeviceId::rank_t>(rank), static_cast<DeviceType>(device_type), |
| 62 | static_cast<DeviceId::device_index_t>(device_index), |
| 63 | static_cast<StreamId::stream_index_t>(stream_index)}; |
| 64 | } |
| 65 | |
| 66 | } // namespace oneflow |
no outgoing calls
no test coverage detected