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

Function EncodeDeviceIdToInt64

oneflow/core/device/device_id.cpp:31–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

29} // namespace
30
31int64_t EncodeDeviceIdToInt64(const DeviceId& device_id) {
32 int64_t id = static_cast<int64_t>(device_id.device_index());
33 id |= static_cast<int64_t>(device_id.device_type()) << kDeviceTypeShift;
34 id |= static_cast<int64_t>(device_id.rank()) << kRankShift;
35 return id;
36}
37
38} // namespace oneflow

Callers 3

GetGeneratorMethod · 0.85
GetTaskStreamIndexMethod · 0.85

Calls 3

device_indexMethod · 0.45
device_typeMethod · 0.45
rankMethod · 0.45

Tested by

no test coverage detected