void Timer::Init() { if (!initted()) { if (Caffe::mode() == Caffe::GPU) { CUDA_CHECK(cudaEventCreate(&start_gpu_)); CUDA_CHECK(cudaEventCreate(&stop_gpu_)); } initted_ = true; } }
void Timer::Init() { if (!initted()) { if (Caffe::mode() == Caffe::GPU) { #ifndef CPU_ONLY CUDA_CHECK(cudaEventCreate(&start_gpu_)); CUDA_CHECK(cudaEventCreate(&stop_gpu_)); #else NO_GPU; #endif } initted_ = true; } }
void Timer::Init() { if (!initted()) { if (Caffe::mode() == Caffe::GPU && Caffe::GetDefaultDevice()->backend() == BACKEND_CUDA) { #ifndef CPU_ONLY #ifdef USE_CUDA CUDA_CHECK(cudaEventCreate(&start_gpu_)); CUDA_CHECK(cudaEventCreate(&stop_gpu_)); #endif // USE_CUDA #else NO_GPU; #endif } initted_ = true; } }