| 24 | using xla::StatusOr; |
| 25 | |
| 26 | void DeviceSet::Insert(DeviceId device_id) { |
| 27 | int word_index = device_id.id() / kWordSize; |
| 28 | int bit_index = device_id.id() % kWordSize; |
| 29 | |
| 30 | if (word_index >= storage_.size()) { |
| 31 | storage_.resize(word_index + 1, 0); |
| 32 | } |
| 33 | |
| 34 | storage_[word_index] |= (1ull << bit_index); |
| 35 | } |
| 36 | |
| 37 | void DeviceSet::UnionWith(const DeviceSet& other) { |
| 38 | if (other.storage_.size() > storage_.size()) { |