 #include <stdio.h>
 //#include "../shared/util.h"
 #include "device_launch_parameters.h"
-
-template<typename dtype>
-dtype get_zero(){
-  assert(0);
-}
-template<> inline
-double get_zero<double>() { return 0.0; }
-
-template<> inline
-std::complex<double> get_zero< std::complex<double> >() { return std::complex<double>(0.0,0.0); }
-
-
-typedef int64_t long_int;
-#ifndef LIBT_ASSERT
-#ifdef DEBUG
-#define LIBT_ASSERT(...)                \
-do { assert(__VA_ARGS__); } while (0)
-#else
-#define LIBT_ASSERT(...) do {} while(0 && (__VA_ARGS__))
-#endif
-#endif
-
+#include "util.h"
 #include "offload.h"
 
 int initialized = 0;

                  dtype                 beta,
                  offload_ptr<dtype> &  C,
                  int                   lda_C){
  offload_gemm(tA, tB, m, n, k, alpha, A.dev_ptr, lda_A, B.dev_ptr, lda_B, beta, C.dev_ptr, lda_C);
}
template 
void offload_gemm(char                  tA,

 */
template <typename dtype>
void offload_ptr<dtype>::upload(dtype const * host_ptr){
  TAU_FSTART(cuda_upload);
  cudaError_t err = cudaMemcpy(dev_ptr, host_ptr, size*sizeof(dtype),
                               cudaMemcpyHostToDevice);
  TAU_FSTOP(cuda_upload);
  LIBT_ASSERT(err == cudaSuccess);
}

