Skip to content

Allow setting OutputElementType within @tasks #92

Open
@carstenbauer

Description

See #TODO in macro_impl.jl. Especially relevant because it's sometimes required:

julia> @tasks for i in 1:10
           @set scheduler=:greedy
           @set collect=true
           sin(i)
       end
ERROR: Greedy scheduler isn't supported with `tmap` unless you provide an `OutputElementType` argument, since the greedy schedule requires a commutative reducing operator.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] tmap(::Function, ::UnitRange{Int64}; scheduler::Symbol, kwargs::@Kwargs{})
   @ OhMyThreads.Implementation ~/repos/OhMyThreads.jl/src/implementation.jl:339
 [3] macro expansion
   @ ~/repos/OhMyThreads.jl/src/macro_impl.jl:50 [inlined]
 [4] top-level scope
   @ REPL[26]:1

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions