本文整理汇总了C++中GlobalAddress::block_min方法的典型用法代码示例。如果您正苦于以下问题:C++ GlobalAddress::block_min方法的具体用法?C++ GlobalAddress::block_min怎么用?C++ GlobalAddress::block_min使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GlobalAddress
的用法示例。
在下文中一共展示了GlobalAddress::block_min方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reset
void reset( ) {
DVLOG(5) << "In " << __PRETTY_FUNCTION__;
CHECK( !acquire_started_ || acquired_ ) << "inconsistent state for reset";
acquire_started_ = false;
acquired_ = false;
thread_ = NULL;
num_messages_ = 0;
response_count_ = 0;
expected_reply_payload_ = sizeof( T ) * *count_;
total_reply_payload_ = 0;
start_time_ = 0;
network_time_ = 0;
if( *count_ == 0 ) {
DVLOG(5) << "Zero-length acquire";
*pointer_ = NULL;
acquire_started_ = true;
acquired_ = true;
} else if( request_address_->is_2D() ) {
num_messages_ = 1;
if( request_address_->core() == Grappa::mycore() ) {
DVLOG(5) << "Short-circuiting to address " << request_address_->pointer();
*pointer_ = request_address_->pointer();
acquire_started_ = true;
acquired_ = true;
}
} else {
DVLOG(5) << "Straddle: block_max is " << (*request_address_ + *count_).block_max() ;
DVLOG(5) << ", request_address is " << *request_address_;
DVLOG(5) << ", sizeof(T) is " << sizeof(T);
DVLOG(5) << ", count is " << *count_;
DVLOG(5) << ", block_min is " << request_address_->block_min();
DVLOG(5) << "Straddle: address is " << *request_address_ ;
DVLOG(5) << ", address + count is " << *request_address_ + *count_;
ptrdiff_t byte_diff = ( (*request_address_ + *count_ - 1).last_byte().block_max() -
request_address_->first_byte().block_min() );
DVLOG(5) << "Straddle: address block max is " << request_address_->block_max();
DVLOG(5) << " address + count block max is " << (*request_address_ + *count_).block_max();
DVLOG(5) << " address block min " << request_address_->block_min();
DVLOG(5) << "Straddle: diff is " << byte_diff << " bs " << block_size;
num_messages_ = byte_diff / block_size;
}
if( num_messages_ > 1 ) DVLOG(5) << "****************************** MULTI BLOCK CACHE REQUEST ******************************";
DVLOG(5) << "In " << __PRETTY_FUNCTION__ << "; detecting straddle for sizeof(T):" << sizeof(T)
<< " count:" << *count_
<< " num_messages_:" << num_messages_
<< " request_address:" << *request_address_;
}
示例2: reset
void reset( ) {
CHECK( !release_started_ || released_ ) << "inconsistent state for reset";
release_started_ = false;
released_ = false;
thread_ = NULL;
num_messages_ = 0;
response_count_ = 0;
if( *count_ == 0 ) {
DVLOG(5) << "Zero-length release";
release_started_ = true;
released_ = true;
} else if( request_address_->is_2D() ) {
num_messages_ = 1;
if( request_address_->core() == Grappa::mycore() ) {
release_started_ = true;
released_ = true;
}
} else {
DVLOG(5) << "Straddle: block_max is " << (*request_address_ + *count_).block_max() ;
DVLOG(5) << ", request_address is " << *request_address_;
DVLOG(5) << ", sizeof(T) is " << sizeof(T);
DVLOG(5) << ", count is " << *count_;
DVLOG(5) << ", block_min is " << request_address_->block_min();
DVLOG(5) << "Straddle: address is " << *request_address_ ;
DVLOG(5) << ", address + count is " << *request_address_ + *count_;
ptrdiff_t byte_diff = ( (*request_address_ + *count_ - 1).last_byte().block_max() -
request_address_->first_byte().block_min() );
DVLOG(5) << "Straddle: address block max is " << request_address_->block_max();
DVLOG(5) << " address + count block max is " << (*request_address_ + *count_).block_max();
DVLOG(5) << " address + count -1 block max is " << (*request_address_ + *count_ - 1).block_max();
DVLOG(5) << " difference is " << ( (*request_address_ + *count_ - 1).block_max() - request_address_->block_min() );
DVLOG(5) << " multiplied difference is " << ( (*request_address_ + *count_ - 1).block_max() - request_address_->block_min() ) * sizeof(T);
DVLOG(5) << " address block min " << request_address_->block_min();
DVLOG(5) << "Straddle: diff is " << byte_diff << " bs " << block_size;
num_messages_ = byte_diff / block_size;
}
if( num_messages_ > 1 ) DVLOG(5) << "****************************** MULTI BLOCK CACHE REQUEST ******************************";
DVLOG(5) << "Detecting straddle for sizeof(T):" << sizeof(T)
<< " count:" << *count_
<< " num_messages_:" << num_messages_
<< " request_address:" << *request_address_;
}