def __init__(self, blocking_method='non_block'):
if not cuda.available:
raise RuntimeError('CUDA must be available to use GPUTimer.')
if not (blocking_method == 'non_block' or
blocking_method == 'block_first_time' or
blocking_method == 'block_every_time'):
raise ValueError(
'Invalid blocking method:{}'.format(blocking_method))
self.blocking_method = blocking_method
self.reset()
评论列表
文章目录