From 1a632f8b5680758f6a3d1b8242342817be5d2733 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Olav=20M=C3=B8yner?= Date: Mon, 20 Oct 2025 15:45:16 +0200 Subject: [PATCH] Add functions for threads --- src/LibHYPRE.jl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/LibHYPRE.jl b/src/LibHYPRE.jl index 106a3ea..4fef1f2 100644 --- a/src/LibHYPRE.jl +++ b/src/LibHYPRE.jl @@ -10,6 +10,15 @@ function HYPRE_Init() return HYPRE_Initialize() end +# Threading utilities if built with OpenMP +function HYPRE_NumThreads() + return @ccall libHYPRE.hypre_NumThreads()::HYPRE_Int +end + +function HYPRE_SetNumThreads(nt::HYPRE_Int) + return @ccall libHYPRE.hypre_SetNumThreads(nt::HYPRE_Int)::Ptr{Cvoid} +end + # Add manual methods for some ::Function signatures where the library wants function # pointers. Instead of creating function pointers to the Julia wrappers we can just look # up the pointer in the library and pass that.