StatMech
Loading...
Searching...
No Matches
OperatorSpaceBase_GPUtest_kernel.cuh File Reference

Functions

template<class Derived >
__global__ void testOperatorSpaceBase_kernel (OperatorSpaceBase< Derived > *dPtr)
 

Function Documentation

◆ testOperatorSpaceBase_kernel()

template<class Derived >
__global__ void testOperatorSpaceBase_kernel ( OperatorSpaceBase< Derived > *  dPtr)
5 {
6 OperatorSpaceBase<Derived>& opSpace = *dPtr;
7 debug_printf("%s:\n\t opSpace.dim()=%d\n", __PRETTY_FUNCTION__, opSpace.dim());
8
9 int* outCount = new int[opSpace.baseSpace().dim()];
10 for(int state = 0; state != opSpace.baseSpace().dim(); ++state) outCount[state] = 0;
11 for(int op = 0; op != opSpace.dim(); ++op) {
12 for(int state = 0; state != opSpace.baseSpace().dim(); ++state) {
13 auto [out, coeff] = opSpace.action(op, state);
14 outCount[out] = 1;
15 debug_printf("\t op(%d): %d -> %d, coeff=%f%+f\n", op, state, out, coeff.real(),
16 coeff.imag());
17 }
18 printf("\n");
19 }
20 for(int state = 0; state != opSpace.baseSpace().dim(); ++state) {
21 if(outCount[state] != 1) {
22 printf("Error: outCount[%d] = %d (!= 1)\n", state, outCount[state]);
23 assert(outCount[state] == 1);
24 }
25 }
26 delete[] outCount;
27}
Definition OperatorSpace.hpp:12
__host__ __device__ int dim() const
Definition OperatorSpace.hpp:75
__host__ __device__ void action(int &resBasisNum, Complex_t< RealType > &coeff, int opNum, int basisNum) const
Definition OperatorSpace.hpp:83
__host__ __device__ BaseSpace const & baseSpace() const
Definition OperatorSpace.hpp:79