Skip to content

Remove use of threadid #429

@devmotion

Description

@devmotion

Just noticed that ThreadSafeVarInfo makes heavy use of threadid:

function acclogp!!(vi::ThreadSafeVarInfo, logp)
vi.logps[Threads.threadid()] += logp
return vi
end
function acclogp!!(vi::ThreadSafeVarInfoWithRef, logp)
vi.logps[Threads.threadid()][] += logp
return vi
end

That should be changed since it is broken in Julia >= 1.8 if users don't use @threads :static for ... (see e.g. https://discourse.julialang.org/t/behavior-of-threads-threads-for-loop/76042).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions