1 /*
2  * Copyright 2011-2012, The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef _FRAMEWORKS_COMPILE_SLANG_SLANG_VERSION_H_  // NOLINT
18 #define _FRAMEWORKS_COMPILE_SLANG_SLANG_VERSION_H_
19 
20 #include <climits>
21 
22 #define RS_DEVELOPMENT_API UINT_MAX
23 
24 // API levels used by the standard Android SDK.
25 // MR -> Maintenance Release
26 // HC -> Honeycomb
27 // ICS -> Ice Cream Sandwich
28 // JB -> Jelly Bean
29 // KK -> KitKat
30 // M -> Marshmallow
31 enum SlangTargetAPI {
32   SLANG_MINIMUM_TARGET_API = 11,
33   SLANG_HC_TARGET_API = 11,
34   SLANG_HC_MR1_TARGET_API = 12,
35   SLANG_HC_MR2_TARGET_API = 13,
36   SLANG_ICS_TARGET_API = 14,
37   SLANG_ICS_MR1_TARGET_API = 15,
38   SLANG_JB_TARGET_API = 16,
39   SLANG_JB_MR1_TARGET_API = 17,
40   SLANG_JB_MR2_TARGET_API = 18,
41   SLANG_KK_TARGET_API = 19,
42   SLANG_M_TARGET_API = 23,
43   SLANG_N_TARGET_API = 24,
44   SLANG_MAXIMUM_TARGET_API = RS_VERSION,
45   SLANG_DEVELOPMENT_TARGET_API = RS_DEVELOPMENT_API
46 };
47 // Note that RS_VERSION is defined at build time (see Android.mk for details).
48 
49 // API levels where particular features exist.
50 // . Open (feature appears at a particular level and continues to exist):
51 //     SLANG_FEAT_FOO_API
52 // . Closed (feature exists only through a particular range of API levels):
53 //     SLANG_FEAT_BAR_API_MIN, SLANG_FEAT_BAR_API_MAX
54 enum SlangFeatureAPI {
55   SLANG_FEATURE_GENERAL_REDUCTION_API = SLANG_N_TARGET_API,
56   SLANG_FEATURE_GENERAL_REDUCTION_HALTER_API = SLANG_DEVELOPMENT_TARGET_API,
57   SLANG_FEATURE_SINGLE_SOURCE_API = SLANG_N_TARGET_API,
58 };
59 
60 // SlangVersion refers to the released compiler version (for which certain
61 // behaviors could change - i.e. critical bugs fixed that may require
62 // additional workarounds in the backend compiler).
63 namespace SlangVersion {
64 enum {
65   LEGACY = 0,
66   ICS = 1400,
67   JB = 1600,
68   JB_MR1 = 1700,
69   JB_MR2 = 1800,
70   KK = 1900,
71   KK_P1 = 1901,
72   L = 2100,
73   M = 2300,
74   M_RS_OBJECT = 2310,
75   N = 2400,
76   CURRENT = N
77 };
78 }  // namespace SlangVersion
79 
80 #endif  // _FRAMEWORKS_COMPILE_SLANG_SLANG_VERSION_H_  NOLINT
81