void onEvent ( Device device , ProfilingEvent event ) { if ( event == null ) { logger . log ( Level . WARNING , "Discarding profiling event " + event + " for null device, for Kernel class: " + kernelClass . getName ( ) ) ; return ; } final KernelDeviceProfile deviceProfile = deviceProfiles . get ( device ) ; switch ( event ) { case CLASS_MODEL_BUILT : // fallthrough case OPENCL_GENERATED : // fallthrough case INIT_JNI : // fallthrough case OPENCL_COMPILED : // fallthrough case PREPARE_EXECUTE : // fallthrough case EXECUTED : // fallthrough { if ( deviceProfile == null ) { logger . log ( Level . SEVERE , "Error in KernelProfile, no currentDevice (synchronization error?" ) ; } deviceProfile . onEvent ( event ) ; break ; } case START : throw new IllegalArgumentException ( "must use onStart(Device) to start profiling" ) ; default : throw new IllegalArgumentException ( "Unhandled event " + event ) ; } }
Updates the profiling information for the current thread invoking this method regarding the specified execution device .