Skip to content

Commit

Permalink
simple timer for tril_map
Browse files Browse the repository at this point in the history
  • Loading branch information
cjknight committed Mar 28, 2024
1 parent 9de2a12 commit 2a974bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gpu/src/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "device.h"

#define _NUM_TIMER_JK 12
#define _NUM_TIMER_JK 13

/* ---------------------------------------------------------------------- */

Expand Down
12 changes: 9 additions & 3 deletions gpu/src/device_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ void Device::init_get_jk(py::array_t<double> _eri1, py::array_t<double> _dmtril,
if(d_eri1) pm->dev_free(d_eri1);
d_eri1 = (double *) pm->dev_malloc(size_eri1 * sizeof(double));
}

#ifdef _SIMPLE_TIMER
double t1 = omp_get_wtime();
#endif

int _size_tril_map = nao * nao;
// if(_size_tril_map > size_tril_map) {
Expand All @@ -154,8 +158,10 @@ void Device::init_get_jk(py::array_t<double> _eri1, py::array_t<double> _dmtril,
}

#ifdef _SIMPLE_TIMER
double t1 = omp_get_wtime();
t_array_jk[0] += t1 - t0;
double t2 = omp_get_wtime();
t_array_jk[0] += t2 - t0;

t_array_jk[12] += t2 - t1;
#endif

// Create cuda stream
Expand Down Expand Up @@ -746,7 +752,7 @@ void Device::get_jk(int naux,
#endif

// printf(" -- calling dev_stream_wait()\n");
pm->dev_stream_wait(stream);
// pm->dev_stream_wait(stream);

#ifdef _CUDA_NVTX
nvtxRangePop();
Expand Down

0 comments on commit 2a974bc

Please sign in to comment.