Home | History | Annotate | Line # | Download | only in gcc
      1 /* Data structures for OpenMP context selectors.  This is in a separate file
      2    from omp-general.h so that it may also be used in the Fortran parser
      3    without reference to tree data structures.
      4 
      5    Copyright (C) 2023-2024 Free Software Foundation, Inc.
      6 
      7 This file is part of GCC.
      8 
      9 GCC is free software; you can redistribute it and/or modify it under
     10 the terms of the GNU General Public License as published by the Free
     11 Software Foundation; either version 3, or (at your option) any later
     12 version.
     13 
     14 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
     15 WARRANTY; without even the implied warranty of MERCHANTABILITY or
     16 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     17 for more details.
     18 
     19 You should have received a copy of the GNU General Public License
     20 along with GCC; see the file COPYING3.  If not see
     21 <http://www.gnu.org/licenses/>.  */
     22 
     23 
     24 #ifndef GCC_OMP_SELECTORS_H
     25 #define GCC_OMP_SELECTORS_H
     26 
     27 /* Trait set selector keywords.  */
     28 enum omp_tss_code {
     29   OMP_TRAIT_SET_CONSTRUCT,
     30   OMP_TRAIT_SET_DEVICE,
     31   OMP_TRAIT_SET_TARGET_DEVICE,
     32   OMP_TRAIT_SET_IMPLEMENTATION,
     33   OMP_TRAIT_SET_USER,
     34   OMP_TRAIT_SET_LAST,
     35   OMP_TRAIT_SET_INVALID = -1
     36 };
     37 
     38 /* Trait selector keywords.  */
     39 enum omp_ts_code {
     40   OMP_TRAIT_DEVICE_KIND,
     41   OMP_TRAIT_DEVICE_ISA,
     42   OMP_TRAIT_DEVICE_ARCH,
     43   OMP_TRAIT_DEVICE_NUM,
     44   OMP_TRAIT_IMPLEMENTATION_VENDOR,
     45   OMP_TRAIT_IMPLEMENTATION_EXTENSION,
     46   OMP_TRAIT_IMPLEMENTATION_ADMO,
     47   OMP_TRAIT_IMPLEMENTATION_REQUIRES,
     48   OMP_TRAIT_IMPLEMENTATION_UNIFIED_ADDRESS,
     49   OMP_TRAIT_IMPLEMENTATION_UNIFIED_SHARED_MEMORY,
     50   OMP_TRAIT_IMPLEMENTATION_DYNAMIC_ALLOCATORS,
     51   OMP_TRAIT_IMPLEMENTATION_REVERSE_OFFLOAD,
     52   OMP_TRAIT_USER_CONDITION,
     53   OMP_TRAIT_CONSTRUCT_TARGET,
     54   OMP_TRAIT_CONSTRUCT_TEAMS,
     55   OMP_TRAIT_CONSTRUCT_PARALLEL,
     56   OMP_TRAIT_CONSTRUCT_FOR,
     57   OMP_TRAIT_CONSTRUCT_SIMD,
     58   OMP_TRAIT_LAST,
     59   OMP_TRAIT_INVALID = -1
     60 };
     61 
     62 /* All trait property forms.  */
     63 enum omp_tp_type {
     64   OMP_TRAIT_PROPERTY_NONE,
     65   OMP_TRAIT_PROPERTY_ID,
     66   OMP_TRAIT_PROPERTY_NAME_LIST,
     67   OMP_TRAIT_PROPERTY_DEV_NUM_EXPR,
     68   OMP_TRAIT_PROPERTY_BOOL_EXPR,
     69   OMP_TRAIT_PROPERTY_CLAUSE_LIST,
     70   OMP_TRAIT_PROPERTY_EXTENSION
     71 };
     72 
     73 /* Map trait set selector name keywords onto strings.  */
     74 extern const char *omp_tss_map [];
     75 
     76 /* Map trait selector keywords onto strings, allowed contexts, and
     77    allowed property names for OMP_TRAIT_PROPERTY_NAME_LIST and
     78    OMP_TRAIT_PROPERTY_ID properties.  If valid_properties is null,
     79    it means that any required checking has to be done explicitly
     80    somewhere instead of being driven by the table.  Otherwise it's a
     81    null-terminated array of strings.  */
     82 struct omp_ts_info {
     83   const char *name;
     84   unsigned int tss_mask;
     85   enum omp_tp_type tp_type;
     86   bool allow_score;
     87   const char * const *valid_properties;
     88 };
     89 extern struct omp_ts_info omp_ts_map[];
     90 
     91 extern enum omp_tss_code omp_lookup_tss_code (const char *);
     92 extern enum omp_ts_code omp_lookup_ts_code (enum omp_tss_code, const char *);
     93 
     94 #endif /* GCC_OMP_SELECTORS_H */
     95