Loading src/dmrg_vbatch.h +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ #include <stdlib.h> #include <stdio.h> #include <assert.h> #include <string.h> #include "dmrg_types.h" Loading src/test_vbatch.c +67 −11 Original line number Diff line number Diff line Loading @@ -224,6 +224,8 @@ int main(int argc, char *argv[]) IntegerType *left_patch_start_ = NULL; IntegerType *right_patch_start_ = NULL; IntegerType *xy_patch_start_ = NULL; IntegerType *nC_ = NULL; int ld_Abatch = 0; int ld_Bbatch = 0; #define xy_patch_start(i) xy_patch_start_[(i)-1] Loading @@ -246,6 +248,27 @@ int main(int argc, char *argv[]) assert( Bmatrix != NULL ); assert( ld_Bmatrix != NULL ); const int use_sparse = (1 == 1); if (use_sparse) { setup_sparse_batch( noperator, npatches, &(left_patch_size_[0]), &(right_patch_size_[0]), Amatrix, ld_Amatrix, Bmatrix, ld_Bmatrix &left_patch_start_, &right_patch_start_, &xy_patch_start_, &nC_, &Abatch_, &ld_Abatch, &Bbatch_, &ld_Bbatch ); } else { setup_vbatch( noperator, npatches, &(left_patch_size_[0]), Loading @@ -257,6 +280,7 @@ int main(int argc, char *argv[]) &Abatch_, &ld_Abatch, &Bbatch_, &ld_Bbatch, Amatrix, ld_Amatrix, Bmatrix, ld_Bmatrix ); }; #define Abatch(i,j) Abatch_[indx2f(i,j,ld_Abatch)] #define Bbatch(i,j) Bbatch_[indx2f(i,j,ld_Bbatch)] Loading Loading @@ -307,9 +331,20 @@ int main(int argc, char *argv[]) const int ntimes = 3; for(itimes=1; itimes <= ntimes; itimes++) { if (use_sparse) { apply_Htarget_sparse( noperator, npatches, left_patch_start_, right_patch_start_, xy_patch_start_, nC_, Abatch_, ld_Abatch, Bbatch_, ld_Bbatch, X_, Y_ ); } else { apply_Htarget_vbatch( noperator,npatches, left_patch_start_, right_patch_start_, xy_patch_start_, Abatch_, ld_Abatch, Bbatch_, ld_Bbatch, X_, Y_ ); }; }; } Loading Loading @@ -347,6 +382,27 @@ int main(int argc, char *argv[]) }; if (use_sparse) { unsetup_sparse_batch( &left_patch_start_, &right_patch_start_, &xy_patch_start_, &nC_, &Abatch_, &Bbatch_ ); } else { unsetup_vbatch( &left_patch_start_, &right_patch_start_, &xy_patch_start_, &Abatch_, &Bbatch_ ); }; #ifdef USE_MAGMA magma_finalize(); Loading src/test_vbatch.h +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #include "dmrg_vbatch.h" #include "setup_vbatch.h" #include "setup_sparse_batch.h" #include "setup_matrix.h" Loading Loading
src/dmrg_vbatch.h +1 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ #include <stdlib.h> #include <stdio.h> #include <assert.h> #include <string.h> #include "dmrg_types.h" Loading
src/test_vbatch.c +67 −11 Original line number Diff line number Diff line Loading @@ -224,6 +224,8 @@ int main(int argc, char *argv[]) IntegerType *left_patch_start_ = NULL; IntegerType *right_patch_start_ = NULL; IntegerType *xy_patch_start_ = NULL; IntegerType *nC_ = NULL; int ld_Abatch = 0; int ld_Bbatch = 0; #define xy_patch_start(i) xy_patch_start_[(i)-1] Loading @@ -246,6 +248,27 @@ int main(int argc, char *argv[]) assert( Bmatrix != NULL ); assert( ld_Bmatrix != NULL ); const int use_sparse = (1 == 1); if (use_sparse) { setup_sparse_batch( noperator, npatches, &(left_patch_size_[0]), &(right_patch_size_[0]), Amatrix, ld_Amatrix, Bmatrix, ld_Bmatrix &left_patch_start_, &right_patch_start_, &xy_patch_start_, &nC_, &Abatch_, &ld_Abatch, &Bbatch_, &ld_Bbatch ); } else { setup_vbatch( noperator, npatches, &(left_patch_size_[0]), Loading @@ -257,6 +280,7 @@ int main(int argc, char *argv[]) &Abatch_, &ld_Abatch, &Bbatch_, &ld_Bbatch, Amatrix, ld_Amatrix, Bmatrix, ld_Bmatrix ); }; #define Abatch(i,j) Abatch_[indx2f(i,j,ld_Abatch)] #define Bbatch(i,j) Bbatch_[indx2f(i,j,ld_Bbatch)] Loading Loading @@ -307,9 +331,20 @@ int main(int argc, char *argv[]) const int ntimes = 3; for(itimes=1; itimes <= ntimes; itimes++) { if (use_sparse) { apply_Htarget_sparse( noperator, npatches, left_patch_start_, right_patch_start_, xy_patch_start_, nC_, Abatch_, ld_Abatch, Bbatch_, ld_Bbatch, X_, Y_ ); } else { apply_Htarget_vbatch( noperator,npatches, left_patch_start_, right_patch_start_, xy_patch_start_, Abatch_, ld_Abatch, Bbatch_, ld_Bbatch, X_, Y_ ); }; }; } Loading Loading @@ -347,6 +382,27 @@ int main(int argc, char *argv[]) }; if (use_sparse) { unsetup_sparse_batch( &left_patch_start_, &right_patch_start_, &xy_patch_start_, &nC_, &Abatch_, &Bbatch_ ); } else { unsetup_vbatch( &left_patch_start_, &right_patch_start_, &xy_patch_start_, &Abatch_, &Bbatch_ ); }; #ifdef USE_MAGMA magma_finalize(); Loading
src/test_vbatch.h +1 −0 Original line number Diff line number Diff line Loading @@ -9,6 +9,7 @@ #include "dmrg_vbatch.h" #include "setup_vbatch.h" #include "setup_sparse_batch.h" #include "setup_matrix.h" Loading