Update: Enable kernel profiling and execution simultaneously on multiple devices - part1,fix1
@@ -77,7 +77,10 @@ public class KernelProfile {
KernelDeviceProfile currentDeviceProfile = deviceProfiles.get(device);
if (currentDeviceProfile == null) {
currentDeviceProfile = new KernelDeviceProfile(this, kernelClass, device);
- deviceProfiles.put(device, currentDeviceProfile);
+ KernelDeviceProfile existingProfile = deviceProfiles.putIfAbsent(device, currentDeviceProfile);
+ if (existingProfile != null) {
+ currentDeviceProfile = existingProfile;
+ }
}
currentDeviceProfile.onEvent(ProfilingEvent.START);
