From 9924804fddb03ef195e446e95629f2cf69cb6381 Mon Sep 17 00:00:00 2001 From: Clonkk Date: Fri, 16 Apr 2021 16:21:18 +0200 Subject: [PATCH 1/3] add threads options to docs generation --- fftw3.nimble | 2 +- src/fftw3.nim | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fftw3.nimble b/fftw3.nimble index f69f2ef..df55a27 100644 --- a/fftw3.nimble +++ b/fftw3.nimble @@ -14,7 +14,7 @@ requires "arraymancer >= 0.6.3" requires "weave >= 0.4.9" task gendoc, "gen doc": - exec("nimble doc --project src/fftw3.nim --out:docs/") + exec("nimble doc --threads:on --project src/fftw3.nim --out:docs/") import distros task externalDep, "package": diff --git a/src/fftw3.nim b/src/fftw3.nim index 531e90c..e2f2dbc 100644 --- a/src/fftw3.nim +++ b/src/fftw3.nim @@ -305,6 +305,4 @@ when compileOption("threads"): proc fftw_init_threads*() {.cdecl, importc: "fftw_init_threads", dynlib: Fftw3ThreadLib.} proc fftw_plan_with_nthreads*(nthreads: cint) {.cdecl, importc: "fftw_plan_with_nthreads", dynlib: Fftw3ThreadLib.} proc fftw_cleanup_threads*() {.cdecl, importc: "fftw_cleanup_threads", dynlib: Fftw3ThreadLib.} -# {.passL: "-lfftw3_threads"} -# {.passL: "-lfftw3"} From c764bac3e02821d75d10ec178d32589f084179dc Mon Sep 17 00:00:00 2001 From: Clonkk Date: Fri, 16 Apr 2021 16:25:39 +0200 Subject: [PATCH 2/3] add docstring for additional procs --- src/fftw3.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/fftw3.nim b/src/fftw3.nim index e2f2dbc..7a86f1c 100644 --- a/src/fftw3.nim +++ b/src/fftw3.nim @@ -292,6 +292,9 @@ proc fftw_plan_many_r2r*(rank: cint, n: ptr cint, howmany: cint, flags: cuint): fftw_plan {.cdecl, importc: "fftw_plan_many_r2r", dynlib: Fftw3Lib.} +proc fftw_set_timelimit*(t: cdouble) {.cdecl, importc: "fftw_set_timelimit", dynlib: Fftw3Lib.} + ## Set timelimit to FFT + # FFTW Utility & Cleanup API proc fftw_destroy_plan*(p: fftw_plan) {.cdecl, importc: "fftw_destroy_plan", dynlib: Fftw3Lib.} ## Destroy a plan @@ -299,10 +302,11 @@ proc fftw_destroy_plan*(p: fftw_plan) {.cdecl, importc: "fftw_destroy_plan", dyn proc fftw_cleanup*() {.cdecl, importc: "fftw_cleanup", dynlib: Fftw3Lib.} ## All existing plans become undefined, and you should not attempt to execute them nor to destroy them. You can however create and execute/destroy new plans, in which case FFTW starts accumulating wisdom information again. -proc fftw_set_timelimit*(t: cdouble) {.cdecl, importc: "fftw_set_timelimit", dynlib: Fftw3Lib.} - when compileOption("threads"): proc fftw_init_threads*() {.cdecl, importc: "fftw_init_threads", dynlib: Fftw3ThreadLib.} + ## Initialize once before using thread-ed plan proc fftw_plan_with_nthreads*(nthreads: cint) {.cdecl, importc: "fftw_plan_with_nthreads", dynlib: Fftw3ThreadLib.} + ## Set the number of threads to use proc fftw_cleanup_threads*() {.cdecl, importc: "fftw_cleanup_threads", dynlib: Fftw3ThreadLib.} + ## Additional clean-up when threads are used From 06452713b72f148d99314cb969efafd1aef1b41c Mon Sep 17 00:00:00 2001 From: Clonkk Date: Fri, 16 Apr 2021 16:26:15 +0200 Subject: [PATCH 3/3] complete docstring regarding --threading:on --- src/fftw3.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/fftw3.nim b/src/fftw3.nim index 7a86f1c..ec6a8c6 100644 --- a/src/fftw3.nim +++ b/src/fftw3.nim @@ -305,8 +305,11 @@ proc fftw_cleanup*() {.cdecl, importc: "fftw_cleanup", dynlib: Fftw3Lib.} when compileOption("threads"): proc fftw_init_threads*() {.cdecl, importc: "fftw_init_threads", dynlib: Fftw3ThreadLib.} ## Initialize once before using thread-ed plan + ## Needs ``--threads:on`` to be enabled proc fftw_plan_with_nthreads*(nthreads: cint) {.cdecl, importc: "fftw_plan_with_nthreads", dynlib: Fftw3ThreadLib.} ## Set the number of threads to use + ## Needs ``--threads:on`` to be enabled proc fftw_cleanup_threads*() {.cdecl, importc: "fftw_cleanup_threads", dynlib: Fftw3ThreadLib.} ## Additional clean-up when threads are used + ## Needs ``--threads:on`` to be enabled