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

Function EncodeStreamIdToInt64

oneflow/core/graph/stream_id.cpp:48–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46} // namespace
47
48int64_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
56StreamId DecodeStreamIdFromInt64(int64_t stream_id_val) {
57 int64_t rank = (stream_id_val & kRankInt64Mask) >> kRankShift;

Callers 13

DumpThreadIdsFromPlanMethod · 0.85
ThreadMethod · 0.85
InitMethod · 0.85
ThrdId4ActorIdFunction · 0.85
GetTaskIndexMethod · 0.85
TryUpdateTaskIndexMethod · 0.85
GenerateMethod · 0.85
GenCompTaskNodeFunction · 0.85
CclInitCollectiveNodeFunction · 0.85
FOR_RANGEFunction · 0.85
FOR_RANGEMethod · 0.85
FOR_RANGEFunction · 0.85

Calls 4

stream_indexMethod · 0.80
device_indexMethod · 0.45
device_typeMethod · 0.45
rankMethod · 0.45

Tested by

no test coverage detected