__double2loint,__hiloint2double 分别实现什么功能?
还有以下代码(SDK中的代码):
#define BEGIN_TIMING( ) \
{\
unsigned int n_iterations; \
for( n_iterations = 1; n_iterations < 0x80000000; n_iterations *= 2 )\
{\
Q( cudaThreadSynchronize( ) );\
Q( cudaEventRecord( start, 0 ) );\
for( unsigned int iteration = 0; iteration < n_iterations; iteration++ ){
#define END_TIMING( seconds ) }\
Q( cudaEventRecord( end, 0 ) );\
Q( cudaEventSynchronize( end ) );\
float milliseconds;\
Q( cudaEventElapsedTime( &milliseconds, start, end ) );\
seconds = milliseconds/1e3f;\
if( seconds >= TIMER_TOLERANCE )\
break;\
}\
seconds /= n_iterations;\
}
#define Q( condition ) {if( (condition) != 0 ) { printf( "\n FAILURE in %s, line %d\n", __FILE__, __LINE__ );exit( 1 );}}
每一行后面为什么都打一斜杠,是不是写错了
|