From a136c80d978841d317a6ad3930b9e608fdba1586 Mon Sep 17 00:00:00 2001 From: hachem Date: Sun, 20 Sep 2026 18:37:48 +0200 Subject: feat: add pthread parallel execution --- include/core/kernel.h | 1 + include/parallel.h | 6 ++++++ include/psi.h | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 include/parallel.h (limited to 'include') diff --git a/include/core/kernel.h b/include/core/kernel.h index f3a2b77..58a3c6a 100644 --- a/include/core/kernel.h +++ b/include/core/kernel.h @@ -46,6 +46,7 @@ void psi_add_kernel(struct PsiKernelBatch* batch, struct PsiKernel kernel); void psi_optimize_kernel_batch(struct PsiKernelBatch* batch); void psi_execute_kernel_batch(struct PsiKernelBatch batch, struct PsiVector* state); void psi_apply_kernel(struct PsiVector* state, struct PsiKernel kernel, size_t num_qubits); +void psi_apply_kernel_parallel(struct PsiVector* state, struct PsiKernel kernel, size_t num_qubits); struct PsiExecutionLayer { diff --git a/include/parallel.h b/include/parallel.h new file mode 100644 index 0000000..a8b65a7 --- /dev/null +++ b/include/parallel.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +size_t psi_thread_count(void); +void psi_parallel_for(size_t count, void (*body)(size_t start, size_t end, void* ctx), void* ctx); diff --git a/include/psi.h b/include/psi.h index afd7d89..3b3a83b 100644 --- a/include/psi.h +++ b/include/psi.h @@ -6,6 +6,8 @@ const char* psi_version(void); +#include "parallel.h" + #include "maths/complex.h" #include "maths/vector.h" #include "maths/matrix.h" -- cgit v1.3