Skip to content

Commit

Permalink
Debug CUDA
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Nov 2, 2024
1 parent 7490f96 commit 8a7fdea
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/common/qengine.cu
Original file line number Diff line number Diff line change
Expand Up @@ -698,15 +698,15 @@ __global__ void decomposeprob(qCudaCmplx* stateVec, bitCapIntOcl* bitCapIntOclPt
remainderStateAngle[k] += qCudaArg(amp) * (qCudaReal1)nrm;
}

if (partProb > REAL1_EPSILON) {
if (partProb > REAL1_EPSILON_CUDA) {
partStateAngle[lcv] /= partProb;
}
partStateProb[lcv] = partProb;
}

for (bitCapIntOcl lcv = ID; lcv < remainderPower; lcv += Nthreads) {
const real1 prob = remainderStateProb[lcv];
if (prob > REAL1_EPSILON) {
if (prob > REAL1_EPSILON_CUDA) {
remainderStateAngle[lcv] /= prob;
}
}
Expand Down Expand Up @@ -766,6 +766,13 @@ __global__ void disposeprob(qCudaCmplx* stateVec, bitCapIntOcl* bitCapIntOclPtr,
remainderStateAngle[k] += qCudaArg(amp) * (qCudaReal1)nrm;
}
}

for (bitCapIntOcl lcv = ID; lcv < remainderPower; lcv += Nthreads) {
const real1 prob = remainderStateProb[lcv];
if (prob > REAL1_EPSILON_CUDA) {
remainderStateAngle[lcv] /= prob;
}
}
}

__global__ void dispose(qCudaCmplx* stateVec, bitCapIntOcl* bitCapIntOclPtr, qCudaCmplx* nStateVec)
Expand Down

0 comments on commit 8a7fdea

Please sign in to comment.