@@ -27,59 +27,30 @@ function select_scheduler(scheduler=OhMyThreads.Implementation.NotGiven(); kwarg
2727 end
2828end
2929
30- """
31- set_blockscheduler!([scheduler]; kwargs...) -> previous
32-
33- Set the default scheduler used in looping over the different blocks in the matrix representation
34- of a tensor.
35- The arguments to this function are either an `OhMyThreads.Scheduler` or a `Symbol` with optional
36- set of keywords arguments. For a detailed description, consult the
37- [`OhMyThreads` documentation](https://juliafolds2.github.io/OhMyThreads.jl/stable/refs/api/#Schedulers).
38-
39- See also [`with_blockscheduler`](@ref).
40- """
41- function set_blockscheduler!(scheduler= OhMyThreads. Implementation. NotGiven(); kwargs... )
42- previous = blockscheduler[]
43- blockscheduler[] = select_scheduler(scheduler; kwargs... )
44- return previous
45- end
46-
4730"""
4831 with_blockscheduler(f, [scheduler]; kwargs...)
4932
5033Run `f` in a scope where the `blockscheduler` is determined by `scheduler` and `kwargs...`.
5134
52- See also [`set_blockscheduler !`](@ref).
35+ See also [`with_subblockscheduler !`](@ref).
5336"""
54- function with_blockscheduler(f, scheduler= OhMyThreads. Implementation. NotGiven(); kwargs... )
37+ @inline function with_blockscheduler(f, scheduler= OhMyThreads. Implementation. NotGiven();
38+ kwargs... )
5539 @with blockscheduler => select_scheduler(scheduler; kwargs... ) f()
5640end
5741
5842"""
59- set_subblockscheduler!( [scheduler]; kwargs...) -> previous
43+ with_subblockscheduler(f, [scheduler]; kwargs...)
6044
61- Set the default scheduler used in looping over the different subblocks in a tensor .
45+ Run `f` in a scope where the [`subblockscheduler`](@ref) is determined by `scheduler` and `kwargs...` .
6246The arguments to this function are either an `OhMyThreads.Scheduler` or a `Symbol` with optional
6347set of keywords arguments. For a detailed description, consult the
6448[`OhMyThreads` documentation](https://juliafolds2.github.io/OhMyThreads.jl/stable/refs/api/#Schedulers).
6549
66- See also [`with_subblockscheduler`](@ref).
67- """
68- function set_subblockscheduler!(scheduler= OhMyThreads. Implementation. NotGiven(); kwargs... )
69- previous = subblockscheduler[]
70- subblockscheduler[] = select_scheduler(scheduler; kwargs... )
71- return previous
72- end
73-
74- """
75- with_subblockscheduler(f, [scheduler]; kwargs...)
76-
77- Run `f` in a scope where the [`subblockscheduler`](@ref) is determined by `scheduler` and `kwargs...`.
78-
79- See also [`set_subblockscheduler!`](@ref).
50+ See also [`with_blockscheduler!`](@ref).
8051"""
81- function with_subblockscheduler(f, scheduler= OhMyThreads. Implementation. NotGiven();
82- kwargs... )
52+ @inline function with_subblockscheduler(f, scheduler= OhMyThreads. Implementation. NotGiven();
53+ kwargs... )
8354 @with subblockscheduler => select_scheduler(scheduler; kwargs... ) f()
8455end
8556
0 commit comments