1 /*
2   Copyright (c) 2015-2021, 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 ispc_version.h
35     @brief defines the ISPC version
36 */
37 
38 #pragma once
39 
40 #define ISPC_VERSION_MAJOR 1
41 #define ISPC_VERSION_MINOR 16
42 #define ISPC_VERSION "1.16.1"
43 #include <llvm/Config/llvm-config.h>
44 
45 #define ISPC_LLVM_VERSION (LLVM_VERSION_MAJOR * 10000 + LLVM_VERSION_MINOR * 100)
46 
47 #define ISPC_LLVM_10_0 100000
48 #define ISPC_LLVM_11_0 110000
49 #define ISPC_LLVM_11_1 110100
50 #define ISPC_LLVM_12_0 120000
51 #define ISPC_LLVM_13_0 130000
52 
53 #define OLDEST_SUPPORTED_LLVM ISPC_LLVM_10_0
54 #define LATEST_SUPPORTED_LLVM ISPC_LLVM_13_0
55 
56 #ifdef __ispc__xstr
57 #undef __ispc__xstr
58 #endif
59 #define __ispc__xstr(s) __ispc__str(s)
60 #define __ispc__str(s) #s
61 
62 #define ISPC_LLVM_VERSION_STRING                                                                                       \
63     __ispc__xstr(LLVM_VERSION_MAJOR) "." __ispc__xstr(LLVM_VERSION_MINOR) "." __ispc__xstr(LLVM_VERSION_PATCH)
64 
65 #if ISPC_LLVM_VERSION < OLDEST_SUPPORTED_LLVM || ISPC_LLVM_VERSION > LATEST_SUPPORTED_LLVM
66 #error "Unhandled LLVM version"
67 #endif
68