TornadoVM
TornadoVM copied to clipboard
Redundant code in TaskMetaData.addProfile
TaskMetaData has the following code where profiles
map is used twice to get same value:
public void addProfile(int id) {
final TornadoAcceleratorDevice device = getLogicDevice();
BitSet events;
profiles.computeIfAbsent(device, k -> new BitSet(EVENT_WINDOW));
events = profiles.get(device);
events.set(id);
}
The simpler version is:
public void addProfile(int id) {
BitSet events = profiles.computeIfAbsent(getLogicDevice(), k -> new BitSet(EVENT_WINDOW));
events.set(id);
}