Skip to content

Commit

Permalink
Small cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
yebai committed Sep 12, 2018
1 parent bb76018 commit 1baf3a1
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Turing.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module Turing
__precompile__(false)

##############
# Dependency #
Expand Down Expand Up @@ -45,18 +46,15 @@ setadsafe(switch::Bool) = begin
ADSAFE[] = switch
end

const CHUNKSIZE = Ref(0) # default chunksize used by AD
const CHUNKSIZE = Ref(40) # default chunksize used by AD

setchunksize(chunk_size::Int) = begin
if ~(CHUNKSIZE[] == chunk_size)
@info("[Turing]: AD chunk size is set as $chunk_size")
CHUNKSIZE[] = chunk_size
global SEEDS = ForwardDiff.construct_seeds(ForwardDiff.Partials{chunk_size,Float64}) # pre-alloced dual parts
end
end

setchunksize(40)

const PROGRESS = Ref(true)
turnprogress(switch::Bool) = begin
@info("[Turing]: global PROGRESS is set as $switch")
Expand Down

0 comments on commit 1baf3a1

Please sign in to comment.