Skip to content
Snippets Groups Projects
Event.cu 679 B
Newer Older
  • Learn to ignore specific revisions
  • #include <iostream>
    
    #include "Event.h"
    
    using namespace std;
    
    
    数学の武士's avatar
    数学の武士 committed
    #ifdef INCLUDE_GPU_TIMER
        void EventData::InitEventsCUDA()
        {
            cudaEventCreate(&(this->gpu_start));
            cudaEventCreate(&(this->gpu_end));
    
    数学の武士's avatar
    数学の武士 committed
            this->ifCUDAinit = true;
        }
    
    数学の武士's avatar
    数学の武士 committed
        void EventData::DeinitEventsCUDA()
    
    数学の武士's avatar
    数学の武士 committed
            if((this->ifCUDAinit))
            {
                // cudaError_t stat =  cudaEventDestroy(this->gpu_start);
                // cout << "gpu_star: " << cudaGetErrorString(stat) << endl;
    
    数学の武士's avatar
    数学の武士 committed
                // stat =  cudaEventDestroy(this->gpu_end);
                // cout << "gpu_end: " << cudaGetErrorString(stat) << endl;
    
    数学の武士's avatar
    数学の武士 committed
                this->ifCUDAinit = false;
            }
    
    数学の武士's avatar
    数学の武士 committed
    #endif