Configuration#
An instance of Configuration is passed to makeFactory()
to provide
parameters and their values for constructing a factory.
Parameter |
Default value |
Notes |
---|---|---|
architecture |
Architecture.detect |
value is an |
threads |
0 => detectCores() |
|
teams |
0 => detectPackages() |
|
l1size |
0 => detectDataCache(1).size |
|
l2size |
0 => detectDataCache(2).size |
|
l3size |
0 => detectDataCache(3).size |
|
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:
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
Initialize from a list in which each item is either an
Architecture
or is a key and an int value,(Parameter, int)
.
- Configuration.get(self, param: 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.