MPQC  3.0.0-alpha
dgemminfo.h
1 
2 /*
3  * Copyright 2009 Sandia Corporation. Under the terms of Contract
4  * DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government
5  * retains certain rights in this software.
6  *
7  * This file is a part of the MPQC LMP2 library.
8  *
9  * The MPQC LMP2 library is free software: you can redistribute it
10  * and/or modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation, either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful, but
15  * WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with this program. If not, see
21  * <http://www.gnu.org/licenses/>.
22  *
23  */
24 
25 #ifndef _chemistry_qc_lmp2_dgemminfo_h
26 #define _chemistry_qc_lmp2_dgemminfo_h
27 
28 #ifndef USE_MICROTIME
29 #include <sys/time.h>
30 #include <time.h>
31 #endif
32 
33 namespace sc {
34 
35 #ifdef USE_MICROTIME
36 
37  static inline void microtime(unsigned *lo, unsigned *hi) {
38  __asm __volatile (
39  ".byte 0x0f; .byte 0x31; movl %%edx,%0; movl %%eax,%1"
40  : "=g" (*hi), "=g" (*lo) :: "eax", "edx");
41  }
42 
43  static inline double cpu_walltime(void) {
44  unsigned lo, hi;
45  microtime(&lo, &hi);
46  unsigned long long ticks = lo + (((unsigned long long)hi)<<32);
47  double secs = ticks*(1.0/(1496.612*1.0e6));
48  return secs;
49  }
50 
51 #else
52 
54  static inline double cpu_walltime(void) {
55  struct timeval tod;
56  gettimeofday(&tod,0);
57  return tod.tv_sec + 0.000001 * tod.tv_usec;
58  }
59 
60 #endif
61 
63  extern void count_dgemm(int n, int l, int m, double t);
64 
65 }
66 
67 #endif
sc::count_dgemm
void count_dgemm(int n, int l, int m, double t)
Records information about the time take to perform a DGEMM operation.
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14

Generated at Sun Jan 26 2020 23:23:58 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.