StatMech
Loading...
Searching...
No Matches
SparseCompressedOnGPU_test.cu File Reference

Functions

template<typename Real_t >
__global__ void copyBasis_kernel (SparseCompressed< Complex_t< Real_t > > *matPtr, TransSector< Real_t > *transSectorPtr)
 
template<typename Real_t >
__global__ void adjointBasis_kernel (SparseCompressed< Complex_t< Real_t > > *matPtr, TransSector< Real_t > *transSectorPtr)
 
int main ()
 

Function Documentation

◆ adjointBasis_kernel()

template<typename Real_t >
__global__ void adjointBasis_kernel ( SparseCompressed< Complex_t< Real_t > > *  matPtr,
TransSector< Real_t > *  transSectorPtr 
)
13 {
14 (*matPtr) = (*transSectorPtr).basis().adjoint();
15}

◆ copyBasis_kernel()

template<typename Real_t >
__global__ void copyBasis_kernel ( SparseCompressed< Complex_t< Real_t > > *  matPtr,
TransSector< Real_t > *  transSectorPtr 
)
7 {
8 (*matPtr) = (*transSectorPtr).basis();
9}

◆ main()

int main ( void  )
17 {
18 int dimLoc = 2, L = 4, k = 0;
19 TransSector<double> tSectorCPU(k, L, dimLoc);
20 std::cout << tSectorCPU.basis() << std::endl;
21 ObjectOnGPU< TransSector<float> > tSector(tSectorCPU);
22
24 mat.set(tSectorCPU.basis());
25 // copyBasis_kernel<<<1, 1>>>(mat.ptr(), tSector.ptr());
26 // cuCHECK(cudaPeekAtLastError());
27 // cuCHECK(cudaDeviceSynchronize());
28 std::cout << mat << std::endl;
29
30 mat = ObjectOnGPU< SparseCompressed<Complex_t<float>> >(tSectorCPU.basis().adjoint());
31 // ObjectOnGPU< SparseCompressed<Complex_t<float>> > mat2;
32 std::cout << mat << std::endl;
33
34 // mat.set(tSectorCPU.basis().adjoint());
35 // std::cout << mat << std::endl;
36
37 // adjointBasis_kernel<<<1, 1>>>(mat.ptr(), tSector.ptr());
38 // cuCHECK(cudaPeekAtLastError());
39 // cuCHECK(cudaDeviceSynchronize());
40 // std::cout << mat << std::endl;
41
42 return EXIT_SUCCESS;
43}
Definition ObjectOnGPU.cuh:149
Translation invariant sector of a many-body Hilbert space.
Definition TransSector.hpp:19