123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255(*
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_commontypedata_sharing_attr=|Private|Firstprivate|Shared|None_letdata_sharing_attr_to_string=function|Private->"Private"|Firstprivate->"Firstprivate"|Shared->"Shared"|None_->"None"letdata_sharing_attr_to_simple_string=function|Private->"private"|Firstprivate->"firstprivate"|Shared->"shared"|None_->"none"letdata_sharing_attr_to_tag=function|Private->"OmpPrivate",[]|Firstprivate->"OmpFirstprivate",[]|Shared->"OmpShared",[]|None_->invalid_arg"Label.OmpClause.data_sharing_attr_to_tag"typekind=|Static|Dynamic|Guided|Auto|Runtimeletkind_to_string=function|Static->"Static"|Dynamic->"Dynamic"|Guided->"Guided"|Auto->"Auto"|Runtime->"Runtime"letkind_to_simple_string=function|Static->"static"|Dynamic->"dynamic"|Guided->"guided"|Auto->"auto"|Runtime->"runtime"typepolicy=|Master|Close|Spreadletpolicy_to_string=function|Master->"Master"|Close->"Close"|Spread->"Spread"letpolicy_to_simple_string=function|Master->"master"|Close->"close"|Spread->"spread"typemap_type=|Alloc|To|From|Tofromletmap_type_to_string=function|Alloc->"Alloc"|To->"To"|From->"From"|Tofrom->"Tofrom"letmap_type_to_simple_string=function|Alloc->"alloc"|To->"to"|From->"from"|Tofrom->"tofrom"typedependence_type=|In|Out|Inoutletdependence_type_to_string=function|In->"In"|Out->"Out"|Inout->"Inout"letdependence_type_to_simple_string=function|In->"in"|Out->"out"|Inout->"inout"typet=|ERROR|If|Num_threads|Defaultofdata_sharing_attr|DataSharingAttrofdata_sharing_attr|Lastprivate|Copyin|Reduction|Scheduleofkind|Collapse|Ordered|Copyprivate|Nowait|Final|Untied|Mergeable(* 4.0 *)|Proc_bindofpolicy|Linearofbool(* with step or not *)|Mapofmap_typeoption|Safelen|Simdlen|Alignedofbool(* with alignment or not *)|Uniform|Inbranch|Notinbranch|Dependofdependence_type|Device|Dist_scheduleofkind|Initializer|Num_teams|Thread_limitletto_string=function|ERROR->"ERROR"|If->"If"|Num_threads->"Num_threads"|Defaulta->"Default:"^(data_sharing_attr_to_stringa)|DataSharingAttra->data_sharing_attr_to_stringa|Lastprivate->"Lastprivate"|Copyin->"Copyin"|Reduction->"Reduction"|Schedulek->"Schedule:"^(kind_to_stringk)|Collapse->"Collapse"|Ordered->"Ordered"|Copyprivate->"Copyprivate"|Nowait->"Nowait"|Final->"Final"|Untied->"Untied"|Mergeable->"Mergeable"|Proc_bindp->"Proc_bind:"^(policy_to_stringp)|Linearb->Printf.sprintf"Linear:%B"b|Mapt_opt->"Map"^(opt_to_stringmap_type_to_string~prefix:":"t_opt)|Safelen->"Safelen"|Simdlen->"Simdlen"|Alignedb->Printf.sprintf"Aligned:%B"b|Uniform->"Uniform"|Inbranch->"Inbranch"|Notinbranch->"Notinbranch"|Dependt->"Depend:"^(dependence_type_to_stringt)|Device->"Device"|Dist_schedulek->"Dist_schedule:"^(kind_to_stringk)|Initializer->"Initializer"|Num_teams->"Num_teams"|Thread_limit->"Thread_limit"letto_simple_string=function|ERROR->"<error>"|If->"if"|Num_threads->"num_threads"|Defaulta->"default("^(data_sharing_attr_to_simple_stringa)^")"|DataSharingAttra->data_sharing_attr_to_simple_stringa|Lastprivate->"lastprivate"|Copyin->"copyin"|Reduction->"reduction"|Schedulek->"schedule("^(kind_to_stringk)^")"|Collapse->"collapse"|Ordered->"ordered"|Copyprivate->"copyprivate"|Nowait->"nowait"|Final->"final"|Untied->"untied"|Mergeable->"mergeable"|Proc_bindp->"proc_bind("^(policy_to_simple_stringp)^")"|Linearb->"linear"^(ifbthen":"else"")|Mapt_opt->"map"^(opt_to_stringmap_type_to_simple_string~prefix:"("~suffix:")"t_opt)|Safelen->"safelen"|Simdlen->"simdlen"|Alignedb->"aligned"^(ifbthen":"else"")|Uniform->"uniform"|Inbranch->"inbranch"|Notinbranch->"notinbranch"|Dependt->"depend("^(dependence_type_to_simple_stringt)^")"|Device->"device"|Dist_schedulek->"dist_schedule("^(kind_to_stringk)^")"|Initializer->"initializer"|Num_teams->"num_teams"|Thread_limit->"thread_limit"letto_tag=function|ERROR->"ERROR",[]|If->"OmpIf",[]|Num_threads->"OmpNum_threads",[]|Defaulta->"OmpDefault",["attr",data_sharing_attr_to_stringa]|DataSharingAttra->data_sharing_attr_to_taga|Lastprivate->"OmpLastprivate",[]|Copyin->"OmpCopyin",[]|Reduction->"OmpReduction",[]|Schedulek->"OmpSchedule",["kind",kind_to_stringk]|Collapse->"OmpCollapse",[]|Ordered->"OmpOrdered",[]|Copyprivate->"OmpCopyprivate",[]|Nowait->"OmpNowait",[]|Final->"OmpFinal",[]|Untied->"OmpUntied",[]|Mergeable->"OmpMergeable",[]|Proc_bindp->"OmpProc_bind",["policy",policy_to_stringp]|Linearb->"OmpLinear",["step",string_of_boolb]|Mapt_opt->"OmpMap",(opt_to_attrmap_type_to_string"type"t_opt)|Safelen->"OmpSafelen",[]|Simdlen->"OmpSimdlen",[]|Alignedb->"OmpAligned",["alignment",string_of_boolb]|Uniform->"OmpUniform",[]|Inbranch->"OmpInbranch",[]|Notinbranch->"OmpNotinbranch",[]|Dependt->"OmpDepend",["type",dependence_type_to_stringt]|Device->"OmpDevice",[]|Dist_schedulek->"OmpDist_schedule",["kind",kind_to_stringk]|Initializer->"OmpInitializer",[]|Num_teams->"OmpNum_teams",[]|Thread_limit->"OmpThread_limit",[]letanonymize=function|Default_->DefaultNone_|Schedule_->ScheduleAuto|Map_->MapNone|Dist_schedule_->Dist_scheduleAuto|Linear_->Linearfalse|Aligned_->Alignedfalse|l->l