Skip to content
Snippets Groups Projects
Jikan.cpp 691 B
Newer Older
  • Learn to ignore specific revisions
  • #include "JikanDepths.h"
    
    数学の武士's avatar
    数学の武士 committed
    #include "Jikan.h"
    
    
    #include <omp.h>
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
    using namespace std;
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
    extern "C"
    
    数学の武士's avatar
    数学の武士 committed
    {
    
    数学の武士's avatar
    数学の武士 committed
        extern class Jikan Timer;
    
    数学の武士's avatar
    数学の武士 committed
    
    
        void TimerStart(const char* name, const int& mode)
    
    数学の武士's avatar
    数学の武士 committed
        {
    
    数学の武士's avatar
    数学の武士 committed
            string str_name = name;
    
    数学の武士's avatar
    数学の武士 committed
    
    
            Timer.JikanStart(str_name, mode);
    
    数学の武士's avatar
    数学の武士 committed
        }
    
    数学の武士's avatar
    数学の武士 committed
    
        void TimerEnd(const char* name)
    
    数学の武士's avatar
    数学の武士 committed
        {
    
    数学の武士's avatar
    数学の武士 committed
            string str_name = name;
    
    数学の武士's avatar
    数学の武士 committed
    
    
            Timer.JikanEnd(str_name);
    
    数学の武士's avatar
    数学の武士 committed
    
    
    数学の武士's avatar
    数学の武士 committed
        void WriteOutput()
    
    数学の武士's avatar
    数学の武士 committed
            #ifdef INCLUDE_OPEN_MP
    
    数学の武士's avatar
    数学の武士 committed
            #pragma omp master
            {
    
    数学の武士's avatar
    数学の武士 committed
            #endif
    
                bool ifWrite = Timer.ifWriteProc();
                if(ifWrite == true)
                    Timer.GenerateOutputData();
    
    数学の武士's avatar
    数学の武士 committed
            #ifdef INCLUDE_OPEN_MP
    
    数学の武士's avatar
    数学の武士 committed
            #endif
    
    数学の武士's avatar
    数学の武士 committed
    }