src/serializer/logger.cpp
/* Keeps a random [num/denom] memory points to schedule at */
Keeps a random [num/denom] memory points to schedule at
Keeps a random [ num / denom ] memory points to schedule at
void Logger::sparsifyMemorySchedulingPoints(int num, int denom) {
    if (num == denom) {
        return;
    }
    set<void *>::iterator itr;
    itr = addressToSchedule.begin();
    while (itr != addressToSchedule.end()) {
        bool keepElement = false;
        int i = 0;
        while (!keepElement && i < num) {
            keepElement = (getRandomNumber() % denom) ? false : true;
            i += 1;
        }
        if (!keepElement) {
            addressToSchedule.erase(itr++);
        } else {
            ++itr; 
        }
    }
}
void Logger :: sparsifyMemorySchedulingPoints ( int num , int denom ) { if ( num == denom ) { return ; } set < void * > :: iterator itr ; itr = addressToSchedule . begin ( ) ; while ( itr != addressToSchedule . end ( ) ) { bool keepElement = false ; int i = 0 ; while ( ! keepElement && i < num ) { keepElement = ( getRandomNumber ( ) % denom ) ? false : true ; i += 1 ; } if ( ! keepElement ) { addressToSchedule . erase ( itr ++ ) ; } else { ++ itr ; } } }
Keeps a random [num/denom] memory points to schedule at
Keeps a random [ num / denom ] memory points to schedule at