MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / DecodeStreamIdFromInt64

Function DecodeStreamIdFromInt64

oneflow/core/graph/stream_id.cpp:56–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56StreamId 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

Callers 5

GenLightPlanMethod · 0.85
GetStreamIdMethod · 0.85
AddThreadsMethod · 0.85
MemZoneId121Method · 0.85
UpdateTaskIdMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected