summaryrefslogtreecommitdiff
path: root/benchmarks/CUDA/WP/microclock.c
diff options
context:
space:
mode:
authorTor Aamodt <[email protected]>2010-07-15 18:09:46 -0800
committerTor Aamodt <[email protected]>2010-07-15 18:09:46 -0800
commit69f2911e04ffb1b19eef1fafb8c040af271f656e (patch)
tree231d3b6bdc3a202f7c255bfcf7bf2c36e32cee9e /benchmarks/CUDA/WP/microclock.c
creating branch for adding support for CUDA 3.x and Fermi
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 6829]
Diffstat (limited to 'benchmarks/CUDA/WP/microclock.c')
-rw-r--r--benchmarks/CUDA/WP/microclock.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/benchmarks/CUDA/WP/microclock.c b/benchmarks/CUDA/WP/microclock.c
new file mode 100644
index 0000000..3cfc9d7
--- /dev/null
+++ b/benchmarks/CUDA/WP/microclock.c
@@ -0,0 +1,33 @@
+#ifndef CRAY
+# ifdef NOUNDERSCORE
+# define RSL_INTERNAL_MICROCLOCK rsl_internal_microclock
+# else
+# ifdef F2CSTYLE
+# define RSL_INTERNAL_MICROCLOCK rsl_internal_microclock__
+# else
+# define RSL_INTERNAL_MICROCLOCK rsl_internal_microclock_
+# endif
+# endif
+#endif
+#include <sys/time.h>
+
+RSL_INTERNAL_MICROCLOCK ()
+{
+ struct timeval tb ;
+ struct timezone tzp ;
+ int isec ; /* seconds */
+ int usec ; /* microseconds */
+ int msecs ;
+ gettimeofday( &tb, &tzp ) ;
+ isec = tb.tv_sec ;
+ usec = tb.tv_usec ;
+ msecs = 1000000 * isec + usec ;
+ return(msecs) ;
+}
+
+c_pow_ ( float * a, float * b )
+{
+ *a = pow( *a , *b ) ;
+}
+
+