read_aop_knowledgeT_read_aop_knowledgeReadAopKnowledgeReadAopKnowledgeread_aop_knowledge (Operator)
Name
read_aop_knowledgeT_read_aop_knowledgeReadAopKnowledgeReadAopKnowledgeread_aop_knowledge
— Load knowledge about hardware dependent behavior of automatic operator
parallelization.
Signature
void ReadAopKnowledge(const HTuple& FileName, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* Attributes, HTuple* OperatorNames)
static HTuple HSystem::ReadAopKnowledge(const HString& FileName, const HTuple& GenParamName, const HTuple& GenParamValue, HTuple* OperatorNames)
static HTuple HSystem::ReadAopKnowledge(const HString& FileName, const HString& GenParamName, const HString& GenParamValue, HString* OperatorNames)
static HTuple HSystem::ReadAopKnowledge(const char* FileName, const char* GenParamName, const char* GenParamValue, HString* OperatorNames)
static HTuple HSystem::ReadAopKnowledge(const wchar_t* FileName, const wchar_t* GenParamName, const wchar_t* GenParamValue, HString* OperatorNames)
(Windows only)
static void HOperatorSet.ReadAopKnowledge(HTuple fileName, HTuple genParamName, HTuple genParamValue, out HTuple attributes, out HTuple operatorNames)
static HTuple HSystem.ReadAopKnowledge(string fileName, HTuple genParamName, HTuple genParamValue, out HTuple operatorNames)
static HTuple HSystem.ReadAopKnowledge(string fileName, string genParamName, string genParamValue, out string operatorNames)
def read_aop_knowledge(file_name: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[str, int, float]]) -> Tuple[Sequence[str], Sequence[str]]
def read_aop_knowledge_s(file_name: str, gen_param_name: MaybeSequence[str], gen_param_value: MaybeSequence[Union[str, int, float]]) -> Tuple[Sequence[str], str]
Description
read_aop_knowledgeread_aop_knowledgeReadAopKnowledgeReadAopKnowledgeReadAopKnowledgeread_aop_knowledge
loads the automatic operator parallelization
(AOP) knowledge of HALCON operators from file. The knowledge is used to
better utilize multiprocessor hardware in order to speed up the processing
of operators. To optimize the automatic operator parallelization,
HALCON needs some knowledge about the speed of operators on the used
hardware. This hardware-specific knowledge
can be obtained and stored by calling the operator optimize_aopoptimize_aopOptimizeAopOptimizeAopOptimizeAopoptimize_aop
and write_aop_knowledgewrite_aop_knowledgeWriteAopKnowledgeWriteAopKnowledgeWriteAopKnowledgewrite_aop_knowledge
, respectively.
With read_aop_knowledgeread_aop_knowledgeReadAopKnowledgeReadAopKnowledgeReadAopKnowledgeread_aop_knowledge
, it is possible to load this knowledge
explicitly from a binary file. In doing so, FileNameFileNameFileNameFileNamefileNamefile_name
denotes the
name of this file (incl. path and file extension). If an empty string
''"""""""""" is passed to FileNameFileNameFileNameFileNamefileNamefile_name
, HALCON reads the knowledge
from the specific file .aop_info
in the HALCON installation
directory (Linux/macOS) or within the common application data folder
(Windows). This file is read by HALCON automatically during the
initialization phase but can easily be re-read by
read_aop_knowledgeread_aop_knowledgeReadAopKnowledgeReadAopKnowledgeReadAopKnowledgeread_aop_knowledge
. The read knowledge updates the system's
parallelization information and can be controlled by pairs of additional
parameter values passed to GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
and GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
.
Every entry in GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
must have one corresponding,
specifying entry in GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
, meaning that the tuples
passed to the parameters must have the same length. GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
supports the values in following list, describing the possible applicable
values for GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
:
- 'ignore_attrib'"ignore_attrib""ignore_attrib""ignore_attrib""ignore_attrib""ignore_attrib"
-
suppresses to check knowledge attributes.
E.g., while reading the file read_aop_knowledgeread_aop_knowledgeReadAopKnowledgeReadAopKnowledgeReadAopKnowledgeread_aop_knowledge
checks whether
its content was written for the currently used computer and whether the
contained parallelization information regards the currently used HALCON
version, revision, and architecture. The attributes to suppress are
specified by passing any of the following values to
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
:
- 'host'"host""host""host""host""host"
the host name of the current machine
- 'cpu_info'"cpu_info""cpu_info""cpu_info""cpu_info""cpu_info"
the machine topology information
- 'variant'"variant""variant""variant""variant""variant"
the HALCON variant
- 'version'"version""version""version""version""version"
the HALCON version
- 'revision'"revision""revision""revision""revision""revision"
the HALCON revision
- 'architecture'"architecture""architecture""architecture""architecture""architecture"
the HALCON architecture
Multiple suppressions of attribute checks are possible.
- 'mode'"mode""mode""mode""mode""mode"
-
sets the way how the system's information gets
updated.
- 'truncate'"truncate""truncate""truncate""truncate""truncate"
for GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
deletes
all the existing information before the new knowledge loaded from file
is added.
- 'renew'"renew""renew""renew""renew""renew"
overwrites existing knowledge and adds new one
(default).
- 'append'"append""append""append""append""append"
keeps all existing operator information and just
adds the knowledge not already contained.
- 'nil'"nil""nil""nil""nil""nil"
refuses any updates but returns the
knowledge attributes in AttributesAttributesAttributesAttributesattributesattributes
and all the operators
contained in file in OperatorNamesOperatorNamesOperatorNamesOperatorNamesoperatorNamesoperator_names
.
- 'operator'"operator""operator""operator""operator""operator"
denotes that the corresponding index value of
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
contains an operator name. Multiple definitions
of operators are possible. By default, information of any contained
operator is loaded.
- 'iconic_type'"iconic_type""iconic_type""iconic_type""iconic_type""iconic_type"
focuses on AOP information for a specific
iconic type, specified by following values of GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
:
'byte'"byte""byte""byte""byte""byte",'uint2'"uint2""uint2""uint2""uint2""uint2",'real'"real""real""real""real""real",'int1'"int1""int1""int1""int1""int1",
'int2'"int2""int2""int2""int2""int2",'int4'"int4""int4""int4""int4""int4",'int8'"int8""int8""int8""int8""int8",'direction'"direction""direction""direction""direction""direction",
'vector_field'"vector_field""vector_field""vector_field""vector_field""vector_field",'cyclic'"cyclic""cyclic""cyclic""cyclic""cyclic",'vector_field'"vector_field""vector_field""vector_field""vector_field""vector_field",
'complex'"complex""complex""complex""complex""complex",'region'"region""region""region""region""region",'xld'"xld""xld""xld""xld""xld". Multiple definitions
of iconic types are possible.
The names of updated operators are returned in OperatorNamesOperatorNamesOperatorNamesOperatorNamesoperatorNamesoperator_names
,
the attributes of the read knowledge in AttributesAttributesAttributesAttributesattributesattributes
. The latter
tuple codes the following meaning by index beginning with index 0 in
corresponding order: host name, HALCON variant, HALCON version,
HALCON revision, HALCON architecture.
Execution Information
- Multithreading type: exclusive (runs in parallel only with independent operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
FileNameFileNameFileNameFileNamefileNamefile_name
(input_control) filename.read →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Name of knowledge file
Default value:
''
""
""
""
""
""
GenParamNameGenParamNameGenParamNameGenParamNamegenParamNamegen_param_name
(input_control) string(-array) →
HTupleMaybeSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Parameter name
Default value:
'none'
"none"
"none"
"none"
"none"
"none"
Suggested values: 'none'"none""none""none""none""none", 'ignore_attrib'"ignore_attrib""ignore_attrib""ignore_attrib""ignore_attrib""ignore_attrib", 'operator'"operator""operator""operator""operator""operator", 'iconic_type'"iconic_type""iconic_type""iconic_type""iconic_type""iconic_type", 'mode'"mode""mode""mode""mode""mode"
GenParamValueGenParamValueGenParamValueGenParamValuegenParamValuegen_param_value
(input_control) string(-array) →
HTupleMaybeSequence[Union[str, int, float]]HTupleHtuple (string / integer / real) (string / int / long / double) (HString / Hlong / double) (char* / Hlong / double)
Parameter value
Number of elements: GenParamName == GenParamValue
Default value:
'none'
"none"
"none"
"none"
"none"
"none"
Suggested values: 'none'"none""none""none""none""none", 'host_name'"host_name""host_name""host_name""host_name""host_name", 'variant'"variant""variant""variant""variant""variant", 'architecture'"architecture""architecture""architecture""architecture""architecture", 'version'"version""version""version""version""version", 'revision'"revision""revision""revision""revision""revision", 'byte'"byte""byte""byte""byte""byte", 'int1'"int1""int1""int1""int1""int1", 'int2'"int2""int2""int2""int2""int2", 'uint2'"uint2""uint2""uint2""uint2""uint2", 'int4'"int4""int4""int4""int4""int4", 'int8'"int8""int8""int8""int8""int8", 'direction'"direction""direction""direction""direction""direction", 'cyclic'"cyclic""cyclic""cyclic""cyclic""cyclic", 'vector_field'"vector_field""vector_field""vector_field""vector_field""vector_field", 'complex'"complex""complex""complex""complex""complex", 'region'"region""region""region""region""region", 'xld'"xld""xld""xld""xld""xld", 'xld_cont'"xld_cont""xld_cont""xld_cont""xld_cont""xld_cont", 'xld_poly'"xld_poly""xld_poly""xld_poly""xld_poly""xld_poly", 'nil'"nil""nil""nil""nil""nil", 'truncate'"truncate""truncate""truncate""truncate""truncate", 'replace'"replace""replace""replace""replace""replace", 'renew'"renew""renew""renew""renew""renew", 'append'"append""append""append""append""append"
AttributesAttributesAttributesAttributesattributesattributes
(output_control) string-array →
HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Knowledge attributes
OperatorNamesOperatorNamesOperatorNamesOperatorNamesoperatorNamesoperator_names
(output_control) string(-array) →
HTupleSequence[str]HTupleHtuple (string) (string) (HString) (char*)
Updated Operators
Result
read_aop_knowledgeread_aop_knowledgeReadAopKnowledgeReadAopKnowledgeReadAopKnowledgeread_aop_knowledge
returns 2 (H_MSG_TRUE) if all parameters are correct and
the file could be read. If necessary, an exception is raised.
Module
Foundation