123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313(*
Copyright 2013-2018 RIKEN
Copyright 2018-2025 Chiba Institude of Technology
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*)(* Author: Masatomo Hashimoto <m.hashimoto@stair.center> *)openLabel_commonmoduleAssertion=structtypet=|Itercnt|Minitercnt|Maxitercnt|Nodepsletto_string=function|Itercnt->"Itercnt"|Minitercnt->"Minitercnt"|Maxitercnt->"Maxitercnt"|Nodeps->"Nodeps"letto_simple_string=function|Itercnt->"ITERCNT"|Minitercnt->"MINITERCNT"|Maxitercnt->"MAXITERCNT"|Nodeps->"NODEPS"letto_tag=function|Itercnt->"XlfItercnt",[]|Minitercnt->"XlfMinitercnt",[]|Maxitercnt->"XlfMaxitercnt",[]|Nodeps->"XlfNodeps",[]endmoduleDirective=structtypesource=|Fixedofintoption|Free|FreeF90|FreeIBMletsource_to_string=function|Fixedi_opt->"Fixed"^(opt_to_stringstring_of_int~prefix:":"i_opt)|Free->"Free"|FreeF90->"Free(F90)"|FreeIBM->"Free(IBM)"typehigh_or_low=|VeryHigh|VeryLowlethigh_or_low_to_string=function|VeryHigh->"VeryHigh"|VeryLow->"VeryLow"lethigh_or_low_to_simple_string=function|VeryHigh->"VERY_HIGH"|VeryLow->"VERY_LOW"typet=|Alignofstring|Assert|BlockLoop|Cncall|Collapse|Eject|ExecutionFrequencyofhigh_or_low|ExpectedValueofname|FunctraceXlfCatch|FunctraceXlfEnter|FunctraceXlfExit|IgnoreTkr|Independent|Loopidofname|MemDelayofstring|New|Nofunctrace|Nosimd|Novector|Permutation|Snapshot|Sourceformofsource|StreamUnroll|Subscriptorder|Unroll|UnrollAndFuse|Processletto_string=function|Aligni->"Align:"^i|Assert->"Assert"|BlockLoop->"BlockLoop"|Cncall->"Cncall"|Collapse->"Collapse"|Eject->"Eject"|ExecutionFrequencyhl->"ExecutionFrequency:"^(high_or_low_to_stringhl)|ExpectedValuen->"ExpectedValue:"^n|FunctraceXlfCatch->"FunctraceXlfCatch"|FunctraceXlfEnter->"FunctraceXlfEnter"|FunctraceXlfExit->"FunctraceXlfExit"|IgnoreTkr->"IgnoreTkr"|Independent->"Independent"|Loopidn->"Loopid:"^n|MemDelayc->"MemDelay:"^c|New->"New"|Nofunctrace->"Nofunctrace"|Nosimd->"Nosimd"|Novector->"Novector"|Permutation->"Permutation"|Snapshot->"Snapshot"|Sourceforms->"Sourceform:"^(source_to_strings)|StreamUnroll->"StreamUnroll"|Subscriptorder->"Subscriptorder"|Unroll->"Unroll"|UnrollAndFuse->"UnrollAndFuse"|Process->"Process"letto_simple_string=function|Aligni->"ALIGN("^i^")"|Assert->"ASSERT"|BlockLoop->"BLOCK_LOOP"|Cncall->"CNCALL"|Collapse->"COLLAPSE"|Eject->"EJECT"|ExecutionFrequencyhl->Printf.sprintf"EXECUTION_FREQUENCY(%s)"(high_or_low_to_simple_stringhl)|ExpectedValuen->Printf.sprintf"EXPECTED_VALUE(%s)"n|FunctraceXlfCatch->"FUNCTRACE_XLF_CATCH"|FunctraceXlfEnter->"FUNCTRACE_XLF_ENTER"|FunctraceXlfExit->"FUNCTRACE_XLF_EXIT"|IgnoreTkr->"IGNORE_TKR"|Independent->"INDEPENDENT"|Loopidn->"LOOPID:"^n|MemDelayc->"MEM_DELAY("^c^")"|New->"NEW"|Nofunctrace->"NOFUNCTRACE"|Nosimd->"NOSIMD"|Novector->"NOVECTOR"|Permutation->"PERMUTATION"|Snapshot->"SNAPSHOT"|Sourceforms->"SOURCEFORM("^(source_to_strings)^")"|StreamUnroll->"STREAM_UNROLL"|Subscriptorder->"SUBSCRIPTORDER"|Unroll->"UNROLL"|UnrollAndFuse->"UNROLL_AND_FUSE"|Process->"@PROCESS"letto_tag=function|Aligni->"XlfAlign",["boundary",i]|Assert->"XlfAssert",[]|BlockLoop->"XlfBlockLoop",[]|Cncall->"XlfCncall",[]|Collapse->"XlfCollapse",[]|Eject->"XlfEject",[]|ExecutionFrequencyhl->"XlfExecutionFrequency",["freq",high_or_low_to_stringhl]|ExpectedValuen->"XlfExpectedValue",[name_attr_name,n]|FunctraceXlfCatch->"XlfFunctraceXlfCatch",[]|FunctraceXlfEnter->"XlfFunctraceXlfEnter",[]|FunctraceXlfExit->"XlfFunctraceXlfExit",[]|IgnoreTkr->"XlfIgnoreTkr",[]|Independent->"XlfIndependent",[]|Loopidn->"XlfLoopid",[name_attr_name,n]|MemDelayc->"XlfMemDelay",["cycle",c]|New->"XlfNew",[]|Nofunctrace->"XlfNofunctrace",[]|Nosimd->"XlfNosimd",[]|Novector->"XlfNovector",[]|Permutation->"XlfPermutation",[]|Snapshot->"XlfSnapshot",[]|Sourceforms->"XlfSourceform",["source",(source_to_strings)]|StreamUnroll->"XlfStreamUnroll",[]|Subscriptorder->"XlfSubscriptorder",[]|Unroll->"XlfUnroll",[]|UnrollAndFuse->"XlfUnrollAndFuse",[]|Process->"XlfProcess",[]letget_name=function|Loopidn|ExpectedValuen->n|_->raiseNot_foundletget_name_opt=function|Loopidn|ExpectedValuen->Somen|_->Noneletis_specification_part=function|Align_|Collapse|Eject|ExpectedValue_|Process|Subscriptorder|Sourceform_->true|_->falseletis_execution_part=function|Assert|BlockLoop|Cncall|Eject|ExecutionFrequency_|IgnoreTkr|Independent|Loopid_|MemDelay_|New|Nosimd|Novector|Permutation|Snapshot|Sourceform_|StreamUnroll|Unroll|UnrollAndFuse|Process->true|_->falseletanonymize=function|Align_->Align""|ExecutionFrequency_->ExecutionFrequencyVeryLow|ExpectedValue_->ExpectedValue""|Loopid_->Loopid""|MemDelay_->MemDelay""|Sourceform_->SourceformFreeF90|l->lend(* of module Xlf.Directive *)typet=|ERROR|CollapseArrayofname|SubscriptorderArrayofname*stringlist|NewClause|ReductionClause|Optionofnameletto_string=function|ERROR->"ERROR"|CollapseArrayn->"CollapseArray:"^n|SubscriptorderArray(n,il)->"SubscriptorderArray:"^n^":"^(String.concat";"il)|NewClause->"NewClause"|ReductionClause->"ReductionClause"|Optionn->"Option:"^nletto_simple_string=function|ERROR->"<error>"|CollapseArrayn->n|SubscriptorderArray(n,il)->Printf.sprintf"%s(%s)"n(String.concat","il)|NewClause->"<new-clause>"|ReductionClause->"<reduction-clause>"|Optionn->nletto_tag=function|ERROR->"ERROR",[]|CollapseArrayn->"XlfCollapseArray",[name_attr_name,n]|SubscriptorderArray(n,il)->"XlfSubscriptorderArray",[name_attr_name,n;"subscriptorder_numbers",String.concat";"il]|NewClause->"XlfNewClause",[]|ReductionClause->"XlfReductionClause",[]|Optionn->"XlfOption",[name_attr_name,n]letget_name=function|CollapseArrayn|SubscriptorderArray(n,_)|Optionn->n|_->raiseNot_foundletget_name_opt=function|CollapseArrayn|SubscriptorderArray(n,_)|Optionn->Somen|_->Noneletanonymize=function|CollapseArray_->CollapseArray""|SubscriptorderArray(_,_)->SubscriptorderArray("",[])|Option_->Option""|l->l