Skip to content

Commit

Permalink
Merge pull request #23 from SciNim/fix_docs
Browse files Browse the repository at this point in the history
add threads options to docs generation
  • Loading branch information
Clonkk authored Apr 16, 2021
2 parents 937da98 + 0645271 commit 8f75a51
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion fftw3.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down
13 changes: 9 additions & 4 deletions src/fftw3.nim
Original file line number Diff line number Diff line change
Expand Up @@ -292,19 +292,24 @@ 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

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
## 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.}
# {.passL: "-lfftw3_threads"}
# {.passL: "-lfftw3"}
## Additional clean-up when threads are used
## Needs ``--threads:on`` to be enabled

0 comments on commit 8f75a51

Please sign in to comment.