Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
jakurzak committed Oct 16, 2023
1 parent 9e12b68 commit d254543
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
3 changes: 2 additions & 1 deletion lib/statespace_cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class StateSpaceCUDA :
}

void SetAllZeros(State& state) const {
ErrorCheck(cudaMemset(state.get(), 0, MinSize(state.num_qubits()) * sizeof(fp_type)));
ErrorCheck(cudaMemset(state.get(), 0,
MinSize(state.num_qubits()) * sizeof(fp_type)));
}

// Uniform superposition.
Expand Down
22 changes: 12 additions & 10 deletions lib/vectorspace_cuda.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@ class VectorSpaceCUDA {
}

ErrorCheck(
cudaMemcpy(dest.get(), src.get(),
sizeof(fp_type) * Impl::MinSize(src.num_qubits()),
cudaMemcpyDeviceToDevice));
cudaMemcpy(dest.get(), src.get(),
sizeof(fp_type) * Impl::MinSize(src.num_qubits()),
cudaMemcpyDeviceToDevice));

return true;
}
Expand All @@ -131,9 +131,9 @@ class VectorSpaceCUDA {
// Impl::MinSize(src.num_qubits()) elements.
bool Copy(const Vector& src, fp_type* dest) const {
ErrorCheck(
cudaMemcpy(dest, src.get(),
sizeof(fp_type) * Impl::MinSize(src.num_qubits()),
cudaMemcpyDeviceToHost));
cudaMemcpy(dest, src.get(),
sizeof(fp_type) * Impl::MinSize(src.num_qubits()),
cudaMemcpyDeviceToHost));

return true;
}
Expand All @@ -142,9 +142,9 @@ class VectorSpaceCUDA {
// Impl::MinSize(dest.num_qubits()) elements.
bool Copy(const fp_type* src, Vector& dest) const {
ErrorCheck(
cudaMemcpy(dest.get(), src,
sizeof(fp_type) * Impl::MinSize(dest.num_qubits()),
cudaMemcpyHostToDevice));
cudaMemcpy(dest.get(), src,
sizeof(fp_type) * Impl::MinSize(dest.num_qubits()),
cudaMemcpyHostToDevice));

return true;
}
Expand All @@ -154,7 +154,9 @@ class VectorSpaceCUDA {
bool Copy(const fp_type* src, uint64_t size, Vector& dest) const {
size = std::min(size, Impl::MinSize(dest.num_qubits()));
ErrorCheck(
cudaMemcpy(dest.get(), src, sizeof(fp_type) * size, cudaMemcpyHostToDevice));
cudaMemcpy(dest.get(), src,
sizeof(fp_type) * size,
cudaMemcpyHostToDevice));
return true;
}

Expand Down

0 comments on commit d254543

Please sign in to comment.