static char help[] = "Benchmarking cudaPointerGetAttributes() time\n"; /* Running example on Summit at OLCF: # run with total 1 resource set (RS) (-n1), 1 RS per node (-r1), 1 MPI rank (-a1), 7 cores (-c7) and 1 GPU (-g1) per RS $ jsrun -n1 -a1 -c7 -g1 -r1 ./ex2cu Average cudaPointerGetAttributes() time = 0.29 microseconds */ #include #include int main(int argc,char **argv) { PetscErrorCode ierr; PetscInt i,n=2000; cudaError_t cerr; PetscScalar **ptrs; PetscLogDouble tstart,tend,time; struct cudaPointerAttributes attr; ierr = PetscInitialize(&argc,&argv,(char*)0,help);if (ierr) return ierr; ierr = PetscOptionsGetInt(NULL,NULL,"-n",&n,NULL);CHKERRQ(ierr); ierr = PetscMalloc1(n,&ptrs);CHKERRQ(ierr); for (i=0; i