Intel® Implicit SPMD Program Compiler (Intel® ISPC)  1.13.0
target_enums.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2019-2020, Intel Corporation
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are
7  met:
8 
9  * Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11 
12  * Redistributions in binary form must reproduce the above copyright
13  notice, this list of conditions and the following disclaimer in the
14  documentation and/or other materials provided with the distribution.
15 
16  * Neither the name of Intel Corporation nor the names of its
17  contributors may be used to endorse or promote products derived from
18  this software without specific prior written permission.
19 
20 
21  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
22  IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
23  TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
24  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
25  OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28  PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */
33 
34 /** @file target_enums.h
35  @brief Define enums describing target platform.
36 */
37 
38 #pragma once
39 
40 #include <string>
41 #include <vector>
42 
44 
45 TargetOS ParseOS(std::string os);
46 std::string OSToString(TargetOS os);
47 std::string OSToLowerString(TargetOS os);
49 
50 enum class Arch { none, x86, x86_64, arm, aarch64, wasm32, error };
51 
52 Arch ParseArch(std::string arch);
53 std::string ArchToString(Arch arch);
54 
55 enum class ISPCTarget {
56  none,
57  host,
58  sse2_i32x4,
59  sse2_i32x8,
60  sse4_i8x16,
61  sse4_i16x8,
62  sse4_i32x4,
63  sse4_i32x8,
64  avx1_i32x4,
65  avx1_i32x8,
67  avx1_i64x4,
68  avx2_i32x4,
69  avx2_i32x8,
71  avx2_i64x4,
75  generic_1,
76  generic_4,
77  generic_8,
78  generic_16,
79  generic_32,
80  generic_64,
81  neon_i8x16,
82  neon_i16x8,
83  neon_i32x4,
84  neon_i32x8,
85  wasm_i32x4,
86  error
87 };
88 
89 ISPCTarget ParseISPCTarget(std::string target);
90 std::pair<std::vector<ISPCTarget>, std::string> ParseISPCTargets(const char *target);
91 std::string ISPCTargetToString(ISPCTarget target);
92 bool ISPCTargetIsX86(ISPCTarget target);
93 bool ISPCTargetIsGeneric(ISPCTarget target);
94 bool ISPCTargetIsNeon(ISPCTarget target);
95 bool ISPCTargetIsWasm(ISPCTarget target);
bool ISPCTargetIsNeon(ISPCTarget target)
std::pair< std::vector< ISPCTarget >, std::string > ParseISPCTargets(const char *target)
ISPCTarget
Definition: target_enums.h:55
TargetOS
Definition: target_enums.h:43
ISPCTarget ParseISPCTarget(std::string target)
bool ISPCTargetIsGeneric(ISPCTarget target)
bool ISPCTargetIsX86(ISPCTarget target)
std::string ArchToString(Arch arch)
TargetOS ParseOS(std::string os)
bool ISPCTargetIsWasm(ISPCTarget target)
std::string ISPCTargetToString(ISPCTarget target)
TargetOS GetHostOS()
Arch ParseArch(std::string arch)
std::string OSToString(TargetOS os)
std::string OSToLowerString(TargetOS os)
Arch
Definition: target_enums.h:50