Configuration#
An instance of Configuration is passed to makeFactory() to provide
parameters and their values for constructing a factory.
Parameter |
Default value |
Notes |
|---|---|---|
architecture |
|
|
threads |
|
|
teams |
|
|
l1size |
|
|
l2size |
|
|
l3size |
|
|
The threads parameter sets the maximum number of threads that can be used by
a compute object.
Note that the default is the number of cores, not the number of cpus.
On a core with hyperthreading, you can try setting threads to the value
returned by detectCpus().
The teams parameter may be used by a factory to determine how to divvy up
the threads among work items.
Similarly, cache sizes are used to guide how the problem is decomposed into
work items.
- See Also:
CONSTANT
- hpk.sequential = (hpk.Parameter.threads, 1)#
A configuration setting that specifies single-threaded computation.
ENUMERATION
- class hpk.Parameter(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)#
- architecture = 1#
- invalid = 0#
- l1size = 273#
- l2size = 274#
- l3size = 275#
- teams = 257#
- threads = 256#
CLASS
- class hpk.Configuration#
A container for parameters and their associated values.
- Configuration.__init__(self) None#
- Configuration.__init__(self, arg: collections.abc.Sequence[hpk.ConfigItem], /) None
Overloaded function.
__init__(self) -> None__init__(self, arg: collections.abc.Sequence[hpk.ConfigItem], /) -> None
Initialize from a sequence in which each item is either an
Architectureor is a key and value tuple(Parameter, int).
- Configuration.get(self, arg: hpk.Parameter, /) int#
Returns the int value for the specified parameter. If a value for the parameter was not set, returns zero.
- Configuration.getArchitecture(self) hpk.Architecture#
Returns the Architecture that was set in this configuration. If an architecture was not set, it returns
Architecture.detect.