diff options
Diffstat (limited to 'dynamic-layers')
58 files changed, 2208 insertions, 1854 deletions
diff --git a/dynamic-layers/clang-layer/recipes-core/dnn/files/run-ptest b/dynamic-layers/clang-layer/recipes-core/dnn/files/run-ptest new file mode 100755 index 00000000..82d4df58 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-core/dnn/files/run-ptest | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | cd tests | ||
4 | ./api-c | ||
5 | if [ $? -eq 0 ]; then | ||
6 | echo 'PASS: api-c' | ||
7 | else | ||
8 | echo 'FAIL: api-c' | ||
9 | fi | ||
10 | ./test_c_symbols-c | ||
11 | if [ $? -eq 0 ]; then | ||
12 | echo 'PASS: test_c_symbols-c' | ||
13 | else | ||
14 | echo 'FAIL: test_c_symbols-c' | ||
15 | fi | ||
diff --git a/dynamic-layers/clang-layer/recipes-core/dnn/onednn_3.4.1.bb b/dynamic-layers/clang-layer/recipes-core/dnn/onednn_3.4.1.bb new file mode 100644 index 00000000..2fa3f627 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-core/dnn/onednn_3.4.1.bb | |||
@@ -0,0 +1,57 @@ | |||
1 | HOMEPAGE = "https://www.oneapi.com" | ||
2 | SUMMARY = "Deep Neural Network Library" | ||
3 | DESCRIPTION = "This software is a user mode library that accelerates\ | ||
4 | deep-learning applications and frameworks on Intel architecture." | ||
5 | LICENSE = "Apache-2.0 & BSD-3-Clause & BSL-1.0" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \ | ||
7 | file://tests/gtests/gtest/LICENSE;md5=cbbd27594afd089daa160d3a16dd515a \ | ||
8 | file://src/cpu/x64/xbyak/COPYRIGHT;md5=3b9bf048d063d54cdb28964db558bcc7 \ | ||
9 | file://src/common/ittnotify/LICENSE.BSD;md5=e671ff178b24a95a382ba670503c66fb \ | ||
10 | " | ||
11 | SECTION = "lib" | ||
12 | |||
13 | inherit pkgconfig cmake ptest | ||
14 | |||
15 | DNN_BRANCH = "rls-v${@'.'.join(d.getVar('PV').split('.')[0:2])}" | ||
16 | |||
17 | S = "${WORKDIR}/git" | ||
18 | SRCREV = "f5ff0a6de16c130053bec1a1aec3a9b826c66f78" | ||
19 | SRC_URI = "git://github.com/oneapi-src/oneDNN.git;branch=${DNN_BRANCH};protocol=https \ | ||
20 | file://run-ptest \ | ||
21 | " | ||
22 | |||
23 | UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$" | ||
24 | |||
25 | CVE_PRODUCT = "intel:math_kernel_library" | ||
26 | |||
27 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
28 | COMPATIBLE_HOST:libc-musl = 'null' | ||
29 | |||
30 | EXTRA_OECMAKE += " \ | ||
31 | -DDNNL_LIBRARY_TYPE=SHARED \ | ||
32 | -DDNNL_BUILD_EXAMPLES=ON \ | ||
33 | -DDNNL_BUILD_TESTS=ON \ | ||
34 | -DDNNL_CPU_RUNTIME=OMP \ | ||
35 | -DDNNL_ARCH_OPT_FLAGS="" \ | ||
36 | -DCMAKE_SKIP_RPATH=ON \ | ||
37 | -DONEDNN_BUILD_GRAPH=OFF \ | ||
38 | " | ||
39 | |||
40 | PACKAGECONFIG ??= "gpu" | ||
41 | PACKAGECONFIG[gpu] = "-DDNNL_GPU_RUNTIME=OCL, , opencl-headers virtual/opencl-icd, intel-compute-runtime" | ||
42 | |||
43 | do_install:append () { | ||
44 | install -d ${D}${bindir}/mkl-dnn/tests/benchdnn/inputs | ||
45 | install -m 0755 ${B}/tests/benchdnn/benchdnn ${D}${bindir}/mkl-dnn/tests/benchdnn | ||
46 | cp -r ${B}/tests/benchdnn/inputs/* ${D}${bindir}/mkl-dnn/tests/benchdnn/inputs | ||
47 | } | ||
48 | |||
49 | do_install_ptest () { | ||
50 | install -d ${D}${PTEST_PATH}/tests | ||
51 | install -m 0755 ${B}/tests/api-c ${D}${PTEST_PATH}/tests | ||
52 | install -m 0755 ${B}/tests/test_c_symbols-c ${D}${PTEST_PATH}/tests | ||
53 | } | ||
54 | |||
55 | PACKAGES =+ "${PN}-test" | ||
56 | |||
57 | FILES:${PN}-test = "${bindir}/mkl-dnn/*" | ||
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/clang_%.bbappend b/dynamic-layers/clang-layer/recipes-devtools/clang/clang_%.bbappend deleted file mode 100644 index f8d5a252..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/clang_%.bbappend +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/files:" | ||
2 | |||
3 | DEPENDS_append = " opencl-clang-native" | ||
4 | LLVM_TARGETS_TO_BUILD = "X86" | ||
5 | |||
6 | do_install_append_intel-x86-common() { | ||
7 | DESTDIR=${D} ninja -v install-cmake-exports | ||
8 | } | ||
9 | |||
10 | LIBCPLUSPLUS = "" | ||
11 | |||
12 | # undefined reference to `__atomic_load' on i*86. | ||
13 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-OpenCL-Change-type-of-block-pointer-for-OpenCL.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-OpenCL-Change-type-of-block-pointer-for-OpenCL.patch deleted file mode 100644 index 1c491402..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-OpenCL-Change-type-of-block-pointer-for-OpenCL.patch +++ /dev/null | |||
@@ -1,156 +0,0 @@ | |||
1 | From 39a3ac0065c23d1e2d55dfd8792cc28a146a4307 Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexey Bader <alexey.bader@intel.com> | ||
3 | Date: Tue, 19 Feb 2019 15:19:06 +0000 | ||
4 | Subject: [PATCH 1/2] [OpenCL] Change type of block pointer for OpenCL | ||
5 | |||
6 | Summary: | ||
7 | |||
8 | For some reason OpenCL blocks in LLVM IR are represented as function pointers. | ||
9 | These pointers do not point to any real function and never get called. Actually | ||
10 | they point to some structure, which in turn contains pointer to the real block | ||
11 | invoke function. | ||
12 | This patch changes represntation of OpenCL blocks in LLVM IR from function | ||
13 | pointers to pointers to `%struct.__block_literal_generic`. | ||
14 | Such representation allows to avoid unnecessary bitcasts and simplifies | ||
15 | further processing (e.g. translation to SPIR-V ) of the module for targets | ||
16 | which do not support function pointers. | ||
17 | |||
18 | Patch by: Alexey Sotkin. | ||
19 | |||
20 | Reviewers: Anastasia, yaxunl, svenvh | ||
21 | |||
22 | Reviewed By: Anastasia | ||
23 | |||
24 | Subscribers: alexbatashev, cfe-commits | ||
25 | |||
26 | Tags: #clang | ||
27 | |||
28 | Differential Revision: https://reviews.llvm.org/D58277 | ||
29 | |||
30 | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354337 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
31 | |||
32 | Upstream-Status: Backport | ||
33 | [https://github.com/llvm-mirror/clang/commit/283f308bdb5893bab1f36791711346e746045f94] | ||
34 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
35 | --- | ||
36 | lib/CodeGen/CodeGenTypes.cpp | 4 +++- | ||
37 | test/CodeGenOpenCL/blocks.cl | 18 ++++++++---------- | ||
38 | test/CodeGenOpenCL/cl20-device-side-enqueue.cl | 18 +++++++++--------- | ||
39 | 3 files changed, 20 insertions(+), 20 deletions(-) | ||
40 | |||
41 | diff --git a/lib/CodeGen/CodeGenTypes.cpp b/lib/CodeGen/CodeGenTypes.cpp | ||
42 | index 2acf1ac..93b3ebf 100644 | ||
43 | --- a/lib/CodeGen/CodeGenTypes.cpp | ||
44 | +++ b/lib/CodeGen/CodeGenTypes.cpp | ||
45 | @@ -637,7 +637,9 @@ llvm::Type *CodeGenTypes::ConvertType(QualType T) { | ||
46 | |||
47 | case Type::BlockPointer: { | ||
48 | const QualType FTy = cast<BlockPointerType>(Ty)->getPointeeType(); | ||
49 | - llvm::Type *PointeeType = ConvertTypeForMem(FTy); | ||
50 | + llvm::Type *PointeeType = CGM.getLangOpts().OpenCL | ||
51 | + ? CGM.getGenericBlockLiteralType() | ||
52 | + : ConvertTypeForMem(FTy); | ||
53 | unsigned AS = Context.getTargetAddressSpace(FTy); | ||
54 | ResultType = llvm::PointerType::get(PointeeType, AS); | ||
55 | break; | ||
56 | diff --git a/test/CodeGenOpenCL/blocks.cl b/test/CodeGenOpenCL/blocks.cl | ||
57 | index 675240c..19aacc3 100644 | ||
58 | --- a/test/CodeGenOpenCL/blocks.cl | ||
59 | +++ b/test/CodeGenOpenCL/blocks.cl | ||
60 | @@ -35,11 +35,10 @@ void foo(){ | ||
61 | // SPIR: %[[block_captured:.*]] = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 }>, <{ i32, i32, i8 addrspace(4)*, i32 }>* %[[block]], i32 0, i32 3 | ||
62 | // SPIR: %[[i_value:.*]] = load i32, i32* %i | ||
63 | // SPIR: store i32 %[[i_value]], i32* %[[block_captured]], | ||
64 | - // SPIR: %[[blk_ptr:.*]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32 }>* %[[block]] to i32 ()* | ||
65 | - // SPIR: %[[blk_gen_ptr:.*]] = addrspacecast i32 ()* %[[blk_ptr]] to i32 () addrspace(4)* | ||
66 | - // SPIR: store i32 () addrspace(4)* %[[blk_gen_ptr]], i32 () addrspace(4)** %[[block_B:.*]], | ||
67 | - // SPIR: %[[blk_gen_ptr:.*]] = load i32 () addrspace(4)*, i32 () addrspace(4)** %[[block_B]] | ||
68 | - // SPIR: %[[block_literal:.*]] = bitcast i32 () addrspace(4)* %[[blk_gen_ptr]] to %struct.__opencl_block_literal_generic addrspace(4)* | ||
69 | + // SPIR: %[[blk_ptr:.*]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32 }>* %[[block]] to %struct.__opencl_block_literal_generic* | ||
70 | + // SPIR: %[[blk_gen_ptr:.*]] = addrspacecast %struct.__opencl_block_literal_generic* %[[blk_ptr]] to %struct.__opencl_block_literal_generic addrspace(4)* | ||
71 | + // SPIR: store %struct.__opencl_block_literal_generic addrspace(4)* %[[blk_gen_ptr]], %struct.__opencl_block_literal_generic addrspace(4)** %[[block_B:.*]], | ||
72 | + // SPIR: %[[block_literal:.*]] = load %struct.__opencl_block_literal_generic addrspace(4)*, %struct.__opencl_block_literal_generic addrspace(4)** %[[block_B]] | ||
73 | // SPIR: %[[invoke_addr:.*]] = getelementptr inbounds %struct.__opencl_block_literal_generic, %struct.__opencl_block_literal_generic addrspace(4)* %[[block_literal]], i32 0, i32 2 | ||
74 | // SPIR: %[[blk_gen_ptr:.*]] = bitcast %struct.__opencl_block_literal_generic addrspace(4)* %[[block_literal]] to i8 addrspace(4)* | ||
75 | // SPIR: %[[invoke_func_ptr:.*]] = load i8 addrspace(4)*, i8 addrspace(4)* addrspace(4)* %[[invoke_addr]] | ||
76 | @@ -50,11 +49,10 @@ void foo(){ | ||
77 | // AMDGCN: %[[block_captured:.*]] = getelementptr inbounds <{ i32, i32, i8*, i32 }>, <{ i32, i32, i8*, i32 }> addrspace(5)* %[[block]], i32 0, i32 3 | ||
78 | // AMDGCN: %[[i_value:.*]] = load i32, i32 addrspace(5)* %i | ||
79 | // AMDGCN: store i32 %[[i_value]], i32 addrspace(5)* %[[block_captured]], | ||
80 | - // AMDGCN: %[[blk_ptr:.*]] = bitcast <{ i32, i32, i8*, i32 }> addrspace(5)* %[[block]] to i32 () addrspace(5)* | ||
81 | - // AMDGCN: %[[blk_gen_ptr:.*]] = addrspacecast i32 () addrspace(5)* %[[blk_ptr]] to i32 ()* | ||
82 | - // AMDGCN: store i32 ()* %[[blk_gen_ptr]], i32 ()* addrspace(5)* %[[block_B:.*]], | ||
83 | - // AMDGCN: %[[blk_gen_ptr:.*]] = load i32 ()*, i32 ()* addrspace(5)* %[[block_B]] | ||
84 | - // AMDGCN: %[[block_literal:.*]] = bitcast i32 ()* %[[blk_gen_ptr]] to %struct.__opencl_block_literal_generic* | ||
85 | + // AMDGCN: %[[blk_ptr:.*]] = bitcast <{ i32, i32, i8*, i32 }> addrspace(5)* %[[block]] to %struct.__opencl_block_literal_generic addrspace(5)* | ||
86 | + // AMDGCN: %[[blk_gen_ptr:.*]] = addrspacecast %struct.__opencl_block_literal_generic addrspace(5)* %[[blk_ptr]] to %struct.__opencl_block_literal_generic* | ||
87 | + // AMDGCN: store %struct.__opencl_block_literal_generic* %[[blk_gen_ptr]], %struct.__opencl_block_literal_generic* addrspace(5)* %[[block_B:.*]], | ||
88 | + // AMDGCN: %[[block_literal:.*]] = load %struct.__opencl_block_literal_generic*, %struct.__opencl_block_literal_generic* addrspace(5)* %[[block_B]] | ||
89 | // AMDGCN: %[[invoke_addr:.*]] = getelementptr inbounds %struct.__opencl_block_literal_generic, %struct.__opencl_block_literal_generic* %[[block_literal]], i32 0, i32 2 | ||
90 | // AMDGCN: %[[blk_gen_ptr:.*]] = bitcast %struct.__opencl_block_literal_generic* %[[block_literal]] to i8* | ||
91 | // AMDGCN: %[[invoke_func_ptr:.*]] = load i8*, i8** %[[invoke_addr]] | ||
92 | diff --git a/test/CodeGenOpenCL/cl20-device-side-enqueue.cl b/test/CodeGenOpenCL/cl20-device-side-enqueue.cl | ||
93 | index 4732194..8445016 100644 | ||
94 | --- a/test/CodeGenOpenCL/cl20-device-side-enqueue.cl | ||
95 | +++ b/test/CodeGenOpenCL/cl20-device-side-enqueue.cl | ||
96 | @@ -11,7 +11,7 @@ typedef struct {int a;} ndrange_t; | ||
97 | |||
98 | // For a block global variable, first emit the block literal as a global variable, then emit the block variable itself. | ||
99 | // COMMON: [[BL_GLOBAL:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* [[INV_G:@[^ ]+]] to i8*) to i8 addrspace(4)*) } | ||
100 | -// COMMON: @block_G = addrspace(1) constant void (i8 addrspace(3)*) addrspace(4)* addrspacecast (void (i8 addrspace(3)*) addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to void (i8 addrspace(3)*) addrspace(1)*) to void (i8 addrspace(3)*) addrspace(4)*) | ||
101 | +// COMMON: @block_G = addrspace(1) constant %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*) | ||
102 | |||
103 | // For anonymous blocks without captures, emit block literals as global variable. | ||
104 | // COMMON: [[BLG1:@__block_literal_global[^ ]*]] = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 {{[0-9]+}}, i32 {{[0-9]+}}, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* {{@[^ ]+}} to i8*) to i8 addrspace(4)*) } | ||
105 | @@ -77,9 +77,9 @@ kernel void device_side_enqueue(global int *a, global int *b, int i) { | ||
106 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue | ||
107 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags | ||
108 | // COMMON: store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* [[INVL1:@__device_side_enqueue_block_invoke[^ ]*]] to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke | ||
109 | - // B32: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block to void ()* | ||
110 | - // B64: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32 addrspace(1)*, i32 }>* %block to void ()* | ||
111 | - // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast void ()* [[BL]] to i8 addrspace(4)* | ||
112 | + // B32: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block to %struct.__opencl_block_literal_generic* | ||
113 | + // B64: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32 addrspace(1)*, i32 }>* %block to %struct.__opencl_block_literal_generic* | ||
114 | + // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast %struct.__opencl_block_literal_generic* [[BL]] to i8 addrspace(4)* | ||
115 | // COMMON-LABEL: call i32 @__enqueue_kernel_basic( | ||
116 | // COMMON-SAME: %opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* byval [[NDR]]{{([0-9]+)?}}, | ||
117 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVLK1:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), | ||
118 | @@ -95,8 +95,8 @@ kernel void device_side_enqueue(global int *a, global int *b, int i) { | ||
119 | // COMMON: [[WAIT_EVNT:%[0-9]+]] = addrspacecast %opencl.clk_event_t{{.*}}** %event_wait_list to %opencl.clk_event_t{{.*}}* addrspace(4)* | ||
120 | // COMMON: [[EVNT:%[0-9]+]] = addrspacecast %opencl.clk_event_t{{.*}}** %clk_event to %opencl.clk_event_t{{.*}}* addrspace(4)* | ||
121 | // COMMON: store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* [[INVL2:@__device_side_enqueue_block_invoke[^ ]*]] to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke | ||
122 | - // COMMON: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32{{.*}}, i32{{.*}}, i32{{.*}} }>* %block3 to void ()* | ||
123 | - // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast void ()* [[BL]] to i8 addrspace(4)* | ||
124 | + // COMMON: [[BL:%[0-9]+]] = bitcast <{ i32, i32, i8 addrspace(4)*, i32{{.*}}, i32{{.*}}, i32{{.*}} }>* %block3 to %struct.__opencl_block_literal_generic* | ||
125 | + // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast %struct.__opencl_block_literal_generic* [[BL]] to i8 addrspace(4)* | ||
126 | // COMMON-LABEL: call i32 @__enqueue_kernel_basic_events | ||
127 | // COMMON-SAME: (%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* {{.*}}, i32 2, %opencl.clk_event_t{{.*}}* addrspace(4)* [[WAIT_EVNT]], %opencl.clk_event_t{{.*}}* addrspace(4)* [[EVNT]], | ||
128 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVLK2:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), | ||
129 | @@ -300,13 +300,13 @@ kernel void device_side_enqueue(global int *a, global int *b, int i) { | ||
130 | // Emits global block literal [[BLG8]] and invoke function [[INVG8]]. | ||
131 | // The full type of these expressions are long (and repeated elsewhere), so we | ||
132 | // capture it as part of the regex for convenience and clarity. | ||
133 | - // COMMON: store void () addrspace(4)* addrspacecast (void () addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to void () addrspace(1)*) to void () addrspace(4)*), void () addrspace(4)** %block_A | ||
134 | + // COMMON: store %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), %struct.__opencl_block_literal_generic addrspace(4)** %block_A | ||
135 | void (^const block_A)(void) = ^{ | ||
136 | return; | ||
137 | }; | ||
138 | |||
139 | // Emits global block literal [[BLG9]] and invoke function [[INVG9]]. | ||
140 | - // COMMON: store void (i8 addrspace(3)*) addrspace(4)* addrspacecast (void (i8 addrspace(3)*) addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG9]] to void (i8 addrspace(3)*) addrspace(1)*) to void (i8 addrspace(3)*) addrspace(4)*), void (i8 addrspace(3)*) addrspace(4)** %block_B | ||
141 | + // COMMON: store %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG9]] to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), %struct.__opencl_block_literal_generic addrspace(4)** %block_B | ||
142 | void (^const block_B)(local void *) = ^(local void *a) { | ||
143 | return; | ||
144 | }; | ||
145 | @@ -346,7 +346,7 @@ kernel void device_side_enqueue(global int *a, global int *b, int i) { | ||
146 | // COMMON: store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* [[INVL3:@__device_side_enqueue_block_invoke[^ ]*]] to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke | ||
147 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue | ||
148 | // COMMON: [[FLAGS:%[0-9]+]] = load i32, i32* %flags | ||
149 | - // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast void ()* {{.*}} to i8 addrspace(4)* | ||
150 | + // COMMON: [[BL_I8:%[0-9]+]] = addrspacecast %struct.__opencl_block_literal_generic* {{.*}} to i8 addrspace(4)* | ||
151 | // COMMON-LABEL: call i32 @__enqueue_kernel_basic( | ||
152 | // COMMON-SAME: %opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* byval [[NDR]]{{([0-9]+)?}}, | ||
153 | // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INVLK3:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), | ||
154 | -- | ||
155 | 1.8.3.1 | ||
156 | |||
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Update-LowerOpenCL-pass-to-handle-new-blocks-represn.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Update-LowerOpenCL-pass-to-handle-new-blocks-represn.patch deleted file mode 100644 index 4a528674..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-Update-LowerOpenCL-pass-to-handle-new-blocks-represn.patch +++ /dev/null | |||
@@ -1,1119 +0,0 @@ | |||
1 | From 9ce0fe02fd6cda5fb29fbb0d5037a1798a810b8a Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexey Sotkin <alexey.sotkin@intel.com> | ||
3 | Date: Thu, 21 Feb 2019 17:14:36 +0300 | ||
4 | Subject: [PATCH 1/3] Update LowerOpenCL pass to handle new blocks | ||
5 | represntation in LLVM IR | ||
6 | |||
7 | Upstream-Status: Backport | ||
8 | [https://github.com/KhronosGroup/SPIRV-LLVM-Translator/commit/bd6ddfaf7232cd81c7f2fe9877e66f286731bd8e] | ||
9 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
10 | --- | ||
11 | lib/SPIRV/SPIRVLowerOCLBlocks.cpp | 413 ++++++++---------------------- | ||
12 | test/global_block.ll | 71 ++--- | ||
13 | test/literal-struct.ll | 31 ++- | ||
14 | test/transcoding/block_w_struct_return.ll | 47 ++-- | ||
15 | test/transcoding/enqueue_kernel.ll | 237 ++++++++++------- | ||
16 | 5 files changed, 317 insertions(+), 482 deletions(-) | ||
17 | |||
18 | diff --git a/lib/SPIRV/SPIRVLowerOCLBlocks.cpp b/lib/SPIRV/SPIRVLowerOCLBlocks.cpp | ||
19 | index 50e1838..b42a4ec 100644 | ||
20 | --- a/lib/SPIRV/SPIRVLowerOCLBlocks.cpp | ||
21 | +++ b/lib/SPIRV/SPIRVLowerOCLBlocks.cpp | ||
22 | @@ -1,303 +1,110 @@ | ||
23 | -//===- SPIRVLowerOCLBlocks.cpp - OCL Utilities ----------------------------===// | ||
24 | -// | ||
25 | -// The LLVM/SPIRV Translator | ||
26 | -// | ||
27 | -// This file is distributed under the University of Illinois Open Source | ||
28 | -// License. See LICENSE.TXT for details. | ||
29 | -// | ||
30 | -// Copyright (c) 2018 Intel Corporation. All rights reserved. | ||
31 | -// | ||
32 | -// Permission is hereby granted, free of charge, to any person obtaining a | ||
33 | -// copy of this software and associated documentation files (the "Software"), | ||
34 | -// to deal with the Software without restriction, including without limitation | ||
35 | -// the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
36 | -// and/or sell copies of the Software, and to permit persons to whom the | ||
37 | -// Software is furnished to do so, subject to the following conditions: | ||
38 | -// | ||
39 | -// Redistributions of source code must retain the above copyright notice, | ||
40 | -// this list of conditions and the following disclaimers. | ||
41 | -// Redistributions in binary form must reproduce the above copyright notice, | ||
42 | -// this list of conditions and the following disclaimers in the documentation | ||
43 | -// and/or other materials provided with the distribution. | ||
44 | -// Neither the names of Intel Corporation, nor the names of its | ||
45 | -// contributors may be used to endorse or promote products derived from this | ||
46 | -// Software without specific prior written permission. | ||
47 | -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
48 | -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
49 | -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
50 | -// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
51 | -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
52 | -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH | ||
53 | -// THE SOFTWARE. | ||
54 | -// | ||
55 | -//===----------------------------------------------------------------------===// | ||
56 | -// | ||
57 | -// SPIR-V specification doesn't allow function pointers, so SPIR-V translator | ||
58 | -// is designed to fail if a value with function type (except calls) is occured. | ||
59 | -// Currently there is only two cases, when function pointers are generating in | ||
60 | -// LLVM IR in OpenCL - block calls and device side enqueue built-in calls. | ||
61 | -// | ||
62 | -// In both cases values with function type used as intermediate representation | ||
63 | -// for block literal structure. | ||
64 | -// | ||
65 | -// This pass is designed to find such cases and simplify them to avoid any | ||
66 | -// function pointer types occurrences in LLVM IR in 4 steps. | ||
67 | -// | ||
68 | -// 1. Find all function pointer allocas, like | ||
69 | -// %block = alloca void () * | ||
70 | -// | ||
71 | -// Then find a single store to that alloca: | ||
72 | -// %blockLit = alloca <{ i32, i32, ...}>, align 4 | ||
73 | -// %0 = bitcast <{ i32, i32, ... }>* %blockLit to void ()* | ||
74 | -// > store void ()* %0, void ()** %block, align 4 | ||
75 | -// | ||
76 | -// And replace the alloca users by new instructions which used stored value | ||
77 | -// %blockLit itself instead of function pointer alloca %block. | ||
78 | -// | ||
79 | -// 2. Find consecutive casts from block literal type to i8 addrspace(4)* | ||
80 | -// used function pointers as an intermediate type: | ||
81 | -// %0 = bitcast <{ i32, i32 }> %block to void() * | ||
82 | -// %1 = addrspacecast void() * %0 to i8 addrspace(4)* | ||
83 | -// And simplify them: | ||
84 | -// %2 = addrspacecast <{ i32, i32 }> %block to i8 addrspace(4)* | ||
85 | -// | ||
86 | -// 3. Find all unused instructions with function pointer type occured after | ||
87 | -// pp.1-2 and remove them. | ||
88 | -// | ||
89 | -// 4. Find unused globals with function pointer type, like | ||
90 | -// @block = constant void ()* | ||
91 | -// bitcast ({ i32, i32 }* @__block_literal_global to void ()* | ||
92 | -// | ||
93 | -// And remove them. | ||
94 | -// | ||
95 | -//===----------------------------------------------------------------------===// | ||
96 | -#define DEBUG_TYPE "spv-lower-ocl-blocks" | ||
97 | - | ||
98 | -#include "OCLUtil.h" | ||
99 | -#include "SPIRVInternal.h" | ||
100 | - | ||
101 | -#include "llvm/ADT/SetVector.h" | ||
102 | -#include "llvm/Analysis/ValueTracking.h" | ||
103 | -#include "llvm/IR/GlobalVariable.h" | ||
104 | -#include "llvm/IR/InstIterator.h" | ||
105 | -#include "llvm/IR/Module.h" | ||
106 | -#include "llvm/Pass.h" | ||
107 | -#include "llvm/PassSupport.h" | ||
108 | -#include "llvm/Support/Casting.h" | ||
109 | - | ||
110 | -using namespace llvm; | ||
111 | - | ||
112 | -namespace { | ||
113 | - | ||
114 | -static void | ||
115 | -removeUnusedFunctionPtrInst(Instruction *I, | ||
116 | - SmallSetVector<Instruction *, 16> &FuncPtrInsts) { | ||
117 | - for (unsigned OpIdx = 0, Ops = I->getNumOperands(); OpIdx != Ops; ++OpIdx) { | ||
118 | - Instruction *OpI = dyn_cast<Instruction>(I->getOperand(OpIdx)); | ||
119 | - I->setOperand(OpIdx, nullptr); | ||
120 | - if (OpI && OpI != I && OpI->user_empty()) | ||
121 | - FuncPtrInsts.insert(OpI); | ||
122 | - } | ||
123 | - I->eraseFromParent(); | ||
124 | -} | ||
125 | - | ||
126 | -static bool isFuncPtrAlloca(const AllocaInst *AI) { | ||
127 | - auto *ET = dyn_cast<PointerType>(AI->getAllocatedType()); | ||
128 | - return ET && ET->getElementType()->isFunctionTy(); | ||
129 | -} | ||
130 | - | ||
131 | -static bool hasFuncPtrType(const Value *V) { | ||
132 | - auto *PT = dyn_cast<PointerType>(V->getType()); | ||
133 | - return PT && PT->getElementType()->isFunctionTy(); | ||
134 | -} | ||
135 | - | ||
136 | -static bool isFuncPtrInst(const Instruction *I) { | ||
137 | - if (auto *AI = dyn_cast<AllocaInst>(I)) | ||
138 | - return isFuncPtrAlloca(AI); | ||
139 | - | ||
140 | - for (auto &Op : I->operands()) { | ||
141 | - if (auto *AI = dyn_cast<AllocaInst>(Op)) | ||
142 | - return isFuncPtrAlloca(AI); | ||
143 | - | ||
144 | - auto *OpI = dyn_cast<Instruction>(&Op); | ||
145 | - if (OpI && OpI != I && hasFuncPtrType(OpI)) | ||
146 | - return true; | ||
147 | - } | ||
148 | - return false; | ||
149 | -} | ||
150 | - | ||
151 | -static StoreInst *findSingleStore(AllocaInst *AI) { | ||
152 | - StoreInst *Store = nullptr; | ||
153 | - for (auto *U : AI->users()) { | ||
154 | - if (!isa<StoreInst>(U)) | ||
155 | - continue; // not a store | ||
156 | - if (Store) | ||
157 | - return nullptr; // there are more than one stores | ||
158 | - Store = dyn_cast<StoreInst>(U); | ||
159 | - } | ||
160 | - return Store; | ||
161 | -} | ||
162 | - | ||
163 | -static void fixFunctionPtrAllocaUsers(AllocaInst *AI) { | ||
164 | - // Find and remove a single store to alloca | ||
165 | - auto *SingleStore = findSingleStore(AI); | ||
166 | - assert(SingleStore && "More than one store to the function pointer alloca"); | ||
167 | - auto *StoredVal = SingleStore->getValueOperand(); | ||
168 | - SingleStore->eraseFromParent(); | ||
169 | - | ||
170 | - // Find loads from the alloca and replace thier users | ||
171 | - for (auto *U : AI->users()) { | ||
172 | - auto *LI = dyn_cast<LoadInst>(U); | ||
173 | - if (!LI) | ||
174 | - continue; | ||
175 | - | ||
176 | - for (auto *U : LI->users()) { | ||
177 | - auto *UInst = cast<Instruction>(U); | ||
178 | - auto *Cast = CastInst::CreatePointerBitCastOrAddrSpaceCast( | ||
179 | - StoredVal, UInst->getType(), "", UInst); | ||
180 | - UInst->replaceAllUsesWith(Cast); | ||
181 | - } | ||
182 | - } | ||
183 | -} | ||
184 | - | ||
185 | -static int getBlockLiteralIdx(const Function &F) { | ||
186 | - StringRef FName = F.getName(); | ||
187 | - if (isEnqueueKernelBI(FName)) | ||
188 | - return FName.contains("events") ? 7 : 4; | ||
189 | - if (isKernelQueryBI(FName)) | ||
190 | - return FName.contains("for_ndrange") ? 2 : 1; | ||
191 | - if (FName.startswith("__") && FName.contains("_block_invoke")) | ||
192 | - return F.hasStructRetAttr() ? 1 : 0; | ||
193 | - | ||
194 | - return -1; // No block literal argument | ||
195 | -} | ||
196 | - | ||
197 | -static bool hasBlockLiteralArg(const Function &F) { | ||
198 | - return getBlockLiteralIdx(F) != -1; | ||
199 | -} | ||
200 | - | ||
201 | -static bool simplifyFunctionPtrCasts(Function &F) { | ||
202 | - bool Changed = false; | ||
203 | - int BlockLiteralIdx = getBlockLiteralIdx(F); | ||
204 | - for (auto *U : F.users()) { | ||
205 | - auto *Call = dyn_cast<CallInst>(U); | ||
206 | - if (!Call) | ||
207 | - continue; | ||
208 | - if (Call->getFunction()->getName() == F.getName().str() + "_kernel") | ||
209 | - continue; // Skip block invoke function calls inside block invoke kernels | ||
210 | - | ||
211 | - const DataLayout &DL = F.getParent()->getDataLayout(); | ||
212 | - auto *BlockLiteral = Call->getOperand(BlockLiteralIdx); | ||
213 | - auto *BlockLiteralVal = GetUnderlyingObject(BlockLiteral, DL); | ||
214 | - if (isa<GlobalVariable>(BlockLiteralVal)) | ||
215 | - continue; // nothing to do with globals | ||
216 | - | ||
217 | - auto *BlockLiteralAlloca = cast<AllocaInst>(BlockLiteralVal); | ||
218 | - assert(!BlockLiteralAlloca->getAllocatedType()->isFunctionTy() && | ||
219 | - "Function type shouldn't be there"); | ||
220 | - | ||
221 | - auto *NewBlockLiteral = CastInst::CreatePointerBitCastOrAddrSpaceCast( | ||
222 | - BlockLiteralAlloca, BlockLiteral->getType(), "", Call); | ||
223 | - BlockLiteral->replaceAllUsesWith(NewBlockLiteral); | ||
224 | - Changed |= true; | ||
225 | - } | ||
226 | - return Changed; | ||
227 | -} | ||
228 | - | ||
229 | -static void | ||
230 | -findFunctionPtrAllocas(Module &M, | ||
231 | - SmallVectorImpl<AllocaInst *> &FuncPtrAllocas) { | ||
232 | - for (auto &F : M) { | ||
233 | - if (F.isDeclaration()) | ||
234 | - continue; | ||
235 | - for (auto &I : instructions(F)) { | ||
236 | - auto *AI = dyn_cast<AllocaInst>(&I); | ||
237 | - if (!AI || !isFuncPtrAlloca(AI)) | ||
238 | - continue; | ||
239 | - FuncPtrAllocas.push_back(AI); | ||
240 | - } | ||
241 | - } | ||
242 | -} | ||
243 | - | ||
244 | -static void | ||
245 | -findUnusedFunctionPtrInsts(Module &M, | ||
246 | - SmallSetVector<Instruction *, 16> &FuncPtrInsts) { | ||
247 | - for (auto &F : M) { | ||
248 | - if (F.isDeclaration()) | ||
249 | - continue; | ||
250 | - for (auto &I : instructions(F)) | ||
251 | - if (I.user_empty() && isFuncPtrInst(&I)) | ||
252 | - FuncPtrInsts.insert(&I); | ||
253 | - } | ||
254 | -} | ||
255 | - | ||
256 | -static void | ||
257 | -findUnusedFunctionPtrGlbs(Module &M, | ||
258 | - SmallVectorImpl<GlobalVariable *> &FuncPtrGlbs) { | ||
259 | - for (auto &GV : M.globals()) { | ||
260 | - if (!GV.user_empty()) | ||
261 | - continue; | ||
262 | - auto *GVType = dyn_cast<PointerType>(GV.getType()->getElementType()); | ||
263 | - if (GVType && GVType->getElementType()->isFunctionTy()) | ||
264 | - FuncPtrGlbs.push_back(&GV); | ||
265 | - } | ||
266 | -} | ||
267 | - | ||
268 | -class SPIRVLowerOCLBlocks : public ModulePass { | ||
269 | - | ||
270 | -public: | ||
271 | - SPIRVLowerOCLBlocks() : ModulePass(ID) {} | ||
272 | - | ||
273 | - bool runOnModule(Module &M) { | ||
274 | - bool Changed = false; | ||
275 | - | ||
276 | - // 1. Find function pointer allocas and fix their users | ||
277 | - SmallVector<AllocaInst *, 16> FuncPtrAllocas; | ||
278 | - findFunctionPtrAllocas(M, FuncPtrAllocas); | ||
279 | - | ||
280 | - Changed |= !FuncPtrAllocas.empty(); | ||
281 | - for (auto *AI : FuncPtrAllocas) | ||
282 | - fixFunctionPtrAllocaUsers(AI); | ||
283 | - | ||
284 | - // 2. Simplify consecutive casts which use function pointer types | ||
285 | - for (auto &F : M) | ||
286 | - if (hasBlockLiteralArg(F)) | ||
287 | - Changed |= simplifyFunctionPtrCasts(F); | ||
288 | - | ||
289 | - // 3. Cleanup unused instructions with function pointer type | ||
290 | - // which are occured after pp. 1-2 | ||
291 | - SmallSetVector<Instruction *, 16> FuncPtrInsts; | ||
292 | - findUnusedFunctionPtrInsts(M, FuncPtrInsts); | ||
293 | - | ||
294 | - Changed |= !FuncPtrInsts.empty(); | ||
295 | - while (!FuncPtrInsts.empty()) { | ||
296 | - Instruction *I = FuncPtrInsts.pop_back_val(); | ||
297 | - removeUnusedFunctionPtrInst(I, FuncPtrInsts); | ||
298 | - } | ||
299 | - | ||
300 | - // 4. Find and remove unused global variables with function pointer type | ||
301 | - SmallVector<GlobalVariable *, 16> FuncPtrGlbs; | ||
302 | - findUnusedFunctionPtrGlbs(M, FuncPtrGlbs); | ||
303 | - | ||
304 | - Changed |= !FuncPtrGlbs.empty(); | ||
305 | - for (auto *GV : FuncPtrGlbs) | ||
306 | - GV->eraseFromParent(); | ||
307 | - | ||
308 | - return Changed; | ||
309 | - } | ||
310 | - | ||
311 | - static char ID; | ||
312 | -}; // class SPIRVLowerOCLBlocks | ||
313 | - | ||
314 | -char SPIRVLowerOCLBlocks::ID = 0; | ||
315 | - | ||
316 | -} // namespace | ||
317 | - | ||
318 | -INITIALIZE_PASS( | ||
319 | - SPIRVLowerOCLBlocks, "spv-lower-ocl-blocks", | ||
320 | - "Remove function pointers occured in case of using OpenCL blocks", false, | ||
321 | - false) | ||
322 | - | ||
323 | -llvm::ModulePass *llvm::createSPIRVLowerOCLBlocks() { | ||
324 | - return new SPIRVLowerOCLBlocks(); | ||
325 | -} | ||
326 | +//===- SPIRVLowerOCLBlocks.cpp - OCL Utilities ----------------------------===// | ||
327 | +// | ||
328 | +// The LLVM/SPIRV Translator | ||
329 | +// | ||
330 | +// This file is distributed under the University of Illinois Open Source | ||
331 | +// License. See LICENSE.TXT for details. | ||
332 | +// | ||
333 | +// Copyright (c) 2018 Intel Corporation. All rights reserved. | ||
334 | +// | ||
335 | +// Permission is hereby granted, free of charge, to any person obtaining a | ||
336 | +// copy of this software and associated documentation files (the "Software"), | ||
337 | +// to deal with the Software without restriction, including without limitation | ||
338 | +// the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
339 | +// and/or sell copies of the Software, and to permit persons to whom the | ||
340 | +// Software is furnished to do so, subject to the following conditions: | ||
341 | +// | ||
342 | +// Redistributions of source code must retain the above copyright notice, | ||
343 | +// this list of conditions and the following disclaimers. | ||
344 | +// Redistributions in binary form must reproduce the above copyright notice, | ||
345 | +// this list of conditions and the following disclaimers in the documentation | ||
346 | +// and/or other materials provided with the distribution. | ||
347 | +// Neither the names of Intel Corporation, nor the names of its | ||
348 | +// contributors may be used to endorse or promote products derived from this | ||
349 | +// Software without specific prior written permission. | ||
350 | +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
351 | +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
352 | +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
353 | +// CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
354 | +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
355 | +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH | ||
356 | +// THE SOFTWARE. | ||
357 | +// | ||
358 | +//===----------------------------------------------------------------------===// | ||
359 | +// | ||
360 | +// SPIR-V specification doesn't allow function pointers, so SPIR-V translator | ||
361 | +// is designed to fail if a value with function type (except calls) is occured. | ||
362 | +// Currently there is only two cases, when function pointers are generating in | ||
363 | +// LLVM IR in OpenCL - block calls and device side enqueue built-in calls. | ||
364 | +// | ||
365 | +// In both cases values with function type used as intermediate representation | ||
366 | +// for block literal structure. | ||
367 | +// | ||
368 | +// In LLVM IR produced by clang, blocks are represented with the following | ||
369 | +// structure: | ||
370 | +// %struct.__opencl_block_literal_generic = type { i32, i32, i8 addrspace(4)* } | ||
371 | +// Pointers to block invoke functions are stored in the third field. Clang | ||
372 | +// replaces inderect function calls in all cases except if block is passed as a | ||
373 | +// function argument. Note that it is somewhat unclear if the OpenCL C spec | ||
374 | +// should allow passing blocks as function argumernts. This pass is not supposed | ||
375 | +// to work correctly with such functions. | ||
376 | +// Clang though has to store function pointers to this structure. Purpose of | ||
377 | +// this pass is to replace store of function pointers(not allowed in SPIR-V) | ||
378 | +// with null pointers. | ||
379 | +// | ||
380 | +//===----------------------------------------------------------------------===// | ||
381 | +#define DEBUG_TYPE "spv-lower-ocl-blocks" | ||
382 | + | ||
383 | +#include "SPIRVInternal.h" | ||
384 | + | ||
385 | +#include "llvm/IR/Module.h" | ||
386 | +#include "llvm/Pass.h" | ||
387 | +#include "llvm/Support/Regex.h" | ||
388 | + | ||
389 | +using namespace llvm; | ||
390 | + | ||
391 | +namespace { | ||
392 | + | ||
393 | +static bool isBlockInvoke(Function &F) { | ||
394 | + static Regex BlockInvokeRegex("_block_invoke_?[0-9]*$"); | ||
395 | + return BlockInvokeRegex.match(F.getName()); | ||
396 | +} | ||
397 | + | ||
398 | +class SPIRVLowerOCLBlocks : public ModulePass { | ||
399 | + | ||
400 | +public: | ||
401 | + SPIRVLowerOCLBlocks() : ModulePass(ID) {} | ||
402 | + | ||
403 | + bool runOnModule(Module &M) { | ||
404 | + bool Changed = false; | ||
405 | + for (Function &F : M) { | ||
406 | + if (!isBlockInvoke(F)) | ||
407 | + continue; | ||
408 | + for (User *U : F.users()) { | ||
409 | + if (!isa<Constant>(U)) | ||
410 | + continue; | ||
411 | + Constant *Null = Constant::getNullValue(U->getType()); | ||
412 | + if (U != Null) { | ||
413 | + U->replaceAllUsesWith(Null); | ||
414 | + Changed = true; | ||
415 | + } | ||
416 | + } | ||
417 | + } | ||
418 | + return Changed; | ||
419 | + } | ||
420 | + | ||
421 | + static char ID; | ||
422 | +}; | ||
423 | + | ||
424 | +char SPIRVLowerOCLBlocks::ID = 0; | ||
425 | + | ||
426 | +} // namespace | ||
427 | + | ||
428 | +INITIALIZE_PASS( | ||
429 | + SPIRVLowerOCLBlocks, "spv-lower-ocl-blocks", | ||
430 | + "Remove function pointers occured in case of using OpenCL blocks", false, | ||
431 | + false) | ||
432 | + | ||
433 | +llvm::ModulePass *llvm::createSPIRVLowerOCLBlocks() { | ||
434 | + return new SPIRVLowerOCLBlocks(); | ||
435 | +} | ||
436 | diff --git a/test/global_block.ll b/test/global_block.ll | ||
437 | index a9267d8..efb4cf3 100644 | ||
438 | --- a/test/global_block.ll | ||
439 | +++ b/test/global_block.ll | ||
440 | @@ -16,7 +16,7 @@ | ||
441 | ; RUN: llvm-spirv %t.bc -o %t.spv | ||
442 | ; RUN: llvm-spirv -r %t.spv -o - | llvm-dis | FileCheck %s --check-prefix=CHECK-LLVM | ||
443 | |||
444 | -target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64" | ||
445 | +target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
446 | target triple = "spir-unknown-unknown" | ||
447 | |||
448 | ; CHECK-SPIRV: Name [[block_invoke:[0-9]+]] "_block_invoke" | ||
449 | @@ -26,71 +26,56 @@ target triple = "spir-unknown-unknown" | ||
450 | ; CHECK-SPIRV: TypePointer [[int8Ptr:[0-9]+]] 8 [[int8]] | ||
451 | ; CHECK-SPIRV: TypeFunction [[block_invoke_type:[0-9]+]] [[int]] [[int8Ptr]] [[int]] | ||
452 | |||
453 | -;; This variable is not needed in SPIRV | ||
454 | -; CHECK-SPIRV-NOT: Name {{[0-9]+}} block_kernel.b1 | ||
455 | -; CHECK-LLVM-NOT: @block_kernel.b1 | ||
456 | -@block_kernel.b1 = internal addrspace(2) constant i32 (i32) addrspace(4)* addrspacecast (i32 (i32) addrspace(1)* bitcast ({ i32, i32 } addrspace(1)* @__block_literal_global to i32 (i32) addrspace(1)*) to i32 (i32) addrspace(4)*), align 8 | ||
457 | +%struct.__opencl_block_literal_generic = type { i32, i32, i8 addrspace(4)* } | ||
458 | |||
459 | -@__block_literal_global = internal addrspace(1) constant { i32, i32 } { i32 8, i32 4 }, align 4 | ||
460 | +@block_kernel.b1 = internal addrspace(2) constant %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* @__block_literal_global to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), align 4 | ||
461 | +@__block_literal_global = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 12, i32 4, i8 addrspace(4)* addrspacecast (i8* bitcast (i32 (i8 addrspace(4)*, i32)* @_block_invoke to i8*) to i8 addrspace(4)*) }, align 4 | ||
462 | |||
463 | -; Function Attrs: convergent nounwind | ||
464 | -define spir_kernel void @block_kernel(i32 addrspace(1)* %res) #0 !kernel_arg_addr_space !4 !kernel_arg_access_qual !5 !kernel_arg_type !6 !kernel_arg_base_type !6 !kernel_arg_type_qual !7 { | ||
465 | +; Function Attrs: convergent noinline nounwind optnone | ||
466 | +define spir_kernel void @block_kernel(i32 addrspace(1)* %res) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 { | ||
467 | entry: | ||
468 | - %res.addr = alloca i32 addrspace(1)*, align 8 | ||
469 | - store i32 addrspace(1)* %res, i32 addrspace(1)** %res.addr, align 8, !tbaa !10 | ||
470 | - | ||
471 | + %res.addr = alloca i32 addrspace(1)*, align 4 | ||
472 | + store i32 addrspace(1)* %res, i32 addrspace(1)** %res.addr, align 4 | ||
473 | ; CHECK-SPIRV: FunctionCall [[int]] {{[0-9]+}} [[block_invoke]] {{[0-9]+}} [[five]] | ||
474 | ; CHECK-LLVM: %call = call spir_func i32 @_block_invoke(i8 addrspace(4)* {{.*}}, i32 5) | ||
475 | - %call = call spir_func i32 @_block_invoke(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32 } addrspace(1)* @__block_literal_global to i8 addrspace(1)*) to i8 addrspace(4)*), i32 5) #2 | ||
476 | - | ||
477 | - %0 = load i32 addrspace(1)*, i32 addrspace(1)** %res.addr, align 8, !tbaa !10 | ||
478 | - store i32 %call, i32 addrspace(1)* %0, align 4, !tbaa !14 | ||
479 | + %call = call spir_func i32 @_block_invoke(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* @__block_literal_global to i8 addrspace(1)*) to i8 addrspace(4)*), i32 5) #2 | ||
480 | + %0 = load i32 addrspace(1)*, i32 addrspace(1)** %res.addr, align 4 | ||
481 | + store i32 %call, i32 addrspace(1)* %0, align 4 | ||
482 | ret void | ||
483 | } | ||
484 | |||
485 | -; CHECK-SPIRV: 5 Function [[int]] [[block_invoke]] 0 [[block_invoke_type]] | ||
486 | +; CHECK-SPIRV: 5 Function [[int]] [[block_invoke]] 2 [[block_invoke_type]] | ||
487 | ; CHECK-SPIRV-NEXT: 3 FunctionParameter [[int8Ptr]] {{[0-9]+}} | ||
488 | ; CHECK-SPIRV-NEXT: 3 FunctionParameter [[int]] {{[0-9]+}} | ||
489 | ; CHECK-LLVM: define internal spir_func i32 @_block_invoke(i8 addrspace(4)* {{.*}}, i32 %{{.*}}) | ||
490 | -; Function Attrs: convergent nounwind | ||
491 | +; Function Attrs: convergent noinline nounwind optnone | ||
492 | define internal spir_func i32 @_block_invoke(i8 addrspace(4)* %.block_descriptor, i32 %i) #1 { | ||
493 | entry: | ||
494 | - %.block_descriptor.addr = alloca i8 addrspace(4)*, align 8 | ||
495 | + %.block_descriptor.addr = alloca i8 addrspace(4)*, align 4 | ||
496 | %i.addr = alloca i32, align 4 | ||
497 | - store i8 addrspace(4)* %.block_descriptor, i8 addrspace(4)** %.block_descriptor.addr, align 8 | ||
498 | - %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32 }> addrspace(4)* | ||
499 | - store i32 %i, i32* %i.addr, align 4, !tbaa !14 | ||
500 | - %0 = load i32, i32* %i.addr, align 4, !tbaa !14 | ||
501 | + %block.addr = alloca <{ i32, i32, i8 addrspace(4)* }> addrspace(4)*, align 4 | ||
502 | + store i8 addrspace(4)* %.block_descriptor, i8 addrspace(4)** %.block_descriptor.addr, align 4 | ||
503 | + %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* | ||
504 | + store i32 %i, i32* %i.addr, align 4 | ||
505 | + store <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* %block, <{ i32, i32, i8 addrspace(4)* }> addrspace(4)** %block.addr, align 4 | ||
506 | + %0 = load i32, i32* %i.addr, align 4 | ||
507 | %add = add nsw i32 %0, 1 | ||
508 | ret i32 %add | ||
509 | } | ||
510 | |||
511 | -attributes #0 = { convergent nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
512 | -attributes #1 = { convergent nounwind "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
513 | +attributes #0 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
514 | +attributes #1 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
515 | attributes #2 = { convergent } | ||
516 | |||
517 | !llvm.module.flags = !{!0} | ||
518 | -!opencl.enable.FP_CONTRACT = !{} | ||
519 | !opencl.ocl.version = !{!1} | ||
520 | !opencl.spir.version = !{!1} | ||
521 | -!opencl.used.extensions = !{!2} | ||
522 | -!opencl.used.optional.core.features = !{!2} | ||
523 | -!opencl.compiler.options = !{!2} | ||
524 | -!llvm.ident = !{!3} | ||
525 | +!llvm.ident = !{!2} | ||
526 | |||
527 | !0 = !{i32 1, !"wchar_size", i32 4} | ||
528 | !1 = !{i32 2, i32 0} | ||
529 | -!2 = !{} | ||
530 | -!3 = !{!"clang version 7.0.0"} | ||
531 | -!4 = !{i32 1} | ||
532 | -!5 = !{!"none"} | ||
533 | -!6 = !{!"int*"} | ||
534 | -!7 = !{!""} | ||
535 | -!8 = !{i1 false} | ||
536 | -!9 = !{i32 0} | ||
537 | -!10 = !{!11, !11, i64 0} | ||
538 | -!11 = !{!"any pointer", !12, i64 0} | ||
539 | -!12 = !{!"omnipotent char", !13, i64 0} | ||
540 | -!13 = !{!"Simple C/C++ TBAA"} | ||
541 | -!14 = !{!15, !15, i64 0} | ||
542 | -!15 = !{!"int", !12, i64 0} | ||
543 | +!2 = !{!"clang version 9.0.0 (https://llvm.org/git/clang 04fb8964a801a5c5d7baa5a22272243a7d183896) (https://llvm.org/git/llvm 384f64397f6ad95a361b72d62c07d7bac9f24163)"} | ||
544 | +!3 = !{i32 1} | ||
545 | +!4 = !{!"none"} | ||
546 | +!5 = !{!"int*"} | ||
547 | +!6 = !{!""} | ||
548 | diff --git a/test/literal-struct.ll b/test/literal-struct.ll | ||
549 | index c52170a..52a731a 100644 | ||
550 | --- a/test/literal-struct.ll | ||
551 | +++ b/test/literal-struct.ll | ||
552 | @@ -2,7 +2,7 @@ | ||
553 | ; structs, i.e. structs whose type has no name. Typicaly clang generate such | ||
554 | ; structs if the kernel contains OpenCL 2.0 blocks. The IR was produced with | ||
555 | ; the following command: | ||
556 | -; clang -cc1 -triple spir -cl-std=cl2.0 -O0 -finclude-default-header literal-struct.cl -emit-llvm -o test/literal-struct.ll | ||
557 | +; clang -cc1 -triple spir -cl-std=cl2.0 -O0 literal-struct.cl -emit-llvm -o test/literal-struct.ll | ||
558 | |||
559 | ; literal-struct.cl: | ||
560 | ; void foo() | ||
561 | @@ -14,25 +14,28 @@ | ||
562 | ; RUN: llvm-as < %s | llvm-spirv -spirv-text -o %t | ||
563 | ; RUN: FileCheck < %t %s | ||
564 | |||
565 | -; CHECK-DAG: TypeInt [[Int:[0-9]+]] 32 0 | ||
566 | -; CHECK-DAG: TypeStruct [[StructType:[0-9]+]] [[Int]] [[Int]] {{$}} | ||
567 | +; CHECK: TypeInt [[Int:[0-9]+]] 32 0 | ||
568 | +; CHECK: TypeInt [[Int8:[0-9]+]] 8 0 | ||
569 | +; CHECK: TypePointer [[Int8Ptr:[0-9]+]] 8 [[Int8]] | ||
570 | +; CHECK: TypeStruct [[StructType:[0-9]+]] [[Int]] [[Int]] [[Int8Ptr]] | ||
571 | |||
572 | target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
573 | target triple = "spir" | ||
574 | |||
575 | -@__block_literal_global = internal addrspace(1) constant { i32, i32 } { i32 8, i32 4 }, align 4 | ||
576 | +%struct.__opencl_block_literal_generic = type { i32, i32, i8 addrspace(4)* } | ||
577 | + | ||
578 | +@__block_literal_global = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 12, i32 4, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* @__foo_block_invoke to i8*) to i8 addrspace(4)*) }, align 4 | ||
579 | ; CHECK: ConstantComposite [[StructType]] | ||
580 | |||
581 | -; This is artificial case is added to cover ConstantNull instrucitions with TypeStruct. | ||
582 | -@__block_literal_global.1 = internal addrspace(1) constant { i32, i32 } zeroinitializer, align 4 | ||
583 | +@__block_literal_global.1 = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } zeroinitializer, align 4 | ||
584 | ; CHECK: ConstantNull [[StructType]] | ||
585 | |||
586 | ; Function Attrs: convergent noinline nounwind optnone | ||
587 | define spir_func void @foo() #0 { | ||
588 | entry: | ||
589 | - %myBlock = alloca void () addrspace(4)*, align 4 | ||
590 | - store void () addrspace(4)* addrspacecast (void () addrspace(1)* bitcast ({ i32, i32 } addrspace(1)* @__block_literal_global to void () addrspace(1)*) to void () addrspace(4)*), void () addrspace(4)** %myBlock, align 4 | ||
591 | - call spir_func void @__foo_block_invoke(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32 } addrspace(1)* @__block_literal_global to i8 addrspace(1)*) to i8 addrspace(4)*)) #1 | ||
592 | + %myBlock = alloca %struct.__opencl_block_literal_generic addrspace(4)*, align 4 | ||
593 | + store %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* @__block_literal_global to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), %struct.__opencl_block_literal_generic addrspace(4)** %myBlock, align 4 | ||
594 | + call spir_func void @__foo_block_invoke(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* @__block_literal_global to i8 addrspace(1)*) to i8 addrspace(4)*)) #1 | ||
595 | ret void | ||
596 | } | ||
597 | |||
598 | @@ -40,14 +43,14 @@ entry: | ||
599 | define internal spir_func void @__foo_block_invoke(i8 addrspace(4)* %.block_descriptor) #0 { | ||
600 | entry: | ||
601 | %.block_descriptor.addr = alloca i8 addrspace(4)*, align 4 | ||
602 | - %block.addr = alloca <{ i32, i32 }> addrspace(4)*, align 4 | ||
603 | + %block.addr = alloca <{ i32, i32, i8 addrspace(4)* }> addrspace(4)*, align 4 | ||
604 | store i8 addrspace(4)* %.block_descriptor, i8 addrspace(4)** %.block_descriptor.addr, align 4 | ||
605 | - %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32 }> addrspace(4)* | ||
606 | - store <{ i32, i32 }> addrspace(4)* %block, <{ i32, i32 }> addrspace(4)** %block.addr, align 4 | ||
607 | + %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* | ||
608 | + store <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* %block, <{ i32, i32, i8 addrspace(4)* }> addrspace(4)** %block.addr, align 4 | ||
609 | ret void | ||
610 | } | ||
611 | |||
612 | -attributes #0 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
613 | +attributes #0 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
614 | attributes #1 = { convergent } | ||
615 | |||
616 | !llvm.module.flags = !{!0} | ||
617 | @@ -57,4 +60,4 @@ attributes #1 = { convergent } | ||
618 | |||
619 | !0 = !{i32 1, !"wchar_size", i32 4} | ||
620 | !1 = !{i32 2, i32 0} | ||
621 | -!2 = !{!"clang version 8.0.0 "} | ||
622 | +!2 = !{!"clang version 9.0.0 (https://llvm.org/git/clang 04fb8964a801a5c5d7baa5a22272243a7d183896) (https://llvm.org/git/llvm 384f64397f6ad95a361b72d62c07d7bac9f24163)"} | ||
623 | diff --git a/test/transcoding/block_w_struct_return.ll b/test/transcoding/block_w_struct_return.ll | ||
624 | index 76e29f0..df89b13 100644 | ||
625 | --- a/test/transcoding/block_w_struct_return.ll | ||
626 | +++ b/test/transcoding/block_w_struct_return.ll | ||
627 | @@ -16,6 +16,8 @@ | ||
628 | ; res[tid] = kernelBlock(aa).a - 6; | ||
629 | ; } | ||
630 | |||
631 | +; clang -cc1 -triple spir -cl-std=cl2.0 -disable-llvm-passes -finclude-default-header block_w_struct_return.cl -emit-llvm -o test/transcoding/block_w_struct_return.ll | ||
632 | + | ||
633 | ; RUN: llvm-as %s -o %t.bc | ||
634 | ; RUN: llvm-spirv %t.bc -spirv-text -o %t.spv.txt | ||
635 | ; RUN: FileCheck < %t.spv.txt %s --check-prefix=CHECK-SPIRV | ||
636 | @@ -27,12 +29,14 @@ | ||
637 | ; CHECK-SPIRV: Name [[BlockInv:[0-9]+]] "__block_ret_struct_block_invoke" | ||
638 | |||
639 | ; CHECK-SPIRV: 4 TypeInt [[IntTy:[0-9]+]] 32 | ||
640 | +; CHECK-SPIRV: 4 TypeInt [[Int8Ty:[0-9]+]] 8 | ||
641 | +; CHECK-SPIRV: 4 TypePointer [[Int8Ptr:[0-9]+]] 8 [[Int8Ty]] | ||
642 | ; CHECK-SPIRV: 3 TypeStruct [[StructTy:[0-9]+]] [[IntTy]] | ||
643 | ; CHECK-SPIRV: 4 TypePointer [[StructPtrTy:[0-9]+]] 7 [[StructTy]] | ||
644 | |||
645 | ; CHECK-SPIRV: 4 Variable [[StructPtrTy]] [[StructArg:[0-9]+]] 7 | ||
646 | ; CHECK-SPIRV: 4 Variable [[StructPtrTy]] [[StructRet:[0-9]+]] 7 | ||
647 | -; CHECK-SPIRV: 4 PtrCastToGeneric {{[0-9]+}} [[BlockLit:[0-9]+]] {{[0-9]+}} | ||
648 | +; CHECK-SPIRV: 4 PtrCastToGeneric [[Int8Ptr]] [[BlockLit:[0-9]+]] {{[0-9]+}} | ||
649 | ; CHECK-SPIRV: 7 FunctionCall {{[0-9]+}} {{[0-9]+}} [[BlockInv]] [[StructRet]] [[BlockLit]] [[StructArg]] | ||
650 | |||
651 | ; CHECK-LLVM: %[[StructA:.*]] = type { i32 } | ||
652 | @@ -41,20 +45,21 @@ | ||
653 | target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
654 | target triple = "spir64-unknown-unknown" | ||
655 | |||
656 | +%struct.__opencl_block_literal_generic = type { i32, i32, i8 addrspace(4)* } | ||
657 | %struct.A = type { i32 } | ||
658 | |||
659 | -@__block_literal_global = internal addrspace(1) constant { i32, i32 } { i32 8, i32 4 }, align 4 | ||
660 | +@__block_literal_global = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 16, i32 8, i8 addrspace(4)* addrspacecast (i8* bitcast (void (%struct.A*, i8 addrspace(4)*, %struct.A*)* @__block_ret_struct_block_invoke to i8*) to i8 addrspace(4)*) }, align 8 | ||
661 | |||
662 | ; Function Attrs: convergent noinline nounwind optnone | ||
663 | -define spir_kernel void @block_ret_struct(i32 addrspace(1)* %res) #0 !kernel_arg_addr_space !4 !kernel_arg_access_qual !5 !kernel_arg_type !6 !kernel_arg_base_type !6 !kernel_arg_type_qual !7 !kernel_arg_host_accessible !8 !kernel_arg_pipe_depth !9 !kernel_arg_pipe_io !7 !kernel_arg_buffer_location !7 { | ||
664 | +define spir_kernel void @block_ret_struct(i32 addrspace(1)* %res) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 { | ||
665 | entry: | ||
666 | %res.addr = alloca i32 addrspace(1)*, align 8 | ||
667 | - %kernelBlock = alloca void (%struct.A*, %struct.A*) addrspace(4)*, align 8 | ||
668 | + %kernelBlock = alloca %struct.__opencl_block_literal_generic addrspace(4)*, align 8 | ||
669 | %tid = alloca i64, align 8 | ||
670 | %aa = alloca %struct.A, align 4 | ||
671 | %tmp = alloca %struct.A, align 4 | ||
672 | store i32 addrspace(1)* %res, i32 addrspace(1)** %res.addr, align 8 | ||
673 | - store void (%struct.A*, %struct.A*) addrspace(4)* addrspacecast (void (%struct.A*, %struct.A*) addrspace(1)* bitcast ({ i32, i32 } addrspace(1)* @__block_literal_global to void (%struct.A*, %struct.A*) addrspace(1)*) to void (%struct.A*, %struct.A*) addrspace(4)*), void (%struct.A*, %struct.A*) addrspace(4)** %kernelBlock, align 8 | ||
674 | + store %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* @__block_literal_global to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), %struct.__opencl_block_literal_generic addrspace(4)** %kernelBlock, align 8 | ||
675 | %call = call spir_func i64 @_Z13get_global_idj(i32 0) #4 | ||
676 | store i64 %call, i64* %tid, align 8 | ||
677 | %0 = load i32 addrspace(1)*, i32 addrspace(1)** %res.addr, align 8 | ||
678 | @@ -63,7 +68,7 @@ entry: | ||
679 | store i32 -1, i32 addrspace(1)* %arrayidx, align 4 | ||
680 | %a = getelementptr inbounds %struct.A, %struct.A* %aa, i32 0, i32 0 | ||
681 | store i32 5, i32* %a, align 4 | ||
682 | - call spir_func void @__block_ret_struct_block_invoke(%struct.A* sret %tmp, i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32 } addrspace(1)* @__block_literal_global to i8 addrspace(1)*) to i8 addrspace(4)*), %struct.A* byval align 4 %aa) #5 | ||
683 | + call spir_func void @__block_ret_struct_block_invoke(%struct.A* sret %tmp, i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* @__block_literal_global to i8 addrspace(1)*) to i8 addrspace(4)*), %struct.A* byval align 4 %aa) #5 | ||
684 | %a1 = getelementptr inbounds %struct.A, %struct.A* %tmp, i32 0, i32 0 | ||
685 | %2 = load i32, i32* %a1, align 4 | ||
686 | %sub = sub nsw i32 %2, 6 | ||
687 | @@ -78,10 +83,10 @@ entry: | ||
688 | define internal spir_func void @__block_ret_struct_block_invoke(%struct.A* noalias sret %agg.result, i8 addrspace(4)* %.block_descriptor, %struct.A* byval align 4 %a) #1 { | ||
689 | entry: | ||
690 | %.block_descriptor.addr = alloca i8 addrspace(4)*, align 8 | ||
691 | - %block.addr = alloca <{ i32, i32 }> addrspace(4)*, align 8 | ||
692 | + %block.addr = alloca <{ i32, i32, i8 addrspace(4)* }> addrspace(4)*, align 8 | ||
693 | store i8 addrspace(4)* %.block_descriptor, i8 addrspace(4)** %.block_descriptor.addr, align 8 | ||
694 | - %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32 }> addrspace(4)* | ||
695 | - store <{ i32, i32 }> addrspace(4)* %block, <{ i32, i32 }> addrspace(4)** %block.addr, align 8 | ||
696 | + %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* | ||
697 | + store <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* %block, <{ i32, i32, i8 addrspace(4)* }> addrspace(4)** %block.addr, align 8 | ||
698 | %a1 = getelementptr inbounds %struct.A, %struct.A* %a, i32 0, i32 0 | ||
699 | store i32 6, i32* %a1, align 4 | ||
700 | %0 = bitcast %struct.A* %agg.result to i8* | ||
701 | @@ -96,30 +101,22 @@ declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture r | ||
702 | ; Function Attrs: convergent nounwind readnone | ||
703 | declare spir_func i64 @_Z13get_global_idj(i32) #3 | ||
704 | |||
705 | -attributes #0 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
706 | -attributes #1 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
707 | +attributes #0 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
708 | +attributes #1 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
709 | attributes #2 = { argmemonly nounwind } | ||
710 | attributes #3 = { convergent nounwind readnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
711 | attributes #4 = { convergent nounwind readnone } | ||
712 | attributes #5 = { convergent } | ||
713 | |||
714 | !llvm.module.flags = !{!0} | ||
715 | -!opencl.enable.FP_CONTRACT = !{} | ||
716 | !opencl.ocl.version = !{!1} | ||
717 | !opencl.spir.version = !{!1} | ||
718 | -!opencl.used.extensions = !{!2} | ||
719 | -!opencl.used.optional.core.features = !{!2} | ||
720 | -!opencl.compiler.options = !{!2} | ||
721 | -!llvm.ident = !{!3} | ||
722 | +!llvm.ident = !{!2} | ||
723 | |||
724 | !0 = !{i32 1, !"wchar_size", i32 4} | ||
725 | !1 = !{i32 2, i32 0} | ||
726 | -!2 = !{} | ||
727 | -!3 = !{!"clang version 7.0.0"} | ||
728 | -!4 = !{i32 1} | ||
729 | -!5 = !{!"none"} | ||
730 | -!6 = !{!"int*"} | ||
731 | -!7 = !{!""} | ||
732 | -!8 = !{i1 false} | ||
733 | -!9 = !{i32 0} | ||
734 | - | ||
735 | +!2 = !{!"clang version 9.0.0 (https://llvm.org/git/clang 04fb8964a801a5c5d7baa5a22272243a7d183896) (https://llvm.org/git/llvm 384f64397f6ad95a361b72d62c07d7bac9f24163)"} | ||
736 | +!3 = !{i32 1} | ||
737 | +!4 = !{!"none"} | ||
738 | +!5 = !{!"int*"} | ||
739 | +!6 = !{!""} | ||
740 | diff --git a/test/transcoding/enqueue_kernel.ll b/test/transcoding/enqueue_kernel.ll | ||
741 | index 0d29c71..435871d 100644 | ||
742 | --- a/test/transcoding/enqueue_kernel.ll | ||
743 | +++ b/test/transcoding/enqueue_kernel.ll | ||
744 | @@ -51,11 +51,12 @@ | ||
745 | ; ModuleID = 'enqueue_kernel.cl' | ||
746 | source_filename = "enqueue_kernel.cl" | ||
747 | target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024" | ||
748 | -target triple = "spir-unknown-unknown" | ||
749 | +target triple = "spir" | ||
750 | |||
751 | %opencl.queue_t = type opaque | ||
752 | %struct.ndrange_t = type { i32 } | ||
753 | %opencl.clk_event_t = type opaque | ||
754 | +%struct.__opencl_block_literal_generic = type { i32, i32, i8 addrspace(4)* } | ||
755 | |||
756 | ; CHECK-SPIRV: EntryPoint {{[0-9]+}} [[BlockKer1:[0-9]+]] "__device_side_enqueue_block_invoke_kernel" | ||
757 | ; CHECK-SPIRV: EntryPoint {{[0-9]+}} [[BlockKer2:[0-9]+]] "__device_side_enqueue_block_invoke_2_kernel" | ||
758 | @@ -66,89 +67,123 @@ target triple = "spir-unknown-unknown" | ||
759 | |||
760 | ; CHECK-SPIRV: TypeInt [[Int32Ty:[0-9]+]] 32 | ||
761 | ; CHECK-SPIRV: TypeInt [[Int8Ty:[0-9]+]] 8 | ||
762 | -; CHECK-SPIRV: Constant [[Int32Ty]] [[ConstInt8:[0-9]+]] 8 | ||
763 | ; CHECK-SPIRV: Constant [[Int32Ty]] [[ConstInt0:[0-9]+]] 0 | ||
764 | -; CHECK-SPIRV: Constant [[Int32Ty]] [[ConstInt17:[0-9]+]] 17 | ||
765 | +; CHECK-SPIRV: Constant [[Int32Ty]] [[ConstInt17:[0-9]+]] 21 | ||
766 | ; CHECK-SPIRV: Constant [[Int32Ty]] [[ConstInt2:[0-9]+]] 2 | ||
767 | -; CHECK-SPIRV: Constant [[Int32Ty]] [[ConstInt20:[0-9]+]] 20 | ||
768 | -; CHECK-SPIRV: TypeVoid [[VoidTy:[0-9]+]] | ||
769 | +; CHECK-SPIRV: Constant [[Int32Ty]] [[ConstInt8:[0-9]+]] 8 | ||
770 | +; CHECK-SPIRV: Constant [[Int32Ty]] [[ConstInt20:[0-9]+]] 24 | ||
771 | |||
772 | ; CHECK-SPIRV: TypePointer {{[0-9]+}} 7 {{[0-9]+}} | ||
773 | +; CHECK-SPIRV: TypePointer [[Int8PtrGenTy:[0-9]+]] 8 [[Int8Ty]] | ||
774 | +; CHECK-SPIRV: TypeVoid [[VoidTy:[0-9]+]] | ||
775 | ; CHECK-SPIRV: TypePointer [[Int32LocPtrTy:[0-9]+]] 7 [[Int32Ty]] | ||
776 | ; CHECK-SPIRV: TypeDeviceEvent [[EventTy:[0-9]+]] | ||
777 | -; CHECK-SPIRV: TypePointer [[Int8PtrGenTy:[0-9]+]] 8 [[Int8Ty]] | ||
778 | ; CHECK-SPIRV: TypePointer [[EventPtrTy:[0-9]+]] 8 [[EventTy]] | ||
779 | ; CHECK-SPIRV: TypeFunction [[BlockTy1:[0-9]+]] [[VoidTy]] [[Int8PtrGenTy]] | ||
780 | ; CHECK-SPIRV: TypeFunction [[BlockTy2:[0-9]+]] [[VoidTy]] [[Int8PtrGenTy]] | ||
781 | ; CHECK-SPIRV: TypeFunction [[BlockTy3:[0-9]+]] [[VoidTy]] [[Int8PtrGenTy]] | ||
782 | ; CHECK-SPIRV: ConstantNull [[EventPtrTy]] [[EventNull:[0-9]+]] | ||
783 | |||
784 | -; CHECK-LLVM: [[BlockTy1:%[0-9]+]] = type { i32, i32 } | ||
785 | -; CHECK-LLVM: [[BlockTy2:%[0-9]+]] = type <{ i32, i32, i32 addrspace(1)*, i32, i8 }> | ||
786 | -; CHECK-LLVM: [[BlockTy3:%[0-9]+]] = type <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> | ||
787 | -; CHECK-LLVM: [[BlockTy4:%[0-9]+]] = type <{ i32, i32 }> | ||
788 | +; CHECK-LLVM: [[BlockTy1:%[0-9]+]] = type { i32, i32, i8 addrspace(4)* } | ||
789 | +; CHECK-LLVM: [[BlockTy2:%[0-9]+]] = type <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }> | ||
790 | +; CHECK-LLVM: [[BlockTy3:%[0-9]+]] = type <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> | ||
791 | +; CHECK-LLVM: [[BlockTy4:%[0-9]+]] = type <{ i32, i32, i8 addrspace(4)* }> | ||
792 | |||
793 | -; CHECK-LLVM: @__block_literal_global = internal addrspace(1) constant [[BlockTy1]] { i32 8, i32 4 }, align 4 | ||
794 | -; CHECK-LLVM: @__block_literal_global.1 = internal addrspace(1) constant [[BlockTy1]] { i32 8, i32 4 }, align 4 | ||
795 | +; CHECK-LLVM: @__block_literal_global = internal addrspace(1) constant [[BlockTy1]] { i32 12, i32 4, i8 addrspace(4)* addrspacecast (i8* null to i8 addrspace(4)*) }, align 4 | ||
796 | +; CHECK-LLVM: @__block_literal_global.1 = internal addrspace(1) constant [[BlockTy1]] { i32 12, i32 4, i8 addrspace(4)* addrspacecast (i8* null to i8 addrspace(4)*) }, align 4 | ||
797 | |||
798 | -@__block_literal_global = internal addrspace(1) constant { i32, i32 } { i32 8, i32 4 }, align 4 | ||
799 | -@__block_literal_global.1 = internal addrspace(1) constant { i32, i32 } { i32 8, i32 4 }, align 4 | ||
800 | +@__block_literal_global = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 12, i32 4, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* @__device_side_enqueue_block_invoke_3 to i8*) to i8 addrspace(4)*) }, align 4 | ||
801 | +@__block_literal_global.1 = internal addrspace(1) constant { i32, i32, i8 addrspace(4)* } { i32 12, i32 4, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*, i8 addrspace(3)*, i8 addrspace(3)*)* @__device_side_enqueue_block_invoke_4 to i8*) to i8 addrspace(4)*) }, align 4 | ||
802 | |||
803 | ; Function Attrs: convergent noinline nounwind optnone | ||
804 | -define spir_kernel void @device_side_enqueue(i32 addrspace(1)* %a, i32 addrspace(1)* %b, i32 %i, i8 signext %c0) #0 !kernel_arg_addr_space !4 !kernel_arg_access_qual !5 !kernel_arg_type !6 !kernel_arg_base_type !6 !kernel_arg_type_qual !7 { | ||
805 | +define spir_kernel void @device_side_enqueue(i32 addrspace(1)* %a, i32 addrspace(1)* %b, i32 %i, i8 signext %c0) #0 !kernel_arg_addr_space !3 !kernel_arg_access_qual !4 !kernel_arg_type !5 !kernel_arg_base_type !5 !kernel_arg_type_qual !6 { | ||
806 | entry: | ||
807 | + %a.addr = alloca i32 addrspace(1)*, align 4 | ||
808 | + %b.addr = alloca i32 addrspace(1)*, align 4 | ||
809 | + %i.addr = alloca i32, align 4 | ||
810 | + %c0.addr = alloca i8, align 1 | ||
811 | %default_queue = alloca %opencl.queue_t*, align 4 | ||
812 | %flags = alloca i32, align 4 | ||
813 | %ndrange = alloca %struct.ndrange_t, align 4 | ||
814 | %clk_event = alloca %opencl.clk_event_t*, align 4 | ||
815 | %event_wait_list = alloca %opencl.clk_event_t*, align 4 | ||
816 | %event_wait_list2 = alloca [1 x %opencl.clk_event_t*], align 4 | ||
817 | - %block = alloca <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, align 4 | ||
818 | - %block3 = alloca <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, align 4 | ||
819 | + %block = alloca <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, align 4 | ||
820 | + %tmp = alloca %struct.ndrange_t, align 4 | ||
821 | + %block3 = alloca <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, align 4 | ||
822 | + %tmp4 = alloca %struct.ndrange_t, align 4 | ||
823 | %c = alloca i8, align 1 | ||
824 | + %tmp11 = alloca %struct.ndrange_t, align 4 | ||
825 | + %block_sizes = alloca [1 x i32], align 4 | ||
826 | + %tmp12 = alloca %struct.ndrange_t, align 4 | ||
827 | + %block_sizes13 = alloca [3 x i32], align 4 | ||
828 | + store i32 addrspace(1)* %a, i32 addrspace(1)** %a.addr, align 4 | ||
829 | + store i32 addrspace(1)* %b, i32 addrspace(1)** %b.addr, align 4 | ||
830 | + store i32 %i, i32* %i.addr, align 4 | ||
831 | + store i8 %c0, i8* %c0.addr, align 1 | ||
832 | store i32 0, i32* %flags, align 4 | ||
833 | %arrayinit.begin = getelementptr inbounds [1 x %opencl.clk_event_t*], [1 x %opencl.clk_event_t*]* %event_wait_list2, i32 0, i32 0 | ||
834 | %0 = load %opencl.clk_event_t*, %opencl.clk_event_t** %clk_event, align 4 | ||
835 | store %opencl.clk_event_t* %0, %opencl.clk_event_t** %arrayinit.begin, align 4 | ||
836 | %1 = load %opencl.queue_t*, %opencl.queue_t** %default_queue, align 4 | ||
837 | %2 = load i32, i32* %flags, align 4 | ||
838 | - %block.size = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 0 | ||
839 | - store i32 17, i32* %block.size, align 4 | ||
840 | - %block.align = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 1 | ||
841 | + %3 = bitcast %struct.ndrange_t* %tmp to i8* | ||
842 | + %4 = bitcast %struct.ndrange_t* %ndrange to i8* | ||
843 | + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %3, i8* align 4 %4, i32 4, i1 false) | ||
844 | + %block.size = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 0 | ||
845 | + store i32 21, i32* %block.size, align 4 | ||
846 | + %block.align = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 1 | ||
847 | store i32 4, i32* %block.align, align 4 | ||
848 | - %block.captured = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 2 | ||
849 | - store i32 addrspace(1)* %a, i32 addrspace(1)** %block.captured, align 4 | ||
850 | - %block.captured1 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 3 | ||
851 | - store i32 %i, i32* %block.captured1, align 4 | ||
852 | - %block.captured2 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 4 | ||
853 | - store i8 %c0, i8* %block.captured2, align 4 | ||
854 | - %3 = bitcast <{ i32, i32, i32 addrspace(1)*, i32, i8 }>* %block to void ()* | ||
855 | - %4 = addrspacecast void ()* %3 to i8 addrspace(4)* | ||
856 | + %block.invoke = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 2 | ||
857 | + store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* @__device_side_enqueue_block_invoke to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke, align 4 | ||
858 | + %block.captured = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 3 | ||
859 | + %5 = load i32 addrspace(1)*, i32 addrspace(1)** %a.addr, align 4 | ||
860 | + store i32 addrspace(1)* %5, i32 addrspace(1)** %block.captured, align 4 | ||
861 | + %block.captured1 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 4 | ||
862 | + %6 = load i32, i32* %i.addr, align 4 | ||
863 | + store i32 %6, i32* %block.captured1, align 4 | ||
864 | + %block.captured2 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>* %block, i32 0, i32 5 | ||
865 | + %7 = load i8, i8* %c0.addr, align 1 | ||
866 | + store i8 %7, i8* %block.captured2, align 4 | ||
867 | + %8 = bitcast <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>* %block to %struct.__opencl_block_literal_generic* | ||
868 | + %9 = addrspacecast %struct.__opencl_block_literal_generic* %8 to i8 addrspace(4)* | ||
869 | |||
870 | ; CHECK-SPIRV: PtrCastToGeneric [[Int8PtrGenTy]] [[BlockLit1:[0-9]+]] | ||
871 | ; CHECK-SPIRV: EnqueueKernel [[Int32Ty]] {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} {{[0-9]+}} | ||
872 | ; [[ConstInt0]] [[EventNull]] [[EventNull]] | ||
873 | ; [[BlockKer1]] [[BlockLit1]] [[ConstInt17]] [[ConstInt8]] | ||
874 | |||
875 | -; CHECK-LLVM: [[Block2:%[0-9]+]] = addrspacecast [[BlockTy2]]* %block to i8 addrspace(4)* | ||
876 | +; CHECK-LLVM: [[Block2:%[0-9]+]] = bitcast [[BlockTy2]]* %block to %struct.__opencl_block_literal_generic* | ||
877 | +; CHECK-LLVM: [[Block2Ptr:%[0-9]+]] = addrspacecast %struct.__opencl_block_literal_generic* [[Block2]] to i8 addrspace(4)* | ||
878 | ; CHECK-LLVM: [[BlockInv2:%[0-9]+]] = addrspacecast void (i8 addrspace(4)*)* @__device_side_enqueue_block_invoke_kernel to i8 addrspace(4)* | ||
879 | -; CHECK-LLVM: call i32 @__enqueue_kernel_basic_events(%opencl.queue_t* {{.*}}, i32 {{.*}}, %struct.ndrange_t* {{.*}}, i32 0, %opencl.clk_event_t* addrspace(4)* null, %opencl.clk_event_t* addrspace(4)* null, i8 addrspace(4)* [[BlockInv2]], i8 addrspace(4)* [[Block2]]) | ||
880 | - | ||
881 | - %5 = call i32 @__enqueue_kernel_basic(%opencl.queue_t* %1, i32 %2, %struct.ndrange_t* byval %ndrange, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* @__device_side_enqueue_block_invoke_kernel to i8*) to i8 addrspace(4)*), i8 addrspace(4)* %4) | ||
882 | - %6 = addrspacecast %opencl.clk_event_t** %event_wait_list to %opencl.clk_event_t* addrspace(4)* | ||
883 | - %7 = addrspacecast %opencl.clk_event_t** %clk_event to %opencl.clk_event_t* addrspace(4)* | ||
884 | - %block.size5 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 0 | ||
885 | - store i32 20, i32* %block.size5, align 4 | ||
886 | - %block.align6 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 1 | ||
887 | +; CHECK-LLVM: call i32 @__enqueue_kernel_basic_events(%opencl.queue_t* {{.*}}, i32 {{.*}}, %struct.ndrange_t* {{.*}}, i32 0, %opencl.clk_event_t* addrspace(4)* null, %opencl.clk_event_t* addrspace(4)* null, i8 addrspace(4)* [[BlockInv2]], i8 addrspace(4)* [[Block2Ptr]]) | ||
888 | + | ||
889 | + %10 = call i32 @__enqueue_kernel_basic(%opencl.queue_t* %1, i32 %2, %struct.ndrange_t* byval %tmp, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* @__device_side_enqueue_block_invoke_kernel to i8*) to i8 addrspace(4)*), i8 addrspace(4)* %9) | ||
890 | + %11 = load %opencl.queue_t*, %opencl.queue_t** %default_queue, align 4 | ||
891 | + %12 = load i32, i32* %flags, align 4 | ||
892 | + %13 = bitcast %struct.ndrange_t* %tmp4 to i8* | ||
893 | + %14 = bitcast %struct.ndrange_t* %ndrange to i8* | ||
894 | + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %13, i8* align 4 %14, i32 4, i1 false) | ||
895 | + %15 = addrspacecast %opencl.clk_event_t** %event_wait_list to %opencl.clk_event_t* addrspace(4)* | ||
896 | + %16 = addrspacecast %opencl.clk_event_t** %clk_event to %opencl.clk_event_t* addrspace(4)* | ||
897 | + %block.size5 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 0 | ||
898 | + store i32 24, i32* %block.size5, align 4 | ||
899 | + %block.align6 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 1 | ||
900 | store i32 4, i32* %block.align6, align 4 | ||
901 | - %block.captured7 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 2 | ||
902 | - store i32 addrspace(1)* %a, i32 addrspace(1)** %block.captured7, align 4 | ||
903 | - %block.captured8 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 3 | ||
904 | - store i32 %i, i32* %block.captured8, align 4 | ||
905 | - %block.captured9 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 4 | ||
906 | - store i32 addrspace(1)* %b, i32 addrspace(1)** %block.captured9, align 4 | ||
907 | - %8 = bitcast <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3 to void ()* | ||
908 | - %9 = addrspacecast void ()* %8 to i8 addrspace(4)* | ||
909 | + %block.invoke7 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 2 | ||
910 | + store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* @__device_side_enqueue_block_invoke_2 to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke7, align 4 | ||
911 | + %block.captured8 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 3 | ||
912 | + %17 = load i32 addrspace(1)*, i32 addrspace(1)** %a.addr, align 4 | ||
913 | + store i32 addrspace(1)* %17, i32 addrspace(1)** %block.captured8, align 4 | ||
914 | + %block.captured9 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 4 | ||
915 | + %18 = load i32, i32* %i.addr, align 4 | ||
916 | + store i32 %18, i32* %block.captured9, align 4 | ||
917 | + %block.captured10 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3, i32 0, i32 5 | ||
918 | + %19 = load i32 addrspace(1)*, i32 addrspace(1)** %b.addr, align 4 | ||
919 | + store i32 addrspace(1)* %19, i32 addrspace(1)** %block.captured10, align 4 | ||
920 | + %20 = bitcast <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>* %block3 to %struct.__opencl_block_literal_generic* | ||
921 | + %21 = addrspacecast %struct.__opencl_block_literal_generic* %20 to i8 addrspace(4)* | ||
922 | + | ||
923 | |||
924 | ; CHECK-SPIRV: PtrCastToGeneric [[EventPtrTy]] [[Event1:[0-9]+]] | ||
925 | ; CHECK-SPIRV: PtrCastToGeneric [[EventPtrTy]] [[Event2:[0-9]+]] | ||
926 | @@ -158,16 +193,24 @@ entry: | ||
927 | ; [[ConstInt2]] [[Event1]] [[Event2]] | ||
928 | ; [[BlockKer2]] [[BlockLit2]] [[ConstInt20]] [[ConstInt8]] | ||
929 | |||
930 | -; CHECK-LLVM: [[Block3:%[0-9]+]] = addrspacecast [[BlockTy3]]* %block3 to i8 addrspace(4)* | ||
931 | +; CHECK-LLVM: [[Block3:%[0-9]+]] = bitcast [[BlockTy3]]* %block3 to %struct.__opencl_block_literal_generic* | ||
932 | +; CHECK-LLVM: [[Block3Ptr:%[0-9]+]] = addrspacecast %struct.__opencl_block_literal_generic* [[Block3]] to i8 addrspace(4) | ||
933 | ; CHECK-LLVM: [[BlockInv3:%[0-9]+]] = addrspacecast void (i8 addrspace(4)*)* @__device_side_enqueue_block_invoke_2_kernel to i8 addrspace(4)* | ||
934 | -; CHECK-LLVM: call i32 @__enqueue_kernel_basic_events(%opencl.queue_t* {{.*}}, i32 {{.*}}, %struct.ndrange_t* {{.*}}, i32 2, %opencl.clk_event_t* addrspace(4)* {{.*}}, %opencl.clk_event_t* addrspace(4)* {{.*}}, i8 addrspace(4)* [[BlockInv3]], i8 addrspace(4)* [[Block3]]) | ||
935 | - | ||
936 | - %10 = call i32 @__enqueue_kernel_basic_events(%opencl.queue_t* %1, i32 %2, %struct.ndrange_t* %ndrange, i32 2, %opencl.clk_event_t* addrspace(4)* %6, %opencl.clk_event_t* addrspace(4)* %7, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* @__device_side_enqueue_block_invoke_2_kernel to i8*) to i8 addrspace(4)*), i8 addrspace(4)* %9) | ||
937 | - %11 = alloca [1 x i32] | ||
938 | - %12 = getelementptr [1 x i32], [1 x i32]* %11, i32 0, i32 0 | ||
939 | - %13 = load i8, i8* %c, align 1 | ||
940 | - %14 = zext i8 %13 to i32 | ||
941 | - store i32 %14, i32* %12, align 4 | ||
942 | +; CHECK-LLVM: call i32 @__enqueue_kernel_basic_events(%opencl.queue_t* {{.*}}, i32 {{.*}}, %struct.ndrange_t* {{.*}}, i32 2, %opencl.clk_event_t* addrspace(4)* {{.*}}, %opencl.clk_event_t* addrspace(4)* {{.*}}, i8 addrspace(4)* [[BlockInv3]], i8 addrspace(4)* [[Block3Ptr]]) | ||
943 | + | ||
944 | + %22 = call i32 @__enqueue_kernel_basic_events(%opencl.queue_t* %11, i32 %12, %struct.ndrange_t* %tmp4, i32 2, %opencl.clk_event_t* addrspace(4)* %15, %opencl.clk_event_t* addrspace(4)* %16, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* @__device_side_enqueue_block_invoke_2_kernel to i8*) to i8 addrspace(4)*), i8 addrspace(4)* %21) | ||
945 | + %23 = load %opencl.queue_t*, %opencl.queue_t** %default_queue, align 4 | ||
946 | + %24 = load i32, i32* %flags, align 4 | ||
947 | + %25 = bitcast %struct.ndrange_t* %tmp11 to i8* | ||
948 | + %26 = bitcast %struct.ndrange_t* %ndrange to i8* | ||
949 | + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %25, i8* align 4 %26, i32 4, i1 false) | ||
950 | + %arraydecay = getelementptr inbounds [1 x %opencl.clk_event_t*], [1 x %opencl.clk_event_t*]* %event_wait_list2, i32 0, i32 0 | ||
951 | + %27 = addrspacecast %opencl.clk_event_t** %arraydecay to %opencl.clk_event_t* addrspace(4)* | ||
952 | + %28 = addrspacecast %opencl.clk_event_t** %clk_event to %opencl.clk_event_t* addrspace(4)* | ||
953 | + %29 = getelementptr [1 x i32], [1 x i32]* %block_sizes, i32 0, i32 0 | ||
954 | + %30 = load i8, i8* %c, align 1 | ||
955 | + %31 = zext i8 %30 to i32 | ||
956 | + store i32 %31, i32* %29, align 4 | ||
957 | |||
958 | ; CHECK-SPIRV: PtrAccessChain [[Int32LocPtrTy]] [[LocalBuf31:[0-9]+]] | ||
959 | ; CHECK-SPIRV: Bitcast {{[0-9]+}} [[BlockLit3Tmp:[0-9]+]] [[BlockGlb1:[0-9]+]] | ||
960 | @@ -182,14 +225,18 @@ entry: | ||
961 | ; CHECK-LLVM: [[BlockInv0:%[0-9]+]] = addrspacecast void (i8 addrspace(4)*, i8 addrspace(3)*)* @__device_side_enqueue_block_invoke_3_kernel to i8 addrspace(4)* | ||
962 | ; CHECK-LLVM: call i32 @__enqueue_kernel_events_varargs(%opencl.queue_t* {{.*}}, i32 {{.*}}, %struct.ndrange_t* {{.*}}, i32 2, %opencl.clk_event_t* addrspace(4)* {{.*}}, %opencl.clk_event_t* addrspace(4)* {{.*}}, i8 addrspace(4)* [[BlockInv0]], i8 addrspace(4)* [[Block0]], i32 1, i32* {{.*}}) | ||
963 | |||
964 | - %15 = call i32 @__enqueue_kernel_events_varargs(%opencl.queue_t* %1, i32 %2, %struct.ndrange_t* %ndrange, i32 2, %opencl.clk_event_t* addrspace(4)* %6, %opencl.clk_event_t* addrspace(4)* %7, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* @__device_side_enqueue_block_invoke_3_kernel to i8*) to i8 addrspace(4)*), i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32 } addrspace(1)* @__block_literal_global to i8 addrspace(1)*) to i8 addrspace(4)*), i32 1, i32* %12) | ||
965 | - %16 = alloca [3 x i32] | ||
966 | - %17 = getelementptr [3 x i32], [3 x i32]* %16, i32 0, i32 0 | ||
967 | - store i32 1, i32* %17, align 4 | ||
968 | - %18 = getelementptr [3 x i32], [3 x i32]* %16, i32 0, i32 1 | ||
969 | - store i32 2, i32* %18, align 4 | ||
970 | - %19 = getelementptr [3 x i32], [3 x i32]* %16, i32 0, i32 2 | ||
971 | - store i32 4, i32* %19, align 4 | ||
972 | + %32 = call i32 @__enqueue_kernel_events_varargs(%opencl.queue_t* %23, i32 %24, %struct.ndrange_t* %tmp11, i32 2, %opencl.clk_event_t* addrspace(4)* %27, %opencl.clk_event_t* addrspace(4)* %28, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*)* @__device_side_enqueue_block_invoke_3_kernel to i8*) to i8 addrspace(4)*), i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* @__block_literal_global to i8 addrspace(1)*) to i8 addrspace(4)*), i32 1, i32* %29) | ||
973 | + %33 = load %opencl.queue_t*, %opencl.queue_t** %default_queue, align 4 | ||
974 | + %34 = load i32, i32* %flags, align 4 | ||
975 | + %35 = bitcast %struct.ndrange_t* %tmp12 to i8* | ||
976 | + %36 = bitcast %struct.ndrange_t* %ndrange to i8* | ||
977 | + call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 4 %35, i8* align 4 %36, i32 4, i1 false) | ||
978 | + %37 = getelementptr [3 x i32], [3 x i32]* %block_sizes13, i32 0, i32 0 | ||
979 | + store i32 1, i32* %37, align 4 | ||
980 | + %38 = getelementptr [3 x i32], [3 x i32]* %block_sizes13, i32 0, i32 1 | ||
981 | + store i32 2, i32* %38, align 4 | ||
982 | + %39 = getelementptr [3 x i32], [3 x i32]* %block_sizes13, i32 0, i32 2 | ||
983 | + store i32 4, i32* %39, align 4 | ||
984 | |||
985 | ; CHECK-SPIRV: PtrAccessChain [[Int32LocPtrTy]] [[LocalBuf41:[0-9]+]] | ||
986 | ; CHECK-SPIRV: PtrAccessChain [[Int32LocPtrTy]] [[LocalBuf42:[0-9]+]] | ||
987 | @@ -206,24 +253,27 @@ entry: | ||
988 | ; CHECK-LLVM: [[BlockInv1:%[0-9]+]] = addrspacecast void (i8 addrspace(4)*, i8 addrspace(3)*, i8 addrspace(3)*, i8 addrspace(3)*)* @__device_side_enqueue_block_invoke_4_kernel to i8 addrspace(4)* | ||
989 | ; CHECK-LLVM: call i32 @__enqueue_kernel_events_varargs(%opencl.queue_t* {{.*}}, i32 {{.*}}, %struct.ndrange_t* {{.*}}, i32 0, %opencl.clk_event_t* addrspace(4)* null, %opencl.clk_event_t* addrspace(4)* null, i8 addrspace(4)* [[BlockInv1]], i8 addrspace(4)* [[Block1]], i32 3, i32* {{.*}}) | ||
990 | |||
991 | - %20 = call i32 @__enqueue_kernel_varargs(%opencl.queue_t* %1, i32 %2, %struct.ndrange_t* %ndrange, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*, i8 addrspace(3)*, i8 addrspace(3)*)* @__device_side_enqueue_block_invoke_4_kernel to i8*) to i8 addrspace(4)*), i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32 } addrspace(1)* @__block_literal_global.1 to i8 addrspace(1)*) to i8 addrspace(4)*), i32 3, i32* %17) | ||
992 | + %40 = call i32 @__enqueue_kernel_varargs(%opencl.queue_t* %33, i32 %34, %struct.ndrange_t* %tmp12, i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*, i8 addrspace(3)*, i8 addrspace(3)*, i8 addrspace(3)*)* @__device_side_enqueue_block_invoke_4_kernel to i8*) to i8 addrspace(4)*), i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* @__block_literal_global.1 to i8 addrspace(1)*) to i8 addrspace(4)*), i32 3, i32* %37) | ||
993 | ret void | ||
994 | } | ||
995 | |||
996 | +; Function Attrs: argmemonly nounwind | ||
997 | +declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture writeonly, i8* nocapture readonly, i32, i1) #1 | ||
998 | + | ||
999 | ; Function Attrs: convergent noinline nounwind optnone | ||
1000 | define internal spir_func void @__device_side_enqueue_block_invoke(i8 addrspace(4)* %.block_descriptor) #2 { | ||
1001 | entry: | ||
1002 | %.block_descriptor.addr = alloca i8 addrspace(4)*, align 4 | ||
1003 | - %block.addr = alloca <{ i32, i32, i32 addrspace(1)*, i32, i8 }> addrspace(4)*, align 4 | ||
1004 | + %block.addr = alloca <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }> addrspace(4)*, align 4 | ||
1005 | store i8 addrspace(4)* %.block_descriptor, i8 addrspace(4)** %.block_descriptor.addr, align 4 | ||
1006 | - %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i32 addrspace(1)*, i32, i8 }> addrspace(4)* | ||
1007 | - store <{ i32, i32, i32 addrspace(1)*, i32, i8 }> addrspace(4)* %block, <{ i32, i32, i32 addrspace(1)*, i32, i8 }> addrspace(4)** %block.addr, align 4 | ||
1008 | - %block.capture.addr = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i32 addrspace(1)*, i32, i8 }> addrspace(4)* %block, i32 0, i32 4 | ||
1009 | + %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }> addrspace(4)* | ||
1010 | + store <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }> addrspace(4)* %block, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }> addrspace(4)** %block.addr, align 4 | ||
1011 | + %block.capture.addr = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }> addrspace(4)* %block, i32 0, i32 5 | ||
1012 | %0 = load i8, i8 addrspace(4)* %block.capture.addr, align 4 | ||
1013 | %conv = sext i8 %0 to i32 | ||
1014 | - %block.capture.addr1 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i32 addrspace(1)*, i32, i8 }> addrspace(4)* %block, i32 0, i32 2 | ||
1015 | + %block.capture.addr1 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }> addrspace(4)* %block, i32 0, i32 3 | ||
1016 | %1 = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(4)* %block.capture.addr1, align 4 | ||
1017 | - %block.capture.addr2 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i32 addrspace(1)*, i32, i8 }> addrspace(4)* %block, i32 0, i32 3 | ||
1018 | + %block.capture.addr2 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i8 }> addrspace(4)* %block, i32 0, i32 4 | ||
1019 | %2 = load i32, i32 addrspace(4)* %block.capture.addr2, align 4 | ||
1020 | %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %1, i32 %2 | ||
1021 | store i32 %conv, i32 addrspace(1)* %arrayidx, align 4 | ||
1022 | @@ -243,19 +293,19 @@ declare i32 @__enqueue_kernel_basic(%opencl.queue_t*, i32, %struct.ndrange_t*, i | ||
1023 | define internal spir_func void @__device_side_enqueue_block_invoke_2(i8 addrspace(4)* %.block_descriptor) #2 { | ||
1024 | entry: | ||
1025 | %.block_descriptor.addr = alloca i8 addrspace(4)*, align 4 | ||
1026 | - %block.addr = alloca <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)*, align 4 | ||
1027 | + %block.addr = alloca <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)*, align 4 | ||
1028 | store i8 addrspace(4)* %.block_descriptor, i8 addrspace(4)** %.block_descriptor.addr, align 4 | ||
1029 | - %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* | ||
1030 | - store <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)** %block.addr, align 4 | ||
1031 | - %block.capture.addr = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, i32 0, i32 4 | ||
1032 | + %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* | ||
1033 | + store <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)** %block.addr, align 4 | ||
1034 | + %block.capture.addr = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, i32 0, i32 5 | ||
1035 | %0 = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(4)* %block.capture.addr, align 4 | ||
1036 | - %block.capture.addr1 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, i32 0, i32 3 | ||
1037 | + %block.capture.addr1 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, i32 0, i32 4 | ||
1038 | %1 = load i32, i32 addrspace(4)* %block.capture.addr1, align 4 | ||
1039 | %arrayidx = getelementptr inbounds i32, i32 addrspace(1)* %0, i32 %1 | ||
1040 | %2 = load i32, i32 addrspace(1)* %arrayidx, align 4 | ||
1041 | - %block.capture.addr2 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, i32 0, i32 2 | ||
1042 | + %block.capture.addr2 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, i32 0, i32 3 | ||
1043 | %3 = load i32 addrspace(1)*, i32 addrspace(1)* addrspace(4)* %block.capture.addr2, align 4 | ||
1044 | - %block.capture.addr3 = getelementptr inbounds <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, i32 0, i32 3 | ||
1045 | + %block.capture.addr3 = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }>, <{ i32, i32, i8 addrspace(4)*, i32 addrspace(1)*, i32, i32 addrspace(1)* }> addrspace(4)* %block, i32 0, i32 4 | ||
1046 | %4 = load i32, i32 addrspace(4)* %block.capture.addr3, align 4 | ||
1047 | %arrayidx4 = getelementptr inbounds i32, i32 addrspace(1)* %3, i32 %4 | ||
1048 | store i32 %2, i32 addrspace(1)* %arrayidx4, align 4 | ||
1049 | @@ -276,11 +326,11 @@ define internal spir_func void @__device_side_enqueue_block_invoke_3(i8 addrspac | ||
1050 | entry: | ||
1051 | %.block_descriptor.addr = alloca i8 addrspace(4)*, align 4 | ||
1052 | %p.addr = alloca i8 addrspace(3)*, align 4 | ||
1053 | - %block.addr = alloca <{ i32, i32 }> addrspace(4)*, align 4 | ||
1054 | + %block.addr = alloca <{ i32, i32, i8 addrspace(4)* }> addrspace(4)*, align 4 | ||
1055 | store i8 addrspace(4)* %.block_descriptor, i8 addrspace(4)** %.block_descriptor.addr, align 4 | ||
1056 | - %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32 }> addrspace(4)* | ||
1057 | + %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* | ||
1058 | store i8 addrspace(3)* %p, i8 addrspace(3)** %p.addr, align 4 | ||
1059 | - store <{ i32, i32 }> addrspace(4)* %block, <{ i32, i32 }> addrspace(4)** %block.addr, align 4 | ||
1060 | + store <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* %block, <{ i32, i32, i8 addrspace(4)* }> addrspace(4)** %block.addr, align 4 | ||
1061 | ret void | ||
1062 | } | ||
1063 | |||
1064 | @@ -300,13 +350,13 @@ entry: | ||
1065 | %p1.addr = alloca i8 addrspace(3)*, align 4 | ||
1066 | %p2.addr = alloca i8 addrspace(3)*, align 4 | ||
1067 | %p3.addr = alloca i8 addrspace(3)*, align 4 | ||
1068 | - %block.addr = alloca <{ i32, i32 }> addrspace(4)*, align 4 | ||
1069 | + %block.addr = alloca <{ i32, i32, i8 addrspace(4)* }> addrspace(4)*, align 4 | ||
1070 | store i8 addrspace(4)* %.block_descriptor, i8 addrspace(4)** %.block_descriptor.addr, align 4 | ||
1071 | - %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32 }> addrspace(4)* | ||
1072 | + %block = bitcast i8 addrspace(4)* %.block_descriptor to <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* | ||
1073 | store i8 addrspace(3)* %p1, i8 addrspace(3)** %p1.addr, align 4 | ||
1074 | store i8 addrspace(3)* %p2, i8 addrspace(3)** %p2.addr, align 4 | ||
1075 | store i8 addrspace(3)* %p3, i8 addrspace(3)** %p3.addr, align 4 | ||
1076 | - store <{ i32, i32 }> addrspace(4)* %block, <{ i32, i32 }> addrspace(4)** %block.addr, align 4 | ||
1077 | + store <{ i32, i32, i8 addrspace(4)* }> addrspace(4)* %block, <{ i32, i32, i8 addrspace(4)* }> addrspace(4)** %block.addr, align 4 | ||
1078 | ret void | ||
1079 | } | ||
1080 | |||
1081 | @@ -329,27 +379,20 @@ declare i32 @__enqueue_kernel_varargs(%opencl.queue_t*, i32, %struct.ndrange_t*, | ||
1082 | ; CHECK-LLVM-DAG: define spir_kernel void @__device_side_enqueue_block_invoke_3_kernel(i8 addrspace(4)*, i8 addrspace(3)*) | ||
1083 | ; CHECK-LLVM-DAG: define spir_kernel void @__device_side_enqueue_block_invoke_4_kernel(i8 addrspace(4)*, i8 addrspace(3)*, i8 addrspace(3)*, i8 addrspace(3)*) | ||
1084 | |||
1085 | -attributes #0 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
1086 | +attributes #0 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "uniform-work-group-size"="false" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
1087 | attributes #1 = { argmemonly nounwind } | ||
1088 | -attributes #2 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
1089 | +attributes #2 = { convergent noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "denorms-are-zero"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" } | ||
1090 | attributes #3 = { nounwind } | ||
1091 | |||
1092 | !llvm.module.flags = !{!0} | ||
1093 | -!opencl.enable.FP_CONTRACT = !{} | ||
1094 | !opencl.ocl.version = !{!1} | ||
1095 | !opencl.spir.version = !{!1} | ||
1096 | -!opencl.used.extensions = !{!2} | ||
1097 | -!opencl.used.optional.core.features = !{!2} | ||
1098 | -!opencl.compiler.options = !{!2} | ||
1099 | -!llvm.ident = !{!3} | ||
1100 | +!llvm.ident = !{!2} | ||
1101 | |||
1102 | !0 = !{i32 1, !"wchar_size", i32 4} | ||
1103 | !1 = !{i32 2, i32 0} | ||
1104 | -!2 = !{} | ||
1105 | -!3 = !{!"clang version 7.0.0"} | ||
1106 | -!4 = !{i32 1, i32 1, i32 0, i32 0} | ||
1107 | -!5 = !{!"none", !"none", !"none", !"none"} | ||
1108 | -!6 = !{!"int*", !"int*", !"int", !"char"} | ||
1109 | -!7 = !{!"", !"", !"", !""} | ||
1110 | -!8 = !{i1 false, i1 false, i1 false, i1 false} | ||
1111 | -!9 = !{i32 0, i32 0, i32 0, i32 0} | ||
1112 | +!2 = !{!"clang version 9.0.0 (https://llvm.org/git/clang 04fb8964a801a5c5d7baa5a22272243a7d183896) (https://llvm.org/git/llvm 384f64397f6ad95a361b72d62c07d7bac9f24163)"} | ||
1113 | +!3 = !{i32 1, i32 1, i32 0, i32 0} | ||
1114 | +!4 = !{!"none", !"none", !"none", !"none"} | ||
1115 | +!5 = !{!"int*", !"int*", !"int", !"char"} | ||
1116 | +!6 = !{!"", !"", !"", !""} | ||
1117 | -- | ||
1118 | 1.8.3.1 | ||
1119 | |||
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-dont-export-targets-for-binaries.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-dont-export-targets-for-binaries.patch deleted file mode 100644 index 9d25bbad..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-dont-export-targets-for-binaries.patch +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | From 7bbd0058362ac3bb5edd7a82d43e1785810776b3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Fri, 29 Mar 2019 08:56:53 +0800 | ||
4 | Subject: [PATCH] dont export targets for binaries | ||
5 | |||
6 | The projects using LLVM cmake modules look for target binaries in | ||
7 | sysroot as a result which isn't desirable in this case and isn't needed | ||
8 | either. | ||
9 | |||
10 | Upstream-Status: Inappropriate [cross-compile specific] | ||
11 | |||
12 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
13 | --- | ||
14 | llvm/cmake/modules/AddLLVM.cmake | 9 --------- | ||
15 | llvm/cmake/modules/TableGen.cmake | 6 ------ | ||
16 | 2 files changed, 15 deletions(-) | ||
17 | |||
18 | diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake | ||
19 | index 0df6845..b79f4fa 100644 | ||
20 | --- a/llvm/cmake/modules/AddLLVM.cmake | ||
21 | +++ b/llvm/cmake/modules/AddLLVM.cmake | ||
22 | @@ -866,12 +866,6 @@ macro(add_llvm_tool name) | ||
23 | |||
24 | if ( ${name} IN_LIST LLVM_TOOLCHAIN_TOOLS OR NOT LLVM_INSTALL_TOOLCHAIN_ONLY) | ||
25 | if( LLVM_BUILD_TOOLS ) | ||
26 | - if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR | ||
27 | - NOT LLVM_DISTRIBUTION_COMPONENTS) | ||
28 | - set(export_to_llvmexports EXPORT LLVMExports) | ||
29 | - set_property(GLOBAL PROPERTY LLVM_HAS_EXPORTS True) | ||
30 | - endif() | ||
31 | - | ||
32 | install(TARGETS ${name} | ||
33 | ${export_to_llvmexports} | ||
34 | RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR} | ||
35 | @@ -884,9 +878,6 @@ macro(add_llvm_tool name) | ||
36 | endif() | ||
37 | endif() | ||
38 | endif() | ||
39 | - if( LLVM_BUILD_TOOLS ) | ||
40 | - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${name}) | ||
41 | - endif() | ||
42 | set_target_properties(${name} PROPERTIES FOLDER "Tools") | ||
43 | endmacro(add_llvm_tool name) | ||
44 | |||
45 | diff --git a/llvm/cmake/modules/TableGen.cmake b/llvm/cmake/modules/TableGen.cmake | ||
46 | index 3c84ae7..141219f 100644 | ||
47 | --- a/llvm/cmake/modules/TableGen.cmake | ||
48 | +++ b/llvm/cmake/modules/TableGen.cmake | ||
49 | @@ -164,14 +164,8 @@ macro(add_tablegen target project) | ||
50 | endif() | ||
51 | |||
52 | if (${project} STREQUAL LLVM AND NOT LLVM_INSTALL_TOOLCHAIN_ONLY) | ||
53 | - if(${target} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR | ||
54 | - NOT LLVM_DISTRIBUTION_COMPONENTS) | ||
55 | - set(export_to_llvmexports EXPORT LLVMExports) | ||
56 | - endif() | ||
57 | - | ||
58 | install(TARGETS ${target} | ||
59 | ${export_to_llvmexports} | ||
60 | RUNTIME DESTINATION ${LLVM_TOOLS_INSTALL_DIR}) | ||
61 | endif() | ||
62 | - set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS ${target}) | ||
63 | endmacro() | ||
64 | -- | ||
65 | 2.7.4 | ||
66 | |||
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-point-to-correct-clang.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-point-to-correct-clang.patch deleted file mode 100644 index 0dfc537b..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0001-point-to-correct-clang.patch +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | From 6c33fb58869ffb17106047c45ab8d3856966eaf7 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Tue, 26 Mar 2019 14:11:29 +0800 | ||
4 | Subject: [PATCH] point to correct clang project and tblgen | ||
5 | |||
6 | Point to correct path for clang project as per the way we unpack. Also | ||
7 | let llvm-tblgen path be passed from recipe itself. | ||
8 | |||
9 | Also since we're going to do the patching ourselves, no need to look for | ||
10 | git through cmake. | ||
11 | |||
12 | Upstream-Status: Inappropriate [OE specific] | ||
13 | --- | ||
14 | CMakeLists.txt | 8 ++++---- | ||
15 | 1 file changed, 4 insertions(+), 4 deletions(-) | ||
16 | |||
17 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
18 | index 174133b..c769f08 100644 | ||
19 | --- a/CMakeLists.txt | ||
20 | +++ b/CMakeLists.txt | ||
21 | @@ -53,7 +53,7 @@ endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | ||
22 | include(AddLLVM) | ||
23 | include(TableGen) | ||
24 | |||
25 | -find_package(Git REQUIRED) | ||
26 | +#find_package(Git REQUIRED) | ||
27 | |||
28 | if (NOT WIN32) | ||
29 | add_subdirectory( linux_linker ) | ||
30 | @@ -80,7 +80,7 @@ set(TARGET_NAME ${COMMON_CLANG_LIBRARY_NAME}${BUILD_PLATFORM} ) | ||
31 | |||
32 | if(NOT USE_PREBUILT_LLVM) | ||
33 | set(TARGET_BRANCH "ocl-open-80") | ||
34 | - set(CLANG_SOURCE_DIR ${LLVM_SOURCE_DIR}/tools/clang) | ||
35 | + set(CLANG_SOURCE_DIR ${LLVM_SOURCE_DIR}/../clang) | ||
36 | set(CLANG_BASE_REVISION a03da8be08a208122e292016cb6cea1f30229677) | ||
37 | |||
38 | set(SPIRV_SOURCE_DIR ${LLVM_SOURCE_DIR}/projects/llvm-spirv) | ||
39 | @@ -102,7 +102,7 @@ endif(NOT USE_PREBUILT_LLVM) | ||
40 | set (COMPILE_OPTIONS_TD opencl_clang_options.td) | ||
41 | set (COMPILE_OPTIONS_INC opencl_clang_options.inc) | ||
42 | |||
43 | -set(LLVM_TABLEGEN_EXE "llvm-tblgen") | ||
44 | +#set(LLVM_TABLEGEN_EXE "llvm-tblgen") | ||
45 | set(LLVM_TARGET_DEFINITIONS ${COMPILE_OPTIONS_TD}) | ||
46 | if(USE_PREBUILT_LLVM) | ||
47 | set(TABLEGEN_ADDITIONAL -I ${LLVM_INCLUDE_DIRS}) | ||
48 | @@ -153,7 +153,7 @@ endif() | ||
49 | |||
50 | if(NOT USE_PREBUILT_LLVM) | ||
51 | set(CLANG_BINARY_DIR ${LLVM_BINARY_DIR}/tools/clang/) | ||
52 | - set(CLANG_SOURCE_DIR ${LLVM_MAIN_SRC_DIR}/tools/clang/) | ||
53 | + set(CLANG_SOURCE_DIR ${LLVM_MAIN_SRC_DIR}/../clang/) | ||
54 | include_directories( | ||
55 | ${CLANG_BINARY_DIR}/include # for tablegened includes | ||
56 | ${CLANG_SOURCE_DIR}/include # for basic headers | ||
57 | -- | ||
58 | 2.19.1 | ||
59 | |||
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0002-OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0002-OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch deleted file mode 100644 index 2e935a13..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0002-OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch +++ /dev/null | |||
@@ -1,294 +0,0 @@ | |||
1 | From c94ec28600255098ffb9d73d1b386a7c8a535590 Mon Sep 17 00:00:00 2001 | ||
2 | From: Andrew Savonichev <andrew.savonichev@intel.com> | ||
3 | Date: Thu, 21 Feb 2019 11:02:10 +0000 | ||
4 | Subject: [PATCH 2/2] [OpenCL] Simplify LLVM IR generated for OpenCL blocks | ||
5 | |||
6 | Summary: | ||
7 | Emit direct call of block invoke functions when possible, i.e. in case the | ||
8 | block is not passed as a function argument. | ||
9 | Also doing some refactoring of `CodeGenFunction::EmitBlockCallExpr()` | ||
10 | |||
11 | Reviewers: Anastasia, yaxunl, svenvh | ||
12 | |||
13 | Reviewed By: Anastasia | ||
14 | |||
15 | Subscribers: cfe-commits | ||
16 | |||
17 | Tags: #clang | ||
18 | |||
19 | Differential Revision: https://reviews.llvm.org/D58388 | ||
20 | |||
21 | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354568 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
22 | |||
23 | Upstream-Status: Backport | ||
24 | [https://github.com/llvm-mirror/clang/commit/eae71f8d05ce550c4e2595c9b7082cc2c7882c58] | ||
25 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
26 | --- | ||
27 | lib/CodeGen/CGBlocks.cpp | 77 +++++++++++++------------- | ||
28 | lib/CodeGen/CGOpenCLRuntime.cpp | 30 +++++++--- | ||
29 | lib/CodeGen/CGOpenCLRuntime.h | 4 ++ | ||
30 | test/CodeGenOpenCL/blocks.cl | 10 +--- | ||
31 | test/CodeGenOpenCL/cl20-device-side-enqueue.cl | 34 +++++++++--- | ||
32 | 5 files changed, 91 insertions(+), 64 deletions(-) | ||
33 | |||
34 | diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp | ||
35 | index fa3c3ee..10a0238 100644 | ||
36 | --- a/lib/CodeGen/CGBlocks.cpp | ||
37 | +++ b/lib/CodeGen/CGBlocks.cpp | ||
38 | @@ -1261,52 +1261,49 @@ RValue CodeGenFunction::EmitBlockCallExpr(const CallExpr *E, | ||
39 | ReturnValueSlot ReturnValue) { | ||
40 | const BlockPointerType *BPT = | ||
41 | E->getCallee()->getType()->getAs<BlockPointerType>(); | ||
42 | - | ||
43 | llvm::Value *BlockPtr = EmitScalarExpr(E->getCallee()); | ||
44 | - | ||
45 | - // Get a pointer to the generic block literal. | ||
46 | - // For OpenCL we generate generic AS void ptr to be able to reuse the same | ||
47 | - // block definition for blocks with captures generated as private AS local | ||
48 | - // variables and without captures generated as global AS program scope | ||
49 | - // variables. | ||
50 | - unsigned AddrSpace = 0; | ||
51 | - if (getLangOpts().OpenCL) | ||
52 | - AddrSpace = getContext().getTargetAddressSpace(LangAS::opencl_generic); | ||
53 | - | ||
54 | - llvm::Type *BlockLiteralTy = | ||
55 | - llvm::PointerType::get(CGM.getGenericBlockLiteralType(), AddrSpace); | ||
56 | - | ||
57 | - // Bitcast the callee to a block literal. | ||
58 | - BlockPtr = | ||
59 | - Builder.CreatePointerCast(BlockPtr, BlockLiteralTy, "block.literal"); | ||
60 | - | ||
61 | - // Get the function pointer from the literal. | ||
62 | - llvm::Value *FuncPtr = | ||
63 | - Builder.CreateStructGEP(CGM.getGenericBlockLiteralType(), BlockPtr, | ||
64 | - CGM.getLangOpts().OpenCL ? 2 : 3); | ||
65 | - | ||
66 | - // Add the block literal. | ||
67 | + llvm::Type *GenBlockTy = CGM.getGenericBlockLiteralType(); | ||
68 | + llvm::Value *Func = nullptr; | ||
69 | + QualType FnType = BPT->getPointeeType(); | ||
70 | + ASTContext &Ctx = getContext(); | ||
71 | CallArgList Args; | ||
72 | |||
73 | - QualType VoidPtrQualTy = getContext().VoidPtrTy; | ||
74 | - llvm::Type *GenericVoidPtrTy = VoidPtrTy; | ||
75 | if (getLangOpts().OpenCL) { | ||
76 | - GenericVoidPtrTy = CGM.getOpenCLRuntime().getGenericVoidPointerType(); | ||
77 | - VoidPtrQualTy = | ||
78 | - getContext().getPointerType(getContext().getAddrSpaceQualType( | ||
79 | - getContext().VoidTy, LangAS::opencl_generic)); | ||
80 | - } | ||
81 | - | ||
82 | - BlockPtr = Builder.CreatePointerCast(BlockPtr, GenericVoidPtrTy); | ||
83 | - Args.add(RValue::get(BlockPtr), VoidPtrQualTy); | ||
84 | - | ||
85 | - QualType FnType = BPT->getPointeeType(); | ||
86 | + // For OpenCL, BlockPtr is already casted to generic block literal. | ||
87 | + | ||
88 | + // First argument of a block call is a generic block literal casted to | ||
89 | + // generic void pointer, i.e. i8 addrspace(4)* | ||
90 | + llvm::Value *BlockDescriptor = Builder.CreatePointerCast( | ||
91 | + BlockPtr, CGM.getOpenCLRuntime().getGenericVoidPointerType()); | ||
92 | + QualType VoidPtrQualTy = Ctx.getPointerType( | ||
93 | + Ctx.getAddrSpaceQualType(Ctx.VoidTy, LangAS::opencl_generic)); | ||
94 | + Args.add(RValue::get(BlockDescriptor), VoidPtrQualTy); | ||
95 | + // And the rest of the arguments. | ||
96 | + EmitCallArgs(Args, FnType->getAs<FunctionProtoType>(), E->arguments()); | ||
97 | + | ||
98 | + // We *can* call the block directly unless it is a function argument. | ||
99 | + if (!isa<ParmVarDecl>(E->getCalleeDecl())) | ||
100 | + Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee()); | ||
101 | + else { | ||
102 | + llvm::Value *FuncPtr = Builder.CreateStructGEP(GenBlockTy, BlockPtr, 2); | ||
103 | + Func = Builder.CreateAlignedLoad(FuncPtr, getPointerAlign()); | ||
104 | + } | ||
105 | + } else { | ||
106 | + // Bitcast the block literal to a generic block literal. | ||
107 | + BlockPtr = Builder.CreatePointerCast( | ||
108 | + BlockPtr, llvm::PointerType::get(GenBlockTy, 0), "block.literal"); | ||
109 | + // Get pointer to the block invoke function | ||
110 | + llvm::Value *FuncPtr = Builder.CreateStructGEP(GenBlockTy, BlockPtr, 3); | ||
111 | |||
112 | - // And the rest of the arguments. | ||
113 | - EmitCallArgs(Args, FnType->getAs<FunctionProtoType>(), E->arguments()); | ||
114 | + // First argument is a block literal casted to a void pointer | ||
115 | + BlockPtr = Builder.CreatePointerCast(BlockPtr, VoidPtrTy); | ||
116 | + Args.add(RValue::get(BlockPtr), Ctx.VoidPtrTy); | ||
117 | + // And the rest of the arguments. | ||
118 | + EmitCallArgs(Args, FnType->getAs<FunctionProtoType>(), E->arguments()); | ||
119 | |||
120 | - // Load the function. | ||
121 | - llvm::Value *Func = Builder.CreateAlignedLoad(FuncPtr, getPointerAlign()); | ||
122 | + // Load the function. | ||
123 | + Func = Builder.CreateAlignedLoad(FuncPtr, getPointerAlign()); | ||
124 | + } | ||
125 | |||
126 | const FunctionType *FuncTy = FnType->castAs<FunctionType>(); | ||
127 | const CGFunctionInfo &FnInfo = | ||
128 | diff --git a/lib/CodeGen/CGOpenCLRuntime.cpp b/lib/CodeGen/CGOpenCLRuntime.cpp | ||
129 | index 7f6f595..75003e5 100644 | ||
130 | --- a/lib/CodeGen/CGOpenCLRuntime.cpp | ||
131 | +++ b/lib/CodeGen/CGOpenCLRuntime.cpp | ||
132 | @@ -123,6 +123,23 @@ llvm::PointerType *CGOpenCLRuntime::getGenericVoidPointerType() { | ||
133 | CGM.getContext().getTargetAddressSpace(LangAS::opencl_generic)); | ||
134 | } | ||
135 | |||
136 | +// Get the block literal from an expression derived from the block expression. | ||
137 | +// OpenCL v2.0 s6.12.5: | ||
138 | +// Block variable declarations are implicitly qualified with const. Therefore | ||
139 | +// all block variables must be initialized at declaration time and may not be | ||
140 | +// reassigned. | ||
141 | +static const BlockExpr *getBlockExpr(const Expr *E) { | ||
142 | + const Expr *Prev = nullptr; // to make sure we do not stuck in infinite loop. | ||
143 | + while(!isa<BlockExpr>(E) && E != Prev) { | ||
144 | + Prev = E; | ||
145 | + E = E->IgnoreCasts(); | ||
146 | + if (auto DR = dyn_cast<DeclRefExpr>(E)) { | ||
147 | + E = cast<VarDecl>(DR->getDecl())->getInit(); | ||
148 | + } | ||
149 | + } | ||
150 | + return cast<BlockExpr>(E); | ||
151 | +} | ||
152 | + | ||
153 | /// Record emitted llvm invoke function and llvm block literal for the | ||
154 | /// corresponding block expression. | ||
155 | void CGOpenCLRuntime::recordBlockInfo(const BlockExpr *E, | ||
156 | @@ -137,20 +154,17 @@ void CGOpenCLRuntime::recordBlockInfo(const BlockExpr *E, | ||
157 | EnqueuedBlockMap[E].Kernel = nullptr; | ||
158 | } | ||
159 | |||
160 | +llvm::Function *CGOpenCLRuntime::getInvokeFunction(const Expr *E) { | ||
161 | + return EnqueuedBlockMap[getBlockExpr(E)].InvokeFunc; | ||
162 | +} | ||
163 | + | ||
164 | CGOpenCLRuntime::EnqueuedBlockInfo | ||
165 | CGOpenCLRuntime::emitOpenCLEnqueuedBlock(CodeGenFunction &CGF, const Expr *E) { | ||
166 | CGF.EmitScalarExpr(E); | ||
167 | |||
168 | // The block literal may be assigned to a const variable. Chasing down | ||
169 | // to get the block literal. | ||
170 | - if (auto DR = dyn_cast<DeclRefExpr>(E)) { | ||
171 | - E = cast<VarDecl>(DR->getDecl())->getInit(); | ||
172 | - } | ||
173 | - E = E->IgnoreImplicit(); | ||
174 | - if (auto Cast = dyn_cast<CastExpr>(E)) { | ||
175 | - E = Cast->getSubExpr(); | ||
176 | - } | ||
177 | - auto *Block = cast<BlockExpr>(E); | ||
178 | + const BlockExpr *Block = getBlockExpr(E); | ||
179 | |||
180 | assert(EnqueuedBlockMap.find(Block) != EnqueuedBlockMap.end() && | ||
181 | "Block expression not emitted"); | ||
182 | diff --git a/lib/CodeGen/CGOpenCLRuntime.h b/lib/CodeGen/CGOpenCLRuntime.h | ||
183 | index 750721f..4effc7e 100644 | ||
184 | --- a/lib/CodeGen/CGOpenCLRuntime.h | ||
185 | +++ b/lib/CodeGen/CGOpenCLRuntime.h | ||
186 | @@ -92,6 +92,10 @@ public: | ||
187 | /// \param Block block literal emitted for the block expression. | ||
188 | void recordBlockInfo(const BlockExpr *E, llvm::Function *InvokeF, | ||
189 | llvm::Value *Block); | ||
190 | + | ||
191 | + /// \return LLVM block invoke function emitted for an expression derived from | ||
192 | + /// the block expression. | ||
193 | + llvm::Function *getInvokeFunction(const Expr *E); | ||
194 | }; | ||
195 | |||
196 | } | ||
197 | diff --git a/test/CodeGenOpenCL/blocks.cl b/test/CodeGenOpenCL/blocks.cl | ||
198 | index 19aacc3..ab5a2c6 100644 | ||
199 | --- a/test/CodeGenOpenCL/blocks.cl | ||
200 | +++ b/test/CodeGenOpenCL/blocks.cl | ||
201 | @@ -39,11 +39,8 @@ void foo(){ | ||
202 | // SPIR: %[[blk_gen_ptr:.*]] = addrspacecast %struct.__opencl_block_literal_generic* %[[blk_ptr]] to %struct.__opencl_block_literal_generic addrspace(4)* | ||
203 | // SPIR: store %struct.__opencl_block_literal_generic addrspace(4)* %[[blk_gen_ptr]], %struct.__opencl_block_literal_generic addrspace(4)** %[[block_B:.*]], | ||
204 | // SPIR: %[[block_literal:.*]] = load %struct.__opencl_block_literal_generic addrspace(4)*, %struct.__opencl_block_literal_generic addrspace(4)** %[[block_B]] | ||
205 | - // SPIR: %[[invoke_addr:.*]] = getelementptr inbounds %struct.__opencl_block_literal_generic, %struct.__opencl_block_literal_generic addrspace(4)* %[[block_literal]], i32 0, i32 2 | ||
206 | // SPIR: %[[blk_gen_ptr:.*]] = bitcast %struct.__opencl_block_literal_generic addrspace(4)* %[[block_literal]] to i8 addrspace(4)* | ||
207 | - // SPIR: %[[invoke_func_ptr:.*]] = load i8 addrspace(4)*, i8 addrspace(4)* addrspace(4)* %[[invoke_addr]] | ||
208 | - // SPIR: %[[invoke_func:.*]] = addrspacecast i8 addrspace(4)* %[[invoke_func_ptr]] to i32 (i8 addrspace(4)*)* | ||
209 | - // SPIR: call {{.*}}i32 %[[invoke_func]](i8 addrspace(4)* %[[blk_gen_ptr]]) | ||
210 | + // SPIR: call {{.*}}i32 @__foo_block_invoke(i8 addrspace(4)* %[[blk_gen_ptr]]) | ||
211 | // AMDGCN: %[[block_invoke:.*]] = getelementptr inbounds <{ i32, i32, i8*, i32 }>, <{ i32, i32, i8*, i32 }> addrspace(5)* %[[block:.*]], i32 0, i32 2 | ||
212 | // AMDGCN: store i8* bitcast (i32 (i8*)* @__foo_block_invoke to i8*), i8* addrspace(5)* %[[block_invoke]] | ||
213 | // AMDGCN: %[[block_captured:.*]] = getelementptr inbounds <{ i32, i32, i8*, i32 }>, <{ i32, i32, i8*, i32 }> addrspace(5)* %[[block]], i32 0, i32 3 | ||
214 | @@ -53,11 +50,8 @@ void foo(){ | ||
215 | // AMDGCN: %[[blk_gen_ptr:.*]] = addrspacecast %struct.__opencl_block_literal_generic addrspace(5)* %[[blk_ptr]] to %struct.__opencl_block_literal_generic* | ||
216 | // AMDGCN: store %struct.__opencl_block_literal_generic* %[[blk_gen_ptr]], %struct.__opencl_block_literal_generic* addrspace(5)* %[[block_B:.*]], | ||
217 | // AMDGCN: %[[block_literal:.*]] = load %struct.__opencl_block_literal_generic*, %struct.__opencl_block_literal_generic* addrspace(5)* %[[block_B]] | ||
218 | - // AMDGCN: %[[invoke_addr:.*]] = getelementptr inbounds %struct.__opencl_block_literal_generic, %struct.__opencl_block_literal_generic* %[[block_literal]], i32 0, i32 2 | ||
219 | // AMDGCN: %[[blk_gen_ptr:.*]] = bitcast %struct.__opencl_block_literal_generic* %[[block_literal]] to i8* | ||
220 | - // AMDGCN: %[[invoke_func_ptr:.*]] = load i8*, i8** %[[invoke_addr]] | ||
221 | - // AMDGCN: %[[invoke_func:.*]] = bitcast i8* %[[invoke_func_ptr]] to i32 (i8*)* | ||
222 | - // AMDGCN: call {{.*}}i32 %[[invoke_func]](i8* %[[blk_gen_ptr]]) | ||
223 | + // AMDGCN: call {{.*}}i32 @__foo_block_invoke(i8* %[[blk_gen_ptr]]) | ||
224 | |||
225 | int (^ block_B)(void) = ^{ | ||
226 | return i; | ||
227 | diff --git a/test/CodeGenOpenCL/cl20-device-side-enqueue.cl b/test/CodeGenOpenCL/cl20-device-side-enqueue.cl | ||
228 | index 8445016..1566912 100644 | ||
229 | --- a/test/CodeGenOpenCL/cl20-device-side-enqueue.cl | ||
230 | +++ b/test/CodeGenOpenCL/cl20-device-side-enqueue.cl | ||
231 | @@ -312,9 +312,7 @@ kernel void device_side_enqueue(global int *a, global int *b, int i) { | ||
232 | }; | ||
233 | |||
234 | // Uses global block literal [[BLG8]] and invoke function [[INVG8]]. | ||
235 | - // COMMON: [[r1:%.*]] = load i8 addrspace(4)*, i8 addrspace(4)* addrspace(4)* getelementptr inbounds (%struct.__opencl_block_literal_generic, %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), i32 0, i32 2) | ||
236 | - // COMMON: [[r2:%.*]] = addrspacecast i8 addrspace(4)* [[r1]] to void (i8 addrspace(4)*)* | ||
237 | - // COMMON: call spir_func void [[r2]](i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) | ||
238 | + // COMMON: call spir_func void @__device_side_enqueue_block_invoke_11(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) | ||
239 | block_A(); | ||
240 | |||
241 | // Emits global block literal [[BLG8]] and block kernel [[INVGK8]]. [[INVGK8]] calls [[INVG8]]. | ||
242 | @@ -333,15 +331,35 @@ kernel void device_side_enqueue(global int *a, global int *b, int i) { | ||
243 | unsigned size = get_kernel_work_group_size(block_A); | ||
244 | |||
245 | // Uses global block literal [[BLG8]] and invoke function [[INVG8]]. Make sure no redundant block literal and invoke functions are emitted. | ||
246 | - // COMMON: [[r1:%.*]] = load i8 addrspace(4)*, i8 addrspace(4)* addrspace(4)* getelementptr inbounds (%struct.__opencl_block_literal_generic, %struct.__opencl_block_literal_generic addrspace(4)* addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to %struct.__opencl_block_literal_generic addrspace(1)*) to %struct.__opencl_block_literal_generic addrspace(4)*), i32 0, i32 2) | ||
247 | - // COMMON: [[r2:%.*]] = addrspacecast i8 addrspace(4)* [[r1]] to void (i8 addrspace(4)*)* | ||
248 | - // COMMON: call spir_func void [[r2]](i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) | ||
249 | + // COMMON: call spir_func void @__device_side_enqueue_block_invoke_11(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BLG8]] to i8 addrspace(1)*) to i8 addrspace(4)*)) | ||
250 | block_A(); | ||
251 | |||
252 | + // Make sure that block invoke function is resolved correctly after sequence of assignements. | ||
253 | + // COMMON: store %struct.__opencl_block_literal_generic addrspace(4)* | ||
254 | + // COMMON-SAME: addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* | ||
255 | + // COMMON-SAME: bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to %struct.__opencl_block_literal_generic addrspace(1)*) | ||
256 | + // COMMON-SAME: to %struct.__opencl_block_literal_generic addrspace(4)*), | ||
257 | + // COMMON-SAME: %struct.__opencl_block_literal_generic addrspace(4)** %b1, | ||
258 | + bl_t b1 = block_G; | ||
259 | + // COMMON: store %struct.__opencl_block_literal_generic addrspace(4)* | ||
260 | + // COMMON-SAME: addrspacecast (%struct.__opencl_block_literal_generic addrspace(1)* | ||
261 | + // COMMON-SAME: bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to %struct.__opencl_block_literal_generic addrspace(1)*) | ||
262 | + // COMMON-SAME: to %struct.__opencl_block_literal_generic addrspace(4)*), | ||
263 | + // COMMON-SAME: %struct.__opencl_block_literal_generic addrspace(4)** %b2, | ||
264 | + bl_t b2 = b1; | ||
265 | + // COMMON: call spir_func void @block_G_block_invoke(i8 addrspace(4)* addrspacecast (i8 addrspace(1)* | ||
266 | + // COMMON-SAME: bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to i8 addrspace(1)*) | ||
267 | + // COOMON-SAME: to i8 addrspace(4)*), i8 addrspace(3)* null) | ||
268 | + b2(0); | ||
269 | + // Uses global block literal [[BL_GLOBAL]] and block kernel [[INV_G_K]]. [[INV_G_K]] calls [[INV_G]]. | ||
270 | + // COMMON: call i32 @__get_kernel_preferred_work_group_size_multiple_impl( | ||
271 | + // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8* bitcast ({{.*}} [[INV_G_K:[^ ]+_kernel]] to i8*) to i8 addrspace(4)*), | ||
272 | + // COMMON-SAME: i8 addrspace(4)* addrspacecast (i8 addrspace(1)* bitcast ({ i32, i32, i8 addrspace(4)* } addrspace(1)* [[BL_GLOBAL]] to i8 addrspace(1)*) to i8 addrspace(4)*)) | ||
273 | + size = get_kernel_preferred_work_group_size_multiple(b2); | ||
274 | + | ||
275 | void (^block_C)(void) = ^{ | ||
276 | callee(i, a); | ||
277 | }; | ||
278 | - | ||
279 | // Emits block literal on stack and block kernel [[INVLK3]]. | ||
280 | // COMMON: store i8 addrspace(4)* addrspacecast (i8* bitcast (void (i8 addrspace(4)*)* [[INVL3:@__device_side_enqueue_block_invoke[^ ]*]] to i8*) to i8 addrspace(4)*), i8 addrspace(4)** %block.invoke | ||
281 | // COMMON: [[DEF_Q:%[0-9]+]] = load %opencl.queue_t{{.*}}*, %opencl.queue_t{{.*}}** %default_queue | ||
282 | @@ -404,8 +422,8 @@ kernel void device_side_enqueue(global int *a, global int *b, int i) { | ||
283 | // COMMON: define internal spir_func void [[INVG8]](i8 addrspace(4)*{{.*}}) | ||
284 | // COMMON: define internal spir_func void [[INVG9]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)* %{{.*}}) | ||
285 | // COMMON: define internal spir_kernel void [[INVGK8]](i8 addrspace(4)*{{.*}}) | ||
286 | +// COMMON: define internal spir_kernel void [[INV_G_K]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) | ||
287 | // COMMON: define internal spir_kernel void [[INVLK3]](i8 addrspace(4)*{{.*}}) | ||
288 | // COMMON: define internal spir_kernel void [[INVGK9]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) | ||
289 | -// COMMON: define internal spir_kernel void [[INV_G_K]](i8 addrspace(4)*{{.*}}, i8 addrspace(3)*{{.*}}) | ||
290 | // COMMON: define internal spir_kernel void [[INVGK10]](i8 addrspace(4)*{{.*}}) | ||
291 | // COMMON: define internal spir_kernel void [[INVGK11]](i8 addrspace(4)*{{.*}}) | ||
292 | -- | ||
293 | 1.8.3.1 | ||
294 | |||
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0003-OpenCL-Fix-assertion-due-to-blocks.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/0003-OpenCL-Fix-assertion-due-to-blocks.patch deleted file mode 100644 index 510c7c6e..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/0003-OpenCL-Fix-assertion-due-to-blocks.patch +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | From 29e2813a2ab7d5569860bb07892dfef7b5374d96 Mon Sep 17 00:00:00 2001 | ||
2 | From: Yaxun Liu <Yaxun.Liu@amd.com> | ||
3 | Date: Tue, 26 Feb 2019 16:20:41 +0000 | ||
4 | Subject: [PATCH] [OpenCL] Fix assertion due to blocks | ||
5 | |||
6 | A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called. | ||
7 | |||
8 | There is code | ||
9 | |||
10 | Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee()); | ||
11 | getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle | ||
12 | BlockExpr and returns nullptr, which causes isa to assert. | ||
13 | |||
14 | This patch fixes that. | ||
15 | |||
16 | Differential Revision: https://reviews.llvm.org/D58658 | ||
17 | |||
18 | |||
19 | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@354893 91177308-0d34-0410-b5e6-96231b3b80d8 | ||
20 | |||
21 | Upstream-Status: Backport | ||
22 | [https://github.com/llvm-mirror/clang/commit/29e2813a2ab7d5569860bb07892dfef7b5374d96] | ||
23 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
24 | --- | ||
25 | lib/AST/Expr.cpp | 2 ++ | ||
26 | test/CodeGenOpenCL/blocks.cl | 6 ++++++ | ||
27 | 2 files changed, 8 insertions(+) | ||
28 | |||
29 | diff --git a/lib/AST/Expr.cpp b/lib/AST/Expr.cpp | ||
30 | index aef1eab..85690c7 100644 | ||
31 | --- a/lib/AST/Expr.cpp | ||
32 | +++ b/lib/AST/Expr.cpp | ||
33 | @@ -1358,6 +1358,8 @@ Decl *Expr::getReferencedDeclOfCallee() { | ||
34 | return DRE->getDecl(); | ||
35 | if (MemberExpr *ME = dyn_cast<MemberExpr>(CEE)) | ||
36 | return ME->getMemberDecl(); | ||
37 | + if (auto *BE = dyn_cast<BlockExpr>(CEE)) | ||
38 | + return BE->getBlockDecl(); | ||
39 | |||
40 | return nullptr; | ||
41 | } | ||
42 | diff --git a/test/CodeGenOpenCL/blocks.cl b/test/CodeGenOpenCL/blocks.cl | ||
43 | index ab5a2c6..c3e2685 100644 | ||
44 | --- a/test/CodeGenOpenCL/blocks.cl | ||
45 | +++ b/test/CodeGenOpenCL/blocks.cl | ||
46 | @@ -90,6 +90,12 @@ int get42() { | ||
47 | return blockArgFunc(^{return 42;}); | ||
48 | } | ||
49 | |||
50 | +// COMMON-LABEL: define {{.*}}@call_block | ||
51 | +// call {{.*}}@__call_block_block_invoke | ||
52 | +int call_block() { | ||
53 | + return ^int(int num) { return num; } (11); | ||
54 | +} | ||
55 | + | ||
56 | // CHECK-DEBUG: !DIDerivedType(tag: DW_TAG_member, name: "__size" | ||
57 | // CHECK-DEBUG: !DIDerivedType(tag: DW_TAG_member, name: "__align" | ||
58 | |||
59 | -- | ||
60 | 1.8.3.1 | ||
61 | |||
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend b/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend deleted file mode 100644 index f536f0f2..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/llvm-project-source.bbappend +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | FILESEXTRAPATHS_prepend_intel-x86-common := "${THISDIR}/files:" | ||
2 | |||
3 | SRC_URI_append_intel-x86-common = " \ | ||
4 | git://github.com/intel/opencl-clang.git;protocol=https;branch=ocl-open-80;destsuffix=git/llvm/projects/opencl-clang;name=opencl-clang \ | ||
5 | git://github.com/KhronosGroup/SPIRV-LLVM-Translator.git;protocol=https;branch=llvm_release_80;destsuffix=git/llvm/projects/llvm-spirv;name=spirv \ | ||
6 | file://0001-point-to-correct-clang.patch;patchdir=llvm/projects/opencl-clang \ | ||
7 | file://0001-OpenCL-Change-type-of-block-pointer-for-OpenCL.patch;patchdir=clang \ | ||
8 | file://0002-OpenCL-Simplify-LLVM-IR-generated-for-OpenCL-blocks.patch;patchdir=clang \ | ||
9 | file://0003-OpenCL-Fix-assertion-due-to-blocks.patch;patchdir=clang \ | ||
10 | file://0001-dont-export-targets-for-binaries.patch \ | ||
11 | file://0001-Update-LowerOpenCL-pass-to-handle-new-blocks-represn.patch;patchdir=llvm/projects/llvm-spirv \ | ||
12 | " | ||
13 | |||
14 | SRCREV_opencl-clang = "daf5e4dd718477ae8cf89a283c653939d9182f15" | ||
15 | SRCREV_spirv = "bd0f28fb92061d49c0f120b4dac3fd8956006745" | ||
16 | |||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch new file mode 100644 index 00000000..265fcfa2 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/allow-to-find-cpp-generation-tool.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | From a6361d635e5f3046853883f3ac06fb175116933c Mon Sep 17 00:00:00 2001 | ||
2 | From: Dongwon Kim <dongwon.kim@intel.com> | ||
3 | Date: Sat, 21 Aug 2021 16:09:39 -0700 | ||
4 | Subject: [PATCH] Build not able to locate cpp_generation_tool. | ||
5 | |||
6 | Upstream-Status: Inappropriate [oe specific] | ||
7 | |||
8 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
9 | Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> | ||
10 | --- | ||
11 | shared/source/built_ins/kernels/CMakeLists.txt | 10 +++++----- | ||
12 | 1 file changed, 5 insertions(+), 5 deletions(-) | ||
13 | |||
14 | diff --git a/shared/source/built_ins/kernels/CMakeLists.txt b/shared/source/built_ins/kernels/CMakeLists.txt | ||
15 | index ed85a37c52..f7c9e79137 100644 | ||
16 | --- a/shared/source/built_ins/kernels/CMakeLists.txt | ||
17 | +++ b/shared/source/built_ins/kernels/CMakeLists.txt | ||
18 | @@ -107,9 +107,9 @@ function(compile_builtin core_type platform_it builtin bits builtin_options mode | ||
19 | ) | ||
20 | add_custom_command( | ||
21 | OUTPUT ${OUTPUT_FILE_CPP} | ||
22 | - COMMAND $<TARGET_FILE:cpp_generate_tool> --file ${BINARY_OUTPUT}.bin --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --device ${RELEASE_FILENAME} | ||
23 | + COMMAND cpp_generate_tool --file ${BINARY_OUTPUT}.bin --output ${OUTPUT_FILE_CPP} --array ${mode}_${BASENAME} --device ${RELEASE_FILENAME} | ||
24 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
25 | - DEPENDS ${OUTPUT_FILES_BINARIES} $<TARGET_FILE:cpp_generate_tool> | ||
26 | + DEPENDS ${OUTPUT_FILES_BINARIES} cpp_generate_tool | ||
27 | ) | ||
28 | list(APPEND BUILTINS_COMMANDS "${OUTPUT_FILE_CPP}") | ||
29 | else() | ||
30 | @@ -159,9 +159,9 @@ function(generate_cpp_spirv builtin) | ||
31 | ) | ||
32 | add_custom_command( | ||
33 | OUTPUT ${OUTPUT_FILE_CPP} | ||
34 | - COMMAND $<TARGET_FILE:cpp_generate_tool> --file ${GENERATED_SPV_INPUT} --output ${OUTPUT_FILE_CPP} --array ${BASENAME} | ||
35 | + COMMAND cpp_generate_tool --file ${GENERATED_SPV_INPUT} --output ${OUTPUT_FILE_CPP} --array ${BASENAME} | ||
36 | WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
37 | - DEPENDS ${GENERATED_SPV_INPUT} $<TARGET_FILE:cpp_generate_tool> | ||
38 | + DEPENDS ${GENERATED_SPV_INPUT} cpp_generate_tool | ||
39 | ) | ||
40 | set(OUTPUT_LIST_CPP_FILES ${OUTPUT_LIST_CPP_FILES} ${OUTPUT_FILE_CPP} PARENT_SCOPE) | ||
41 | else() | ||
42 | @@ -277,4 +277,4 @@ if(NOT "${OUTPUT_LIST_CPP_FILES}" STREQUAL "") | ||
43 | ) | ||
44 | endif() | ||
45 | |||
46 | -apply_macro_for_each_core_type("SUPPORTED") | ||
47 | \ No newline at end of file | ||
48 | +apply_macro_for_each_core_type("SUPPORTED") | ||
49 | -- | ||
50 | 2.43.2 | ||
51 | |||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/disable-werror.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/disable-werror.patch new file mode 100644 index 00000000..20d9b847 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/disable-werror.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Upstream-Status: Inappropriate | ||
2 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | |||
4 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
5 | index d52e089778..bc0cf35014 100644 | ||
6 | --- a/CMakeLists.txt | ||
7 | +++ b/CMakeLists.txt | ||
8 | @@ -727,7 +727,7 @@ if(NOT MSVC) | ||
9 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type") # Added for gtest | ||
10 | endif() | ||
11 | endif() | ||
12 | - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Werror=vla") | ||
13 | + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=vla") | ||
14 | |||
15 | if(USE_SANITIZE_UB) | ||
16 | check_cxx_compiler_flag(-fsanitize=undefined COMPILER_SUPPORTS_UNDEFINED_BEHAVIOR_SANITIZER) | ||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/external-ocloc.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/external-ocloc.patch new file mode 100644 index 00000000..5f93b7b6 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/external-ocloc.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 1f58c22992ddea4167b01b44448528de427f50d5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Dongwon Kim <dongwon.kim@intel.com> | ||
3 | Date: Wed, 2 Mar 2022 15:52:45 -0800 | ||
4 | Subject: [PATCH] external ocloc | ||
5 | |||
6 | Upstream-Status: Inappropriate | ||
7 | |||
8 | Signed-off-by: Dongwon Kim <dongwon.kim@intel.com> | ||
9 | --- | ||
10 | cmake/ocloc_cmd_prefix.cmake | 14 ++++++++------ | ||
11 | 1 file changed, 8 insertions(+), 6 deletions(-) | ||
12 | |||
13 | diff --git a/cmake/ocloc_cmd_prefix.cmake b/cmake/ocloc_cmd_prefix.cmake | ||
14 | index 2b44330831..03067c9df0 100644 | ||
15 | --- a/cmake/ocloc_cmd_prefix.cmake | ||
16 | +++ b/cmake/ocloc_cmd_prefix.cmake | ||
17 | @@ -4,12 +4,14 @@ | ||
18 | # SPDX-License-Identifier: MIT | ||
19 | # | ||
20 | |||
21 | -if(WIN32) | ||
22 | - set(ocloc_cmd_prefix ocloc) | ||
23 | -else() | ||
24 | - if(DEFINED NEO__IGC_LIBRARY_PATH) | ||
25 | - set(ocloc_cmd_prefix ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NEO__IGC_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib>" $<TARGET_FILE:ocloc>) | ||
26 | +if(NOT DEFINED ocloc_cmd_prefix) | ||
27 | + if(WIN32) | ||
28 | + set(ocloc_cmd_prefix ocloc) | ||
29 | else() | ||
30 | - set(ocloc_cmd_prefix ${CMAKE_COMMAND} -E env "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib>" $<TARGET_FILE:ocloc>) | ||
31 | + if(DEFINED NEO__IGC_LIBRARY_PATH) | ||
32 | + set(ocloc_cmd_prefix LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${NEO__IGC_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib> $<TARGET_FILE:ocloc>) | ||
33 | + else() | ||
34 | + set(ocloc_cmd_prefix LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$<TARGET_FILE_DIR:ocloc_lib> $<TARGET_FILE:ocloc>) | ||
35 | + endif() | ||
36 | endif() | ||
37 | endif() | ||
38 | -- | ||
39 | 2.37.3 | ||
40 | |||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/f10439aea214984a060566831f63d3aa198ef1b8.patch b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/f10439aea214984a060566831f63d3aa198ef1b8.patch new file mode 100644 index 00000000..b7fcb3d1 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime/f10439aea214984a060566831f63d3aa198ef1b8.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | From f10439aea214984a060566831f63d3aa198ef1b8 Mon Sep 17 00:00:00 2001 | ||
2 | From: Pawel Cieslak <pawel.cieslak@intel.com> | ||
3 | Date: Tue, 14 May 2024 14:20:24 +0000 | ||
4 | Subject: [PATCH] fix: include <algorithm> where std::find is used | ||
5 | |||
6 | Related-To: NEO-11375 | ||
7 | Signed-off-by: Pawel Cieslak <pawel.cieslak@intel.com> | ||
8 | |||
9 | Upstream-Status: Backport [https://github.com/intel/compute-runtime/commit/f10439aea214984a060566831f63d3aa198ef1b8] | ||
10 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
11 | --- | ||
12 | .../sources/linux/nl_api/test_sysman_iaf_nl_api_prelim.cpp | 3 ++- | ||
13 | shared/test/unit_test/gmm_helper/gmm_resource_info_tests.cpp | 4 +++- | ||
14 | 2 files changed, 5 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/level_zero/sysman/test/unit_tests/sources/linux/nl_api/test_sysman_iaf_nl_api_prelim.cpp b/level_zero/sysman/test/unit_tests/sources/linux/nl_api/test_sysman_iaf_nl_api_prelim.cpp | ||
17 | index 6ab1b751d866..8a224752c8fc 100644 | ||
18 | --- a/level_zero/sysman/test/unit_tests/sources/linux/nl_api/test_sysman_iaf_nl_api_prelim.cpp | ||
19 | +++ b/level_zero/sysman/test/unit_tests/sources/linux/nl_api/test_sysman_iaf_nl_api_prelim.cpp | ||
20 | @@ -1,5 +1,5 @@ | ||
21 | /* | ||
22 | - * Copyright (C) 2021-2023 Intel Corporation | ||
23 | + * Copyright (C) 2021-2024 Intel Corporation | ||
24 | * | ||
25 | * SPDX-License-Identifier: MIT | ||
26 | * | ||
27 | @@ -13,6 +13,7 @@ | ||
28 | |||
29 | #include "gtest/gtest.h" | ||
30 | |||
31 | +#include <algorithm> | ||
32 | #include <limits> | ||
33 | #include <netlink/handlers.h> | ||
34 | |||
35 | diff --git a/shared/test/unit_test/gmm_helper/gmm_resource_info_tests.cpp b/shared/test/unit_test/gmm_helper/gmm_resource_info_tests.cpp | ||
36 | index 206c272c5bb2..e961248e73a3 100644 | ||
37 | --- a/shared/test/unit_test/gmm_helper/gmm_resource_info_tests.cpp | ||
38 | +++ b/shared/test/unit_test/gmm_helper/gmm_resource_info_tests.cpp | ||
39 | @@ -1,5 +1,5 @@ | ||
40 | /* | ||
41 | - * Copyright (C) 2021-2023 Intel Corporation | ||
42 | + * Copyright (C) 2021-2024 Intel Corporation | ||
43 | * | ||
44 | * SPDX-License-Identifier: MIT | ||
45 | * | ||
46 | @@ -17,6 +17,8 @@ | ||
47 | |||
48 | #include "gtest/gtest.h" | ||
49 | |||
50 | +#include <algorithm> | ||
51 | + | ||
52 | using namespace NEO; | ||
53 | |||
54 | struct MockGmmHandleAllocator : NEO::GmmHandleAllocator { | ||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.13.29138.7.bb b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.13.29138.7.bb new file mode 100644 index 00000000..7280ed03 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/compute-runtime/intel-compute-runtime_24.13.29138.7.bb | |||
@@ -0,0 +1,65 @@ | |||
1 | SUMMARY = "The Intel(R) Graphics Compute Runtime for OpenCL(TM)" | ||
2 | DESCRIPTION = "The Intel(R) Graphics Compute Runtime for OpenCL(TM) \ | ||
3 | is an open source project to converge Intel's development efforts \ | ||
4 | on OpenCL(TM) compute stacks supporting the GEN graphics hardware \ | ||
5 | architecture." | ||
6 | |||
7 | LICENSE = "MIT & Apache-2.0" | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=eca6ec6997e18db166db7109cdbe611c \ | ||
9 | file://third_party/opencl_headers/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
10 | |||
11 | SRC_URI = "git://github.com/intel/compute-runtime.git;protocol=https;branch=releases/24.13 \ | ||
12 | file://disable-werror.patch \ | ||
13 | file://allow-to-find-cpp-generation-tool.patch \ | ||
14 | file://external-ocloc.patch \ | ||
15 | file://f10439aea214984a060566831f63d3aa198ef1b8.patch \ | ||
16 | " | ||
17 | |||
18 | SRCREV = "7131387cdbb02d480a225c70daef913a6c024a6e" | ||
19 | |||
20 | S = "${WORKDIR}/git" | ||
21 | |||
22 | DEPENDS += " intel-graphics-compiler gmmlib libva qemu-native" | ||
23 | |||
24 | RDEPENDS:${PN} += " intel-graphics-compiler gmmlib" | ||
25 | |||
26 | inherit cmake pkgconfig qemu | ||
27 | |||
28 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
29 | COMPATIBLE_HOST:libc-musl = "null" | ||
30 | |||
31 | EXTRA_OECMAKE = " \ | ||
32 | -DIGC_DIR=${STAGING_INCDIR}/igc \ | ||
33 | -DBUILD_TYPE=Release \ | ||
34 | -DSKIP_UNIT_TESTS=1 \ | ||
35 | -DCCACHE_ALLOWED=FALSE \ | ||
36 | -DNEO_DISABLE_LD_LLD=ON \ | ||
37 | -DNEO_DISABLE_LD_GOLD=ON \ | ||
38 | " | ||
39 | |||
40 | EXTRA_OECMAKE:append:class-target = " \ | ||
41 | -Docloc_cmd_prefix=ocloc \ | ||
42 | -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ | ||
43 | " | ||
44 | |||
45 | PACKAGECONFIG ??= "" | ||
46 | PACKAGECONFIG[levelzero] = "-DBUILD_WITH_L0=ON, -DBUILD_WITH_L0=OFF, level-zero" | ||
47 | |||
48 | do_configure:prepend:class-target () { | ||
49 | # Write out a qemu wrapper that will be used by cmake. | ||
50 | qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${B}/bin'),d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}" | ||
51 | cat > ${WORKDIR}/qemuwrapper << EOF | ||
52 | #!/bin/sh | ||
53 | $qemu_binary "\$@" | ||
54 | EOF | ||
55 | chmod +x ${WORKDIR}/qemuwrapper | ||
56 | } | ||
57 | |||
58 | FILES:${PN} += " \ | ||
59 | ${libdir}/intel-opencl/libigdrcl.so \ | ||
60 | ${libdir}/libocloc.so \ | ||
61 | " | ||
62 | |||
63 | FILES:${PN}-dev = "${includedir}" | ||
64 | |||
65 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)" | ||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch new file mode 100644 index 00000000..377081fd --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 3d71670f8ad5b54d434c2f5f71713bb1d5433ae4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Tue, 12 Oct 2021 23:46:42 +0800 | ||
4 | Subject: [PATCH] BiF/CMakeLists.txt: remove opt from DEPENDS | ||
5 | |||
6 | Otherwise it starts failing with: | ||
7 | |||
8 | | ninja: error: 'IGC/VectorCompiler/lib/BiF/opt', needed by 'IGC/VectorCompiler/lib/BiF/VCBiFPrintfOCL32.opt.bc', missing and no known rule to make it | ||
9 | |||
10 | We don't need to explicitly make sure opt is built when | ||
11 | using prebuilt binaries. | ||
12 | |||
13 | Upstream-Status: Inappropriate | ||
14 | |||
15 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
16 | --- | ||
17 | IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake | 2 +- | ||
18 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake b/IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake | ||
21 | index d20d7f887..882e09fea 100644 | ||
22 | --- a/IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake | ||
23 | +++ b/IGC/VectorCompiler/lib/BiF/cmake/Functions.cmake | ||
24 | @@ -109,7 +109,7 @@ function(vc_build_bif TARGET RES_FILE CMCL_SRC_PATH BIF_NAME PTR_BIT_SIZE) | ||
25 | COMMENT "vc_build_bif: Translating CMCL builtins: ${BIF_CLANG_BC_NAME_FINAL} -> ${BIF_OPT_BC_NAME}" | ||
26 | COMMAND CMCLTranslatorTool -o ${BIF_CMCL_BC_NAME} ${BIF_CLANG_BC_NAME_FINAL} | ||
27 | COMMAND ${LLVM_OPT_EXE} ${IGC_LLVM_DEPENDENT_OPT_FLAGS} --O2 -o ${BIF_OPT_BC_NAME} ${BIF_CMCL_BC_NAME} | ||
28 | - DEPENDS CMCLTranslatorTool ${LLVM_OPT_EXE} ${BIF_CLANG_BC_PATH_FINAL} | ||
29 | + DEPENDS CMCLTranslatorTool ${BIF_CLANG_BC_PATH_FINAL} | ||
30 | BYPRODUCTS ${BIF_OPT_BC_PATH} | ||
31 | SOURCES ${CMCL_SRC_PATH}) | ||
32 | set(${RES_FILE} ${BIF_OPT_BC_NAME} PARENT_SCOPE) | ||
33 | -- | ||
34 | 2.43.2 | ||
35 | |||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch new file mode 100644 index 00000000..dca75e22 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From e69a3181482e5f442756a61c7b683914072884f1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Mon, 9 Jan 2023 11:43:05 +0800 | ||
4 | Subject: [PATCH] external/SPIRV-Tools: change path to tools and headers | ||
5 | |||
6 | We clone the SPIRV headers and tools in a different directory to ensure | ||
7 | file path substitutions take place. | ||
8 | |||
9 | Upstream-Status: Inappropriate | ||
10 | |||
11 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
12 | |||
13 | --- | ||
14 | external/SPIRV-Tools/CMakeLists.txt | 4 ++-- | ||
15 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/external/SPIRV-Tools/CMakeLists.txt b/external/SPIRV-Tools/CMakeLists.txt | ||
18 | index 9afa5746c..7ca24d5dc 100644 | ||
19 | --- a/external/SPIRV-Tools/CMakeLists.txt | ||
20 | +++ b/external/SPIRV-Tools/CMakeLists.txt | ||
21 | @@ -43,8 +43,8 @@ else() #By default use build from sources | ||
22 | message(STATUS "[SPIRV-Tools] : Building from source") | ||
23 | message(STATUS "[SPIRV-Tools] : Current source dir: ${CMAKE_CURRENT_SOURCE_DIR}") | ||
24 | |||
25 | - set(SPIRV-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../SPIRV-Headers") # used in subdirectory | ||
26 | - set(SPIRV-Tools_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../SPIRV-Tools") | ||
27 | + set(SPIRV-Headers_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../SPIRV-Headers") # used in subdirectory | ||
28 | + set(SPIRV-Tools_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../SPIRV-Tools") | ||
29 | |||
30 | set(SPIRV-Tools_OUTPUT_DIR "${IGC_OPTION__OUTPUT_DIR}/external/SPIRV-Tools/build") | ||
31 | set(IGC_BUILD__SPIRV-Headers_DIR "${SPIRV-Headers_SOURCE_DIR}") | ||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-fix-tblgen.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-fix-tblgen.patch new file mode 100644 index 00000000..39443931 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0001-fix-tblgen.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | From 5648568e597acd0fed82aac3e6aef0f95a1b78d1 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Thu, 19 May 2022 22:50:09 +0800 | ||
4 | Subject: [PATCH] fix tblgen | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE specific] | ||
7 | |||
8 | --- | ||
9 | IGC/cmake/igc_llvm.cmake | 2 +- | ||
10 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
11 | |||
12 | diff --git a/IGC/cmake/igc_llvm.cmake b/IGC/cmake/igc_llvm.cmake | ||
13 | index 10322533c..9020cb3c8 100644 | ||
14 | --- a/IGC/cmake/igc_llvm.cmake | ||
15 | +++ b/IGC/cmake/igc_llvm.cmake | ||
16 | @@ -52,7 +52,7 @@ else() | ||
17 | set(LLVM_OPT_EXE "opt" CACHE STRING "") | ||
18 | |||
19 | set(LLVM_TABLEGEN_EXE "llvm-tblgen") | ||
20 | - if(CMAKE_CROSSCOMPILING) | ||
21 | + if(TRUE) | ||
22 | if(DEFINED LLVM_TABLEGEN) | ||
23 | set(LLVM_TABLEGEN_EXE ${LLVM_TABLEGEN}) | ||
24 | else() | ||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch new file mode 100644 index 00000000..650130a8 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/igc/files/0003-Improve-Reproducibility-for-src-package.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 0559332abd04b6c8bc70171d201f43d2e4735336 Mon Sep 17 00:00:00 2001 | ||
2 | From: Lee Chee Yang <chee.yang.lee@intel.com> | ||
3 | Date: Wed, 2 Sep 2020 08:28:35 +0800 | ||
4 | Subject: [PATCH] Improve Reproducibility for src package | ||
5 | |||
6 | Improve reproducibility for intel-graphics-compiler-src package. | ||
7 | needs to pass build path as environment variable to the build. | ||
8 | this only works on bison 3.7 onward, hence check for bison version | ||
9 | before adding the flags. | ||
10 | Upstream-Status: Inappropriate [applying --file-prefix-map in such way does not work for upstream] | ||
11 | Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> | ||
12 | |||
13 | --- | ||
14 | visa/CMakeLists.txt | 7 +++++-- | ||
15 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/visa/CMakeLists.txt b/visa/CMakeLists.txt | ||
18 | index 6be467587..930c386a6 100644 | ||
19 | --- a/visa/CMakeLists.txt | ||
20 | +++ b/visa/CMakeLists.txt | ||
21 | @@ -123,8 +123,11 @@ endif() | ||
22 | set(bison_output_file ${CMAKE_CURRENT_BINARY_DIR}/CISA.tab.cpp) | ||
23 | set(flex_output_file ${CMAKE_CURRENT_BINARY_DIR}/lex.CISA.cpp) | ||
24 | |||
25 | -BISON_TARGET(CISAParser CISA.y ${bison_output_file} COMPILE_FLAGS "-vt -p CISA") | ||
26 | -FLEX_TARGET(CISAScanner CISA.l ${flex_output_file} COMPILE_FLAGS "-PCISA ${WIN_FLEX_FLAG}") | ||
27 | +if(BISON_VERSION VERSION_GREATER_EQUAL "3.7.0") | ||
28 | + set(BISON_EXTRA_FLAGS " --file-prefix-map=$ENV{B}=/igc/ ") | ||
29 | +endif() | ||
30 | +BISON_TARGET(CISAParser CISA.y ${bison_output_file} COMPILE_FLAGS "-l -vt -p CISA ${BISON_EXTRA_FLAGS} ") | ||
31 | +FLEX_TARGET(CISAScanner CISA.l ${flex_output_file} COMPILE_FLAGS "-PCISA -L ${WIN_FLEX_FLAG} ") | ||
32 | ADD_FLEX_BISON_DEPENDENCY(CISAScanner CISAParser) | ||
33 | set(CISAScanner_dependencies) | ||
34 | |||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.16510.2.bb b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.16510.2.bb new file mode 100644 index 00000000..24eb97bd --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/igc/intel-graphics-compiler_1.0.16510.2.bb | |||
@@ -0,0 +1,75 @@ | |||
1 | SUMMARY = "The Intel(R) Graphics Compiler for OpenCL(TM)" | ||
2 | DESCRIPTION = "The Intel(R) Graphics Compiler for OpenCL(TM) is an \ | ||
3 | llvm based compiler for OpenCL(TM) targeting Intel Gen graphics \ | ||
4 | hardware architecture." | ||
5 | |||
6 | LICENSE = "MIT & Apache-2.0" | ||
7 | LIC_FILES_CHKSUM = "file://IGC/BiFModule/Implementation/ExternalLibraries/libclc/LICENSE.TXT;md5=311cfc1a5b54bab8ed34a0b5fba4373e \ | ||
8 | file://LICENSE.md;md5=488d74376edf2765f6e78d271543dde3 \ | ||
9 | file://NOTICES.txt;md5=b81a52411c84df3419f20bad4d755880" | ||
10 | |||
11 | SRC_URI = "git://github.com/intel/intel-graphics-compiler.git;protocol=https;name=igc;branch=releases/igc-1.0.16510 \ | ||
12 | git://github.com/intel/vc-intrinsics.git;protocol=https;destsuffix=git/vc-intrinsics;name=vc;nobranch=1 \ | ||
13 | git://github.com/KhronosGroup/SPIRV-Tools.git;protocol=https;destsuffix=git/SPIRV-Tools;name=spirv-tools;branch=main \ | ||
14 | git://github.com/KhronosGroup/SPIRV-Headers.git;protocol=https;destsuffix=git/SPIRV-Headers;name=spirv-headers;branch=main \ | ||
15 | file://0003-Improve-Reproducibility-for-src-package.patch \ | ||
16 | file://0001-BiF-CMakeLists.txt-remove-opt-from-DEPENDS.patch \ | ||
17 | file://0001-external-SPIRV-Tools-change-path-to-tools-and-header.patch \ | ||
18 | " | ||
19 | |||
20 | SRC_URI:append:class-native = " file://0001-fix-tblgen.patch" | ||
21 | |||
22 | SRCREV_igc = "c2495d45f37fadd963ad22eb0cc1a8235a306775" | ||
23 | SRCREV_vc = "f9c34404d0ea9abad83875a10bd48d88cea90ebd" | ||
24 | SRCREV_spirv-tools = "f0cc85efdbbe3a46eae90e0f915dc1509836d0fc" | ||
25 | SRCREV_spirv-headers = "1c6bb2743599e6eb6f37b2969acc0aef812e32e3" | ||
26 | |||
27 | SRCREV_FORMAT = "igc_vc_spirv-tools_spirv-headers" | ||
28 | |||
29 | # Used to replace with relative path in reproducibility patch | ||
30 | export B | ||
31 | |||
32 | S = "${WORKDIR}/git" | ||
33 | |||
34 | inherit cmake pkgconfig qemu python3native | ||
35 | |||
36 | CXXFLAGS:append = " -Wno-error=nonnull" | ||
37 | |||
38 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
39 | COMPATIBLE_HOST:libc-musl = "null" | ||
40 | |||
41 | DEPENDS += " flex-native bison-native clang clang-cross-x86_64 opencl-clang qemu-native python3-mako-native" | ||
42 | |||
43 | RDEPENDS:${PN} += "opencl-clang" | ||
44 | |||
45 | PACKAGECONFIG ??= "vc" | ||
46 | PACKAGECONFIG[vc] = "-DIGC_BUILD__VC_ENABLED=ON -DIGC_OPTION__LINK_KHRONOS_SPIRV_TRANSLATOR=ON -DIGC_OPTION__SPIRV_TRANSLATOR_MODE=Prebuilds,-DIGC_BUILD__VC_ENABLED=OFF," | ||
47 | |||
48 | EXTRA_OECMAKE = " \ | ||
49 | -DIGC_OPTION__LLVM_PREFERRED_VERSION=${LLVMVERSION} \ | ||
50 | -DVC_INTRINSICS_SRC="${S}/vc-intrinsics" \ | ||
51 | -DIGC_OPTION__LLVM_MODE=Prebuilds \ | ||
52 | -DLLVM_TABLEGEN=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ | ||
53 | -DLLVM_LINK_EXE=${STAGING_BINDIR_NATIVE}/llvm-link \ | ||
54 | -DCLANG_EXE=${STAGING_BINDIR_NATIVE}/clang \ | ||
55 | -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ | ||
56 | " | ||
57 | |||
58 | do_configure:prepend:class-target () { | ||
59 | # Write out a qemu wrapper that will be used by cmake. | ||
60 | qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}" | ||
61 | cat > ${WORKDIR}/qemuwrapper << EOF | ||
62 | #!/bin/sh | ||
63 | $qemu_binary "\$@" | ||
64 | EOF | ||
65 | chmod +x ${WORKDIR}/qemuwrapper | ||
66 | } | ||
67 | |||
68 | UPSTREAM_CHECK_GITTAGREGEX = "^igc-(?P<pver>(?!19\..*)\d+(\.\d+)+)$" | ||
69 | |||
70 | FILES:${PN} += " \ | ||
71 | ${libdir}/igc/NOTICES.txt \ | ||
72 | " | ||
73 | |||
74 | # libigc.so contains buildpaths | ||
75 | INSANE_SKIP:${PN} += "buildpaths" | ||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch new file mode 100644 index 00000000..031a77c7 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | From 5aea653e611b59c70e529a1bd71885a509831557 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Tue, 1 Aug 2023 11:15:31 +0800 | ||
4 | Subject: [PATCH] cl_headers/CMakeLists.txt: use clang from native sysroot | ||
5 | |||
6 | Allow clang to be found in target sysroot for target builds and dont try | ||
7 | to compile cross binaries, we do that ourselves. | ||
8 | |||
9 | Upstream-Status: Inappropriate [oe-specific] | ||
10 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
11 | --- | ||
12 | CMakeLists.txt | 8 ++++---- | ||
13 | cl_headers/CMakeLists.txt | 2 +- | ||
14 | 2 files changed, 5 insertions(+), 5 deletions(-) | ||
15 | |||
16 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
17 | index 5864009..60ba39e 100644 | ||
18 | --- a/CMakeLists.txt | ||
19 | +++ b/CMakeLists.txt | ||
20 | @@ -35,10 +35,10 @@ set(CMAKE_MODULE_PATH | ||
21 | |||
22 | include(CMakeFunctions) | ||
23 | |||
24 | -if(CMAKE_CROSSCOMPILING AND OPENCL_CLANG_BUILD_EXTERNAL) | ||
25 | - include(CrossCompile) | ||
26 | - llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release) | ||
27 | -endif() | ||
28 | +#if(CMAKE_CROSSCOMPILING AND OPENCL_CLANG_BUILD_EXTERNAL) | ||
29 | +# include(CrossCompile) | ||
30 | +# llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release) | ||
31 | +#endif() | ||
32 | |||
33 | if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) | ||
34 | set(USE_PREBUILT_LLVM ON) | ||
35 | diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt | ||
36 | index 16cabb7..4423536 100644 | ||
37 | --- a/cl_headers/CMakeLists.txt | ||
38 | +++ b/cl_headers/CMakeLists.txt | ||
39 | @@ -1,6 +1,6 @@ | ||
40 | set(CL_HEADERS_LIB cl_headers) | ||
41 | if(USE_PREBUILT_LLVM) | ||
42 | - find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR} NO_DEFAULT_PATH) | ||
43 | + find_program(CLANG_COMMAND clang PATHS ${LLVM_TOOLS_BINARY_DIR}) | ||
44 | else() | ||
45 | set(CLANG_COMMAND $<TARGET_FILE:clang>) | ||
46 | endif() | ||
47 | -- | ||
48 | 2.37.3 | ||
49 | |||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch new file mode 100644 index 00000000..2f1814f8 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/files/0002-Request-native-clang-only-when-cross-compiling-464.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | From 43c806ef321b1f677a49d28c89fb7ffecf539c2d Mon Sep 17 00:00:00 2001 | ||
2 | From: Tim Creech <timothy.m.creech@intel.com> | ||
3 | Date: Wed, 28 Jun 2023 03:45:51 -0400 | ||
4 | Subject: [PATCH 2/2] Request native clang only when cross-compiling (#464) | ||
5 | |||
6 | * Request native clang only when cross-compiling | ||
7 | |||
8 | LLVM_USE_HOST_TOOLS may be set if LLVM is configured with | ||
9 | LLVM_OPTIMIZED_TABLEGEN, which does not necessarily indicate | ||
10 | cross-compilation or that clang will only execute on the target. | ||
11 | |||
12 | By checking that CMAKE_CROSSCOMPILING is set, we ensure that we only | ||
13 | build/use clang again if necessary for host execution. | ||
14 | |||
15 | * fixup: CMAKE_CROSSCOMPILING implies LLVM_USE_HOST_TOOLS | ||
16 | |||
17 | Co-authored-by: Wenju He <wenju.he@intel.com> | ||
18 | |||
19 | * fixup: also use CMAKE_CROSSCOMPILING in top-level CMakeLists.txt | ||
20 | |||
21 | --------- | ||
22 | |||
23 | Co-authored-by: Wenju He <wenju.he@intel.com> | ||
24 | |||
25 | Upstream-Status: Backport [https://github.com/intel/opencl-clang/commit/53843eee13cfb2357919ee02714a43bef1af0f86] | ||
26 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
27 | --- | ||
28 | CMakeLists.txt | 2 +- | ||
29 | cl_headers/CMakeLists.txt | 2 +- | ||
30 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
31 | |||
32 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
33 | index e772de9..5864009 100644 | ||
34 | --- a/CMakeLists.txt | ||
35 | +++ b/CMakeLists.txt | ||
36 | @@ -35,7 +35,7 @@ set(CMAKE_MODULE_PATH | ||
37 | |||
38 | include(CMakeFunctions) | ||
39 | |||
40 | -if(LLVM_USE_HOST_TOOLS AND OPENCL_CLANG_BUILD_EXTERNAL) | ||
41 | +if(CMAKE_CROSSCOMPILING AND OPENCL_CLANG_BUILD_EXTERNAL) | ||
42 | include(CrossCompile) | ||
43 | llvm_create_cross_target(${PROJECT_NAME} NATIVE "" Release) | ||
44 | endif() | ||
45 | diff --git a/cl_headers/CMakeLists.txt b/cl_headers/CMakeLists.txt | ||
46 | index 18296c2..16cabb7 100644 | ||
47 | --- a/cl_headers/CMakeLists.txt | ||
48 | +++ b/cl_headers/CMakeLists.txt | ||
49 | @@ -4,7 +4,7 @@ if(USE_PREBUILT_LLVM) | ||
50 | else() | ||
51 | set(CLANG_COMMAND $<TARGET_FILE:clang>) | ||
52 | endif() | ||
53 | -if(LLVM_USE_HOST_TOOLS AND NOT OPENCL_CLANG_BUILD_EXTERNAL) | ||
54 | +if(CMAKE_CROSSCOMPILING AND NOT OPENCL_CLANG_BUILD_EXTERNAL) | ||
55 | build_native_tool(clang CLANG_COMMAND) | ||
56 | endif() | ||
57 | |||
58 | -- | ||
59 | 2.37.3 | ||
60 | |||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc new file mode 100644 index 00000000..31a3fb21 --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang.inc | |||
@@ -0,0 +1,34 @@ | |||
1 | SUMMARY = "Common clang is a thin wrapper library around clang" | ||
2 | DESCRIPTION = "Common clang has OpenCL-oriented API and is capable \ | ||
3 | to compile OpenCL C kernels to SPIR-V modules." | ||
4 | |||
5 | LICENSE = "NCSA" | ||
6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e8a15bf1416762a09ece07e44c79118c" | ||
7 | |||
8 | SRC_URI = "git://github.com/intel/opencl-clang.git;branch=${BRANCH};protocol=https \ | ||
9 | file://0002-Request-native-clang-only-when-cross-compiling-464.patch \ | ||
10 | file://0001-cl_headers-CMakeLists.txt-use-clang-from-native-sysr.patch \ | ||
11 | " | ||
12 | S = "${WORKDIR}/git" | ||
13 | |||
14 | inherit cmake | ||
15 | DEPENDS += "clang" | ||
16 | DEPENDS:append:class-target = " opencl-clang-native" | ||
17 | |||
18 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
19 | COMPATIBLE_HOST:libc-musl = "null" | ||
20 | |||
21 | DEPENDS += " spirv-llvm-translator" | ||
22 | |||
23 | EXTRA_OECMAKE += "\ | ||
24 | -DLLVM_TABLEGEN_EXE=${STAGING_BINDIR_NATIVE}/llvm-tblgen \ | ||
25 | -DCMAKE_SKIP_RPATH=TRUE \ | ||
26 | -DPREFERRED_LLVM_VERSION=${LLVMVERSION} \ | ||
27 | " | ||
28 | |||
29 | do_install:append:class-native() { | ||
30 | install -d ${D}${bindir} | ||
31 | install -m 0755 ${B}/bin/linux_resource_linker ${D}${bindir}/ | ||
32 | } | ||
33 | |||
34 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_15.0.0.bb b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_15.0.0.bb new file mode 100644 index 00000000..e946c31c --- /dev/null +++ b/dynamic-layers/clang-layer/recipes-opencl/opencl-clang/opencl-clang_15.0.0.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | require opencl-clang.inc | ||
2 | |||
3 | SRCREV = "60fd799cc58755c16d951f9ebfde6d0f9b8554dd" | ||
4 | |||
5 | BRANCH = "ocl-open-150" | ||
diff --git a/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.1.0.bb b/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.1.0.bb new file mode 100644 index 00000000..de765d6c --- /dev/null +++ b/dynamic-layers/meta-python/recipes-opencv/dldt/openvino-model-optimizer_2024.1.0.bb | |||
@@ -0,0 +1,33 @@ | |||
1 | SUMMARY = "OpenVINO Model Optimzer" | ||
2 | DESCRIPTION = "Model Optimizer is a cross-platform command-line tool that \ | ||
3 | facilitates the transition between the training and deployment \ | ||
4 | environment, performs static model analysis, and adjusts deep \ | ||
5 | learning models for optimal execution on end-point target devices." | ||
6 | HOMEPAGE = "https://01.org/openvinotoolkit" | ||
7 | |||
8 | SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=https;branch=releases/2024/1;lfs=0 \ | ||
9 | " | ||
10 | SRCREV = "f4afc983258bcb2592d999ed6700043fdb58ad78" | ||
11 | |||
12 | LICENSE = "Apache-2.0" | ||
13 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
14 | |||
15 | CVE_PRODUCT = "intel:openvino" | ||
16 | S = "${WORKDIR}/git" | ||
17 | |||
18 | inherit setuptools3 | ||
19 | |||
20 | SETUPTOOLS_SETUP_PATH = "${WORKDIR}/git/tools/mo" | ||
21 | |||
22 | RDEPENDS:${PN} += " \ | ||
23 | python3-defusedxml \ | ||
24 | python3-fastjsonschema \ | ||
25 | python3-networkx \ | ||
26 | python3-numpy \ | ||
27 | python3-protobuf \ | ||
28 | python3-requests \ | ||
29 | python3-urllib3 \ | ||
30 | bash \ | ||
31 | " | ||
32 | |||
33 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+\.\d+\.\d+))$" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/amt/files/lms_drop_rpath_1921.0.0.0.diff b/dynamic-layers/openembedded-layer/recipes-bsp/amt/files/lms_drop_rpath_1921.0.0.0.diff deleted file mode 100644 index b68924a5..00000000 --- a/dynamic-layers/openembedded-layer/recipes-bsp/amt/files/lms_drop_rpath_1921.0.0.0.diff +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | From b92a5bda8015454a570990a3d9c4fba87010f1af Mon Sep 17 00:00:00 2001 | ||
2 | From: Alexander Usyskin <alexander.usyskin@intel.com> | ||
3 | Date: Mon, 17 Jun 2019 13:27:33 +0300 | ||
4 | Subject: [PATCH] lms: drop rpath definitions | ||
5 | |||
6 | Yocto fail to compile with this definitions. | ||
7 | |||
8 | Upstream-Status: Inappropriate [configuration] | ||
9 | Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> | ||
10 | --- | ||
11 | CMakeLists.txt | 4 ---- | ||
12 | 1 file changed, 4 deletions(-) | ||
13 | |||
14 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
15 | index 04257fb..85d0445 100644 | ||
16 | --- a/CMakeLists.txt | ||
17 | +++ b/CMakeLists.txt | ||
18 | @@ -107,10 +107,6 @@ install (DIRECTORY Docs/Licenses | ||
19 | FILES_MATCHING PATTERN "LICENSE.*" | ||
20 | ) | ||
21 | |||
22 | -list (APPEND CMAKE_INSTALL_RPATH "${PROJECT_BINARY_DIR}/UNS/GMS_COMMON") | ||
23 | -list (APPEND CMAKE_INSTALL_RPATH "${PROJECT_BINARY_DIR}/WsmanClient") | ||
24 | -list (APPEND CMAKE_INSTALL_RPATH "${PROJECT_BINARY_DIR}/UNS/StatusEventHandler") | ||
25 | - | ||
26 | if (BUILD_TESTS) | ||
27 | include (gtest.cmake) | ||
28 | endif (BUILD_TESTS) | ||
29 | -- | ||
30 | 2.7.4 | ||
31 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_1921.0.0.0.bb b/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_1921.0.0.0.bb deleted file mode 100644 index 8ed74486..00000000 --- a/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_1921.0.0.0.bb +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | SUMMARY = "Intel(R) Local Managability Service" | ||
2 | DESCRIPTION = "Intel Local Manageability Service allows applications \ | ||
3 | to access the Intel Active Management Technology (AMT) firmware via \ | ||
4 | the Intel Management Engine Interface (MEI)." | ||
5 | |||
6 | LICENSE = "Apache-2.0" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=2ee41112a44fe7014dce33e26468ba93" | ||
8 | |||
9 | COMPATIBLE_HOST = '(i.86|x86_64).*-linux' | ||
10 | |||
11 | inherit cmake systemd | ||
12 | |||
13 | DEPENDS = "metee ace xerces-c libnl libxml2 glib-2.0 glib-2.0-native connman" | ||
14 | |||
15 | EXTRA_OECMAKE += "-DPYTHON_EXECUTABLE=${HOSTTOOLS_DIR}/python3" | ||
16 | |||
17 | REQUIRED_DISTRO_FEATURES= "systemd" | ||
18 | |||
19 | FILES_${PN} += "${datadir}/dbus-1/system-services/*.service" | ||
20 | |||
21 | FILES_${PN} += "${libdir}/libLms*.so" | ||
22 | FILES_SOLIBSDEV = "" | ||
23 | INSANE_SKIP_${PN} += "dev-so" | ||
24 | |||
25 | S = "${WORKDIR}/git" | ||
26 | |||
27 | SYSTEMD_SERVICE_${PN} = "lms.service" | ||
28 | |||
29 | SRC_URI = "git://github.com/intel/lms.git" | ||
30 | SRCREV = "f7c374745ae7efb3ed7860fdc3f8abbb52dc9f8f" | ||
31 | |||
32 | SRC_URI_append = " file://lms_drop_rpath_${PV}.diff" | ||
33 | |||
34 | do_install_append() { | ||
35 | install -d ${D}${systemd_system_unitdir} | ||
36 | install -m 0644 ${B}/UNS/lms.service ${D}${systemd_system_unitdir} | ||
37 | } | ||
38 | |||
39 | RDEPENDS_${PN} += "ace" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2406.0.0.0.bb b/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2406.0.0.0.bb new file mode 100644 index 00000000..bdf32576 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-bsp/amt/lms_2406.0.0.0.bb | |||
@@ -0,0 +1,44 @@ | |||
1 | SUMMARY = "Intel(R) Local Managability Service" | ||
2 | DESCRIPTION = "Intel Local Manageability Service allows applications \ | ||
3 | to access the Intel Active Management Technology (AMT) firmware via \ | ||
4 | the Intel Management Engine Interface (MEI)." | ||
5 | |||
6 | LICENSE = "Apache-2.0" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=2ee41112a44fe7014dce33e26468ba93" | ||
8 | |||
9 | COMPATIBLE_HOST = '(i.86|x86_64).*-linux' | ||
10 | |||
11 | COMPATIBLE_HOST:libc-musl = "null" | ||
12 | |||
13 | inherit cmake systemd features_check python3native | ||
14 | |||
15 | DEPENDS = "metee ace xerces-c libnl libxml2 glib-2.0 glib-2.0-native pkgconfig-native python3-packaging-native" | ||
16 | |||
17 | # Enable either connman or networkmanager or none but not both. | ||
18 | PACKAGECONFIG ??= "connman" | ||
19 | PACKAGECONFIG[connman] = "-DNETWORK_CN=ON, -DNETWORK_CN=OFF, connman" | ||
20 | PACKAGECONFIG[networkmanager] = "-DNETWORK_NM=ON, -DNETWORK_NM=OFF, networkmanager" | ||
21 | |||
22 | REQUIRED_DISTRO_FEATURES= "systemd" | ||
23 | |||
24 | FILES:${PN} += "${datadir}/dbus-1/system-services/*.service" | ||
25 | |||
26 | S = "${WORKDIR}/git" | ||
27 | |||
28 | SYSTEMD_SERVICE:${PN} = "lms.service" | ||
29 | |||
30 | SRC_URI = "git://github.com/intel/lms.git;branch=master;protocol=https \ | ||
31 | " | ||
32 | SRCREV = "388f115b2aeb3ea11499971c65f828daefd32c47" | ||
33 | |||
34 | do_install:append() { | ||
35 | install -d ${D}${sysconfdir}/lms | ||
36 | install -d ${D}${systemd_system_unitdir} | ||
37 | install -m 0644 ${B}/UNS/lms.service ${D}${systemd_system_unitdir} | ||
38 | install -d ${D}${sysconfdir}/udev/rules.d | ||
39 | install -m 0644 ${S}/UNS/linux_scripts/70-mei-wdt.rules ${D}${sysconfdir}/udev/rules.d/70-mei-wdt.rules | ||
40 | } | ||
41 | |||
42 | RDEPENDS:${PN} += "ace" | ||
43 | |||
44 | CVE_STATUS[CVE-2018-1000535] = "cpe-incorrect: This CVE is for a different LMS - Lan Management System." | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/thermald/files/0001-Makefile-Fix-build-Issue.patch b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/files/0001-Makefile-Fix-build-Issue.patch new file mode 100644 index 00000000..ea86bc31 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/files/0001-Makefile-Fix-build-Issue.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From 1f6f4e29769adb9d49a3c4831dd2ba61f6ccbdce Mon Sep 17 00:00:00 2001 | ||
2 | From: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
3 | Date: Mon, 11 Mar 2024 13:13:32 +0800 | ||
4 | Subject: [PATCH] Makefile: Fix build Issue | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | In case build directory is different from source, make sure make is able to find the correct input files. | ||
10 | |||
11 | Fixes: | ||
12 | | dbus-binding-tool --prefix=thd_dbus_interface --mode=glib-server --output=thd_dbus_interface.h ../git/src/thd_dbus_interface.xml | ||
13 | | glib-compile-resources --generate-source thermald-resource.gresource.xml | ||
14 | | Failed to open file “thermald-resource.gresource.xml”: No such file or directory | ||
15 | |||
16 | Upstream-Status: Submitted | ||
17 | https://github.com/intel/thermal_daemon/pull/436 | ||
18 | |||
19 | Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
20 | --- | ||
21 | Makefile.am | 2 +- | ||
22 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
23 | |||
24 | diff --git a/Makefile.am b/Makefile.am | ||
25 | index dd2ef10..cb19e17 100644 | ||
26 | --- a/Makefile.am | ||
27 | +++ b/Makefile.am | ||
28 | @@ -97,6 +97,6 @@ thd_dbus_interface.h: $(top_srcdir)/src/thd_dbus_interface.xml | ||
29 | $(AM_V_GEN) dbus-binding-tool --prefix=thd_dbus_interface --mode=glib-server --output=$@ $< | ||
30 | |||
31 | thermald-resource.c: $(top_srcdir)/thermald-resource.gresource.xml | ||
32 | - $(AM_V_GEN) glib-compile-resources --generate-source thermald-resource.gresource.xml | ||
33 | + $(AM_V_GEN) glib-compile-resources --generate-source --sourcedir=${top_srcdir} $< | ||
34 | |||
35 | CLEANFILES = $(BUILT_SOURCES) | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.5.7.bb b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.5.7.bb new file mode 100644 index 00000000..66765e56 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-bsp/thermald/thermald_2.5.7.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | SUMMARY = "Linux thermal daemon" | ||
2 | |||
3 | DESCRIPTION = "Thermal Daemon is a Linux daemon used to prevent the \ | ||
4 | overheating of platforms. This daemon monitors temperature and applies \ | ||
5 | compensation using available cooling methods." | ||
6 | |||
7 | HOMEPAGE = "https://github.com/01org/thermal_daemon" | ||
8 | |||
9 | DEPENDS = "dbus dbus-glib dbus-glib-native libxml2 glib-2.0 glib-2.0-native upower libevdev" | ||
10 | DEPENDS += "autoconf-archive-native" | ||
11 | |||
12 | LICENSE = "GPL-2.0-only" | ||
13 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea8831610e926e2e469075b52bf08848" | ||
14 | |||
15 | SRC_URI = "git://github.com/intel/thermal_daemon/;branch=master;protocol=https \ | ||
16 | file://0001-Makefile-Fix-build-Issue.patch \ | ||
17 | " | ||
18 | |||
19 | SRCREV = "ea8b773f76641a7a49d6584669e17371c22ad03e" | ||
20 | S = "${WORKDIR}/git" | ||
21 | |||
22 | inherit pkgconfig autotools systemd gtk-doc | ||
23 | |||
24 | # gtkdocsize runs before autotools do_configure and it copies gtk-doc.m4 and fails | ||
25 | # to copy becuase there is no m4 dir yet. | ||
26 | do_configure:prepend () { | ||
27 | mkdir -p ${S}/m4 | ||
28 | } | ||
29 | |||
30 | EXTRA_OECONF = " \ | ||
31 | --with-systemdsystemunitdir=${systemd_system_unitdir} \ | ||
32 | " | ||
33 | |||
34 | FILES:${PN} += "${datadir}/dbus-1" | ||
35 | |||
36 | SYSTEMD_SERVICE:${PN} = "thermald.service" | ||
37 | |||
38 | COMPATIBLE_HOST = '(i.86|x86_64).*-linux' | ||
39 | |||
40 | CONFFILES:${PN} = " \ | ||
41 | ${sysconfdir}/thermald/thermal-conf.xml \ | ||
42 | ${sysconfdir}/thermald/thermal-cpu-cdev-order.xml \ | ||
43 | " | ||
44 | |||
45 | UPSTREAM_CHECK_URI = "https://github.com/01org/thermal_daemon/releases" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch new file mode 100644 index 00000000..4d583657 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Add-print-function-to-print-test-run-status-in-ptest.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From deccc0c69c2c8759c52885be8bdda54d3cee481c Mon Sep 17 00:00:00 2001 | ||
2 | From: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
3 | Date: Sun, 11 Dec 2022 22:34:15 +0800 | ||
4 | Subject: [PATCH] Add print function to print test run status in ptest format | ||
5 | |||
6 | Upstream-Status: Inappropriate [OE ptest specific] | ||
7 | |||
8 | Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
9 | --- | ||
10 | run_tests.py | 16 ++++++++++++++++ | ||
11 | 1 file changed, 16 insertions(+) | ||
12 | |||
13 | diff --git a/run_tests.py b/run_tests.py | ||
14 | index 1cd796dd..e3ffd1ab 100755 | ||
15 | --- a/run_tests.py | ||
16 | +++ b/run_tests.py | ||
17 | @@ -327,6 +327,9 @@ def run_test(testname, host, target): | ||
18 | else: | ||
19 | ispc_exe_rel = add_prefix(host.ispc_cmd, host, target) | ||
20 | |||
21 | + # to reslove the error '.rodata' can not be used when making a PIE object | ||
22 | + ispc_exe_rel = ispc_exe_rel + " --pic" | ||
23 | + | ||
24 | # is this a test to make sure an error is issued? | ||
25 | want_error = (filename.find("tests_errors") != -1) | ||
26 | if want_error == True: | ||
27 | @@ -795,6 +798,17 @@ def check_compiler_exists(compiler_exe): | ||
28 | return | ||
29 | error("missing the required compiler: %s \n" % compiler_exe, 1) | ||
30 | |||
31 | +def print_test_run_status(results): | ||
32 | + for fstatus in results: | ||
33 | + if (fstatus[1] == Status.Success): | ||
34 | + print( "%s: %s" % ("PASS", fstatus[0])) | ||
35 | + elif (fstatus[1] == Status.Compfail): | ||
36 | + print( "%s: %s" % ("FAIL", fstatus[0])) | ||
37 | + elif (fstatus[1] == Status.Runfail): | ||
38 | + print( "%s: %s" % ("FAIL", fstatus[0])) | ||
39 | + elif (fstatus[1] == Status.Skip): | ||
40 | + print( "%s: %s" % ("SKIP", fstatus[0])) | ||
41 | + | ||
42 | def print_result(status, results, s, run_tests_log, csv): | ||
43 | title = StatusStr[status] | ||
44 | file_list = [fname for fname, fstatus in results if status == fstatus] | ||
45 | @@ -938,6 +952,8 @@ def run_tests(options1, args, print_version): | ||
46 | pass_rate = -1 | ||
47 | print_debug("PASSRATE (%d/%d) = %d%% \n\n" % (len(run_succeed_files), total_tests_executed, pass_rate), s, run_tests_log) | ||
48 | |||
49 | + print_test_run_status(results) | ||
50 | + | ||
51 | for status in Status: | ||
52 | print_result(status, results, s, run_tests_log, options.csv) | ||
53 | fails = [status != Status.Compfail and status != Status.Runfail for _, status in results] | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch new file mode 100644 index 00000000..b0a76ff9 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0001-Fix-QA-Issues.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From 7beff95c11071170eb27b6fa7d0cc77588caee8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
3 | Date: Tue, 26 Jul 2022 15:25:10 +0800 | ||
4 | Subject: [PATCH] Fix QA Issues | ||
5 | |||
6 | Stop ispc from inserting host file path in generated headers which leads to reproducibility problems. | ||
7 | |||
8 | Upstream-Status: Inappropriate [OE build specific] | ||
9 | |||
10 | Signed-off-by: Yogesh Tyagi <yogesh.tyagi@intel.com> | ||
11 | --- | ||
12 | src/module.cpp | 4 ++-- | ||
13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/src/module.cpp b/src/module.cpp | ||
16 | index e2084d2e..e2626865 100644 | ||
17 | --- a/src/module.cpp | ||
18 | +++ b/src/module.cpp | ||
19 | @@ -2555,7 +2555,7 @@ bool Module::writeHeader(const char *fn) { | ||
20 | perror("fopen"); | ||
21 | return false; | ||
22 | } | ||
23 | - fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", fn); | ||
24 | + fprintf(f, "//\n// \n// (Header automatically generated by the ispc compiler.)\n"); | ||
25 | fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n"); | ||
26 | |||
27 | // Create a nice guard string from the filename, turning any | ||
28 | @@ -2677,7 +2677,7 @@ bool Module::writeDispatchHeader(DispatchHeaderInfo *DHI) { | ||
29 | FILE *f = DHI->file; | ||
30 | |||
31 | if (DHI->EmitFrontMatter) { | ||
32 | - fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", DHI->fn); | ||
33 | + fprintf(f, "//\n// \n// (Header automatically generated by the ispc compiler.)\n"); | ||
34 | fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n"); | ||
35 | } | ||
36 | // Create a nice guard string from the filename, turning any | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch new file mode 100644 index 00000000..f452dc50 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/0002-cmake-don-t-build-for-32-bit-targets.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From 16a2c22339287122d2c25d8bb33a5a51b4e6ee51 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Thu, 24 Feb 2022 20:01:11 +0530 | ||
4 | Subject: [PATCH] cmake: don't build for 32-bit targets | ||
5 | |||
6 | Error log: | ||
7 | | tmp/work/corei7-64-poky-linux/ispc/1.16.0-r0/recipe-sysroot/usr/include/bits/long-double.h:23:10: fatal error: 'bits/long-double-32.h' file not found | ||
8 | | #include <bits/long-double-32.h> | ||
9 | | ^~~~~~~~~~~~~~~~~~~~~~~ | ||
10 | | 1 error generated. | ||
11 | |||
12 | Remove SYSTEM include search path and set -isysroot dir path | ||
13 | for root dir for cross compilation. | ||
14 | |||
15 | Upstream-Status: Inappropriate | ||
16 | |||
17 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
18 | --- | ||
19 | cmake/GenerateBuiltins.cmake | 6 +++--- | ||
20 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
21 | |||
22 | diff --git a/cmake/GenerateBuiltins.cmake b/cmake/GenerateBuiltins.cmake | ||
23 | index f84494ed..d90cb1ec 100644 | ||
24 | --- a/cmake/GenerateBuiltins.cmake | ||
25 | +++ b/cmake/GenerateBuiltins.cmake | ||
26 | @@ -253,7 +253,7 @@ function(builtin_to_cpp bit os_name arch supported_archs supported_oses resultFi | ||
27 | # In this case headers will be installed in /usr/arm-linux-gnueabihf/include and will not be picked up | ||
28 | # by clang by default. So the following line adds such path explicitly. If this path doesn't exist and | ||
29 | # the headers can be found in other locations, this should not be a problem. | ||
30 | - set(includePath -isystem/usr/${debian_triple}/include) | ||
31 | + set(includePath -isysroot${SYSROOT_DIR}) | ||
32 | endif() | ||
33 | endif() | ||
34 | |||
35 | @@ -339,7 +339,7 @@ function (generate_target_builtins resultList) | ||
36 | set(regular_targets ${ARGN}) | ||
37 | list(FILTER regular_targets EXCLUDE REGEX wasm) | ||
38 | foreach (ispc_target ${regular_targets}) | ||
39 | - foreach (bit 32 64) | ||
40 | + foreach (bit 64) | ||
41 | foreach (os_name ${TARGET_OS_LIST_FOR_LL}) | ||
42 | target_ll_to_cpp(target-${ispc_target} ${bit} ${os_name} output${os_name}${bit}) | ||
43 | list(APPEND tmpList ${output${os_name}${bit}}) | ||
44 | @@ -405,7 +405,7 @@ function (generate_common_builtins resultList) | ||
45 | endif() | ||
46 | |||
47 | message (STATUS "ISPC will be built with support of ${supported_oses} for ${supported_archs}") | ||
48 | - foreach (bit 32 64) | ||
49 | + foreach (bit 64) | ||
50 | foreach (os_name "windows" "linux" "freebsd" "macos" "android" "ios" "ps4" "web") | ||
51 | foreach (arch "x86" "arm" "wasm") | ||
52 | builtin_to_cpp(${bit} ${os_name} ${arch} "${supported_archs}" "${supported_oses}" res${bit}${os_name}${arch}) | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest new file mode 100644 index 00000000..77d13bb4 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc/run-ptest | |||
@@ -0,0 +1,2 @@ | |||
1 | #!/bin/sh | ||
2 | python3 run_tests.py | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb new file mode 100644 index 00000000..ed8df859 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/ispc/ispc_1.23.0.bb | |||
@@ -0,0 +1,64 @@ | |||
1 | SUMMARY = "Intel(R) Implicit SPMD Program Compiler" | ||
2 | DESCRIPTION = "ispc is a compiler for a variant of the C programming language, \ | ||
3 | with extensions for single program, multiple data programming." | ||
4 | HOMEPAGE = "https://github.com/ispc/ispc" | ||
5 | |||
6 | LICENSE = "BSD-3-Clause & Apache-2.0-with-LLVM-exception" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=da5ecffdd210b3cf776b32b41c182e87 \ | ||
8 | file://third-party-programs.txt;md5=2061218c7be521556719c8b504bf9ddd" | ||
9 | |||
10 | inherit cmake python3native ptest | ||
11 | |||
12 | S = "${WORKDIR}/git" | ||
13 | |||
14 | SRC_URI = "git://github.com/ispc/ispc.git;protocol=https;branch=main \ | ||
15 | file://0002-cmake-don-t-build-for-32-bit-targets.patch \ | ||
16 | file://0001-Fix-QA-Issues.patch \ | ||
17 | file://0001-Add-print-function-to-print-test-run-status-in-ptest.patch \ | ||
18 | file://run-ptest \ | ||
19 | " | ||
20 | |||
21 | SRCREV = "bcb2cf896c00f9a802a11cbf291ef6e44b205416" | ||
22 | |||
23 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
24 | |||
25 | DEPENDS += " clang-native bison-native flex-native" | ||
26 | DEPENDS:append:class-target = " clang" | ||
27 | RDEPENDS:${PN}-ptest += " python3-multiprocessing" | ||
28 | |||
29 | PACKAGECONFIG ??= "tbb" | ||
30 | PACKAGECONFIG[tbb] = "-DISPCRT_BUILD_TASK_MODEL=TBB, -DISPCRT_BUILD_TASK_MODEL=OpenMP, tbb" | ||
31 | |||
32 | YFLAGS='-d -t -v -y --file-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}' | ||
33 | |||
34 | do_configure:prepend() { | ||
35 | sed -i -e 's#\${BISON_EXECUTABLE}.*#\${BISON_EXECUTABLE} ${YFLAGS} #g' ${S}/CMakeLists.txt | ||
36 | sed -i -e 's#\${FLEX_EXECUTABLE}.*#\${FLEX_EXECUTABLE} \-L #g' ${S}/CMakeLists.txt | ||
37 | } | ||
38 | |||
39 | do_install_ptest() { | ||
40 | cp -rf ${S}/run_tests.py ${D}${PTEST_PATH} | ||
41 | cp -rf ${S}/common.py ${D}${PTEST_PATH} | ||
42 | cp -rf ${S}/tests ${D}${PTEST_PATH} | ||
43 | cp -rf ${S}/test_static.isph ${D}${PTEST_PATH} | ||
44 | cp -rf ${S}/fail_db.txt ${D}${PTEST_PATH} | ||
45 | cp -rf ${S}/test_static.cpp ${D}${PTEST_PATH} | ||
46 | } | ||
47 | |||
48 | EXTRA_OECMAKE += " \ | ||
49 | -DISPC_INCLUDE_TESTS=OFF \ | ||
50 | -DISPC_INCLUDE_EXAMPLES=OFF \ | ||
51 | -DARM_ENABLED=OFF \ | ||
52 | -DISPC_CROSS=ON \ | ||
53 | -DISPC_ANDROID_TARGET=OFF \ | ||
54 | -DISPC_FREEBSD_TARGET=OFF \ | ||
55 | -DISPC_WINDOWS_TARGET=OFF \ | ||
56 | -DISPC_IOS_TARGET=OFF \ | ||
57 | -DISPC_PS_TARGET=OFF \ | ||
58 | -DSYSROOT_DIR=${STAGING_DIR} \ | ||
59 | -DCLANG_EXECUTABLE=${STAGING_BINDIR_NATIVE}/clang \ | ||
60 | -DCLANGPP_EXECUTABLE=${STAGING_BINDIR_NATIVE}/clang++ \ | ||
61 | -DLLVM_AS_EXECUTABLE=${STAGING_BINDIR_NATIVE}/llvm-as \ | ||
62 | " | ||
63 | |||
64 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.15.8.bb b/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.15.8.bb new file mode 100644 index 00000000..8bade9f4 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/levelzero/level-zero_1.15.8.bb | |||
@@ -0,0 +1,33 @@ | |||
1 | SUMMARY = "oneAPI Level Zero Specification Headers and Loader" | ||
2 | HOMEPAGE = "https://github.com/oneapi-src/level-zero" | ||
3 | LICENSE = "MIT" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=97957beb2f7808ffa247e5d93e6442cc" | ||
5 | |||
6 | SRC_URI = "git://github.com/oneapi-src/level-zero.git;protocol=https;branch=master" | ||
7 | SRCREV = "1685d01497428ca4d8b99200972b64685424d5c9" | ||
8 | S = "${WORKDIR}/git" | ||
9 | |||
10 | inherit cmake | ||
11 | DEPENDS += "opencl-headers" | ||
12 | |||
13 | UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$" | ||
14 | |||
15 | PACKAGES =+ "${PN}-headers ${PN}-samples ${PN}-loader" | ||
16 | |||
17 | do_install:append () { | ||
18 | install -d ${D}${bindir} ${D}${libdir} | ||
19 | install -m 755 ${B}/bin/zello* ${D}${bindir} | ||
20 | |||
21 | oe_libinstall -C lib libze_null ${D}${libdir} | ||
22 | } | ||
23 | |||
24 | |||
25 | FILES:${PN}-headers = "${includedir}" | ||
26 | FILES:${PN}-samples = "${bindir} ${libdir}/libze_null* ${libdir}/libze_validation*" | ||
27 | FILES:${PN}-loader = "${libdir}" | ||
28 | |||
29 | # PN-loader (non -dev/-dbg/nativesdk- package) contains symlink .so | ||
30 | INSANE_SKIP:${PN}-loader = "dev-so" | ||
31 | INSANE_SKIP:${PN}-samples = "dev-so" | ||
32 | ALLOW_EMPTY:${PN} = "1" | ||
33 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver/0001-Fix-the-compilation-warning-when-using-gcc-13-25.patch b/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver/0001-Fix-the-compilation-warning-when-using-gcc-13-25.patch new file mode 100644 index 00000000..2748d7ab --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver/0001-Fix-the-compilation-warning-when-using-gcc-13-25.patch | |||
@@ -0,0 +1,99 @@ | |||
1 | From b57297c14d94dac9bdef7570b7b33d70b10171f3 Mon Sep 17 00:00:00 2001 | ||
2 | From: Jozef Wludzik <jozef.wludzik@intel.com> | ||
3 | Date: Tue, 26 Mar 2024 14:43:29 +0100 | ||
4 | Subject: [PATCH 1/2] Fix the compilation warning when using gcc-13 (#25) | ||
5 | |||
6 | Added missing headers. Fixed compilation error about casting from | ||
7 | unsigned to signed int. | ||
8 | |||
9 | Upstream-Status: Backport [https://github.com/intel/linux-npu-driver/commit/4bcbf2abe94eb4d9c083bd616b58e309a82d008a] | ||
10 | |||
11 | Signed-off-by: Jozef Wludzik <jozef.wludzik@intel.com> | ||
12 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
13 | --- | ||
14 | umd/level_zero_driver/ext/source/graph/vcl_symbols.hpp | 7 ++++--- | ||
15 | umd/vpu_driver/include/umd_common.hpp | 1 + | ||
16 | validation/umd-test/umd_prime_buffers.h | 9 +++++++-- | ||
17 | validation/umd-test/utilities/data_handle.h | 1 + | ||
18 | 4 files changed, 13 insertions(+), 5 deletions(-) | ||
19 | |||
20 | diff --git a/umd/level_zero_driver/ext/source/graph/vcl_symbols.hpp b/umd/level_zero_driver/ext/source/graph/vcl_symbols.hpp | ||
21 | index f206ebe..682e5b4 100644 | ||
22 | --- a/umd/level_zero_driver/ext/source/graph/vcl_symbols.hpp | ||
23 | +++ b/umd/level_zero_driver/ext/source/graph/vcl_symbols.hpp | ||
24 | @@ -5,12 +5,13 @@ | ||
25 | * | ||
26 | */ | ||
27 | |||
28 | -#include <dlfcn.h> | ||
29 | -#include <memory> | ||
30 | - | ||
31 | #include "vpux_driver_compiler.h" | ||
32 | #include "vpu_driver/source/utilities/log.hpp" | ||
33 | |||
34 | +#include <array> | ||
35 | +#include <dlfcn.h> | ||
36 | +#include <memory> | ||
37 | + | ||
38 | class Vcl { | ||
39 | public: | ||
40 | static Vcl &sym() { | ||
41 | diff --git a/umd/vpu_driver/include/umd_common.hpp b/umd/vpu_driver/include/umd_common.hpp | ||
42 | index 0c874a3..5ad9be2 100644 | ||
43 | --- a/umd/vpu_driver/include/umd_common.hpp | ||
44 | +++ b/umd/vpu_driver/include/umd_common.hpp | ||
45 | @@ -7,6 +7,7 @@ | ||
46 | |||
47 | #pragma once | ||
48 | |||
49 | +#include <cstdint> | ||
50 | #include <limits> | ||
51 | #include <linux/kernel.h> | ||
52 | #include <stdexcept> | ||
53 | diff --git a/validation/umd-test/umd_prime_buffers.h b/validation/umd-test/umd_prime_buffers.h | ||
54 | index 6f7c7de..ab4814c 100644 | ||
55 | --- a/validation/umd-test/umd_prime_buffers.h | ||
56 | +++ b/validation/umd-test/umd_prime_buffers.h | ||
57 | @@ -6,12 +6,17 @@ | ||
58 | */ | ||
59 | |||
60 | #pragma once | ||
61 | + | ||
62 | +#include "umd_test.h" | ||
63 | + | ||
64 | #include <fcntl.h> | ||
65 | -#include <linux/kernel.h> | ||
66 | #include <linux/dma-buf.h> | ||
67 | #include <linux/dma-heap.h> | ||
68 | +#include <linux/kernel.h> | ||
69 | +#include <stdint.h> | ||
70 | #include <sys/ioctl.h> | ||
71 | #include <sys/mman.h> | ||
72 | +#include <unistd.h> | ||
73 | |||
74 | #define ALLIGN_TO_PAGE(x) __ALIGN_KERNEL((x), (UmdTest::PAGE_SIZE)) | ||
75 | |||
76 | @@ -60,7 +65,7 @@ class PrimeBufferHelper { | ||
77 | return false; | ||
78 | |||
79 | bufferFd = heapAlloc.fd; | ||
80 | - buffers.insert({heapAlloc.fd, {size, nullptr}}); | ||
81 | + buffers.insert({static_cast<int>(heapAlloc.fd), {size, nullptr}}); | ||
82 | return true; | ||
83 | } | ||
84 | |||
85 | diff --git a/validation/umd-test/utilities/data_handle.h b/validation/umd-test/utilities/data_handle.h | ||
86 | index d6e0ec0..5d937b2 100644 | ||
87 | --- a/validation/umd-test/utilities/data_handle.h | ||
88 | +++ b/validation/umd-test/utilities/data_handle.h | ||
89 | @@ -6,6 +6,7 @@ | ||
90 | */ | ||
91 | |||
92 | #include <linux/kernel.h> | ||
93 | +#include <stdint.h> | ||
94 | #include <string> | ||
95 | #include <vector> | ||
96 | |||
97 | -- | ||
98 | 2.43.0 | ||
99 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver/0002-Fix-compilation-failure-with-GCC-14.patch b/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver/0002-Fix-compilation-failure-with-GCC-14.patch new file mode 100644 index 00000000..9fb97354 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver/0002-Fix-compilation-failure-with-GCC-14.patch | |||
@@ -0,0 +1,110 @@ | |||
1 | From a9f51fd88effb7d324609e692ca7da576d6dad2e Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Tue, 28 May 2024 10:23:42 +0800 | ||
4 | Subject: [PATCH 2/2] Fix compilation failure with GCC-14 | ||
5 | |||
6 | umd/level_zero_driver/core/source/event/event.cpp:65:31: error: 'remove_if' is not a member of 'std'; did you mean 'remove_cv'? | ||
7 | | 65 | associatedJobs.erase(std::remove_if(associatedJobs.begin(), | ||
8 | | | ^~~~~~~~~ | ||
9 | | | remove_cv | ||
10 | |||
11 | | umd/vpu_driver/source/command/vpu_command.cpp: In member function 'void VPU::VPUCommand::appendAssociateBufferObject(VPU::VPUBufferObject*)': | ||
12 | | umd/vpu_driver/source/command/vpu_command.cpp:126:20: error: 'find' is not a member of 'std'; did you mean 'bind'? | ||
13 | | 126 | auto it = std::find(bufferObjects.begin(), bufferObjects.end(), bo); | ||
14 | | | ^~~~ | ||
15 | | | bind | ||
16 | |||
17 | | umd/vpu_driver/source/command/vpu_command_buffer.cpp: In member function 'bool VPU::VPUCommandBuffer::addCommand(VPU::VPUCommand*, uint64_t&, uint64_t&)': | ||
18 | | umd/vpu_driver/source/command/vpu_command_buffer.cpp:185:24: error: 'find' is not a member of 'std'; did you mean 'bind'? | ||
19 | | 185 | auto it = std::find(bufferHandles.begin(), bufferHandles.end(), bo->getHandle()); | ||
20 | | | ^~~~ | ||
21 | | | bind | ||
22 | |||
23 | | umd/level_zero_driver/ext/source/graph/elf_parser.cpp:301:32: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'? | ||
24 | | 301 | std::max_element(stride_begin + TENSOR_5D_STRIDE_C, stride_end)); | ||
25 | | | ^~~~~~~~~~~ | ||
26 | | | tuple_element | ||
27 | | umd/level_zero_driver/ext/source/graph/elf_parser.cpp:315:37: error: 'max_element' is not a member of 'std'; did you mean 'tuple_element'? | ||
28 | | 315 | auto max_stride_val = *std::max_element(stride_begin + TENSOR_4D_STRIDE_C, stride_end); | ||
29 | | | ^~~~~~~~~~~ | ||
30 | |||
31 | | umd/level_zero_driver/tools/source/metrics/metric.cpp: In member function 'void L0::MetricContext::deactivateMetricGroups(int)': | ||
32 | | umd/level_zero_driver/tools/source/metrics/metric.cpp:275:38: error: 'remove_if' is not a member of 'std'; did you mean 'remove_cv'? | ||
33 | | 275 | activatedMetricGroups.erase(std::remove_if(activatedMetricGroups.begin(), | ||
34 | | | ^~~~~~~~~ | ||
35 | | | remove_cv | ||
36 | |||
37 | Upstream-Status: Submitted [https://github.com/intel/linux-npu-driver/pull/30] | ||
38 | |||
39 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
40 | --- | ||
41 | umd/level_zero_driver/core/source/event/event.cpp | 1 + | ||
42 | umd/level_zero_driver/ext/source/graph/elf_parser.cpp | 1 + | ||
43 | umd/level_zero_driver/tools/source/metrics/metric.cpp | 1 + | ||
44 | umd/vpu_driver/source/command/vpu_command.cpp | 1 + | ||
45 | umd/vpu_driver/source/command/vpu_command_buffer.cpp | 1 + | ||
46 | 5 files changed, 5 insertions(+) | ||
47 | |||
48 | diff --git a/umd/level_zero_driver/core/source/event/event.cpp b/umd/level_zero_driver/core/source/event/event.cpp | ||
49 | index a92248f..196d176 100644 | ||
50 | --- a/umd/level_zero_driver/core/source/event/event.cpp | ||
51 | +++ b/umd/level_zero_driver/core/source/event/event.cpp | ||
52 | @@ -14,6 +14,7 @@ | ||
53 | |||
54 | #include <level_zero/ze_api.h> | ||
55 | #include <thread> | ||
56 | +#include <algorithm> | ||
57 | |||
58 | namespace L0 { | ||
59 | |||
60 | diff --git a/umd/level_zero_driver/ext/source/graph/elf_parser.cpp b/umd/level_zero_driver/ext/source/graph/elf_parser.cpp | ||
61 | index a1c8e14..dfbd61d 100644 | ||
62 | --- a/umd/level_zero_driver/ext/source/graph/elf_parser.cpp | ||
63 | +++ b/umd/level_zero_driver/ext/source/graph/elf_parser.cpp | ||
64 | @@ -21,6 +21,7 @@ | ||
65 | #include <vpux_headers/metadata.hpp> | ||
66 | #include <vpux_elf/types/vpu_extensions.hpp> | ||
67 | #include <vpux_elf/utils/error.hpp> | ||
68 | +#include <algorithm> | ||
69 | |||
70 | namespace L0 { | ||
71 | |||
72 | diff --git a/umd/level_zero_driver/tools/source/metrics/metric.cpp b/umd/level_zero_driver/tools/source/metrics/metric.cpp | ||
73 | index b67750f..9497311 100644 | ||
74 | --- a/umd/level_zero_driver/tools/source/metrics/metric.cpp | ||
75 | +++ b/umd/level_zero_driver/tools/source/metrics/metric.cpp | ||
76 | @@ -7,6 +7,7 @@ | ||
77 | |||
78 | #include "level_zero_driver/tools/source/metrics/metric.hpp" | ||
79 | #include "vpu_driver/source/utilities/log.hpp" | ||
80 | +#include <algorithm> | ||
81 | |||
82 | namespace L0 { | ||
83 | |||
84 | diff --git a/umd/vpu_driver/source/command/vpu_command.cpp b/umd/vpu_driver/source/command/vpu_command.cpp | ||
85 | index f4ca23f..75331d9 100644 | ||
86 | --- a/umd/vpu_driver/source/command/vpu_command.cpp | ||
87 | +++ b/umd/vpu_driver/source/command/vpu_command.cpp | ||
88 | @@ -14,6 +14,7 @@ | ||
89 | #include <cstdint> | ||
90 | #include <vector> | ||
91 | #include <map> | ||
92 | +#include <algorithm> | ||
93 | |||
94 | namespace VPU { | ||
95 | |||
96 | diff --git a/umd/vpu_driver/source/command/vpu_command_buffer.cpp b/umd/vpu_driver/source/command/vpu_command_buffer.cpp | ||
97 | index c4ad052..bbb80ec 100644 | ||
98 | --- a/umd/vpu_driver/source/command/vpu_command_buffer.cpp | ||
99 | +++ b/umd/vpu_driver/source/command/vpu_command_buffer.cpp | ||
100 | @@ -11,6 +11,7 @@ | ||
101 | #include "vpu_driver/source/command/vpu_command_buffer.hpp" | ||
102 | #include "vpu_driver/source/command/vpu_copy_command.hpp" | ||
103 | #include "vpu_driver/source/utilities/log.hpp" | ||
104 | +#include <algorithm> | ||
105 | |||
106 | namespace VPU { | ||
107 | |||
108 | -- | ||
109 | 2.43.0 | ||
110 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver_1.2.0.bb b/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver_1.2.0.bb new file mode 100644 index 00000000..03e409af --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-core/linux-npu-driver/linux-npu-driver_1.2.0.bb | |||
@@ -0,0 +1,33 @@ | |||
1 | SUMMARY = "User Mode Driver for Intel® NPU device" | ||
2 | HOMEPAGE = "https://github.com/intel/linux-npu-driver" | ||
3 | LICENSE = "MIT & Apache-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=37acda99f3f9c108e62d970fe0e08027 \ | ||
5 | file://third-party-programs.txt;md5=dbf0d7a91947cccc5410e9760d9acae5 \ | ||
6 | file://third_party/vpux_elf/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327" | ||
7 | |||
8 | SRC_URI = "git://github.com/intel/linux-npu-driver.git;protocol=https;name=linux-npu-driver;branch=main;lfs=1 \ | ||
9 | git://github.com/openvinotoolkit/npu_plugin_elf.git;protocol=https;destsuffix=git/third_party/vpux_elf;name=vpux-elf;nobranch=1 \ | ||
10 | git://github.com/jbeder/yaml-cpp.git;protocol=https;destsuffix=git/third_party/yaml-cpp;name=yaml-cpp;nobranch=1 \ | ||
11 | git://github.com/intel/level-zero-npu-extensions.git;protocol=https;destsuffix=git/third_party/level-zero-vpu-extensions;name=lzvext;nobranch=1 \ | ||
12 | git://github.com/google/googletest.git;protocol=https;destsuffix=git/third_party/googletest;name=googletest;nobranch=1 \ | ||
13 | file://0001-Fix-the-compilation-warning-when-using-gcc-13-25.patch \ | ||
14 | file://0002-Fix-compilation-failure-with-GCC-14.patch \ | ||
15 | " | ||
16 | |||
17 | SRCREV_linux-npu-driver = "9d1dd3daa01ebd97a4ac2e8279ddd6e2cb109244" | ||
18 | SRCREV_vpux-elf = "03878c115d13aa1ce6af5329c5759fc1cc94a3fb" | ||
19 | SRCREV_yaml-cpp = "0579ae3d976091d7d664aa9d2527e0d0cff25763" | ||
20 | SRCREV_lzvext = "0e1c471356a724ef6d176ba027a68e210d90939e" | ||
21 | SRCREV_googletest = "b796f7d44681514f58a683a3a71ff17c94edb0c1" | ||
22 | SRCREV_FORMAT = "linux-npu-driver_vpux-elf_yaml-cpp_lzvext_googletest" | ||
23 | |||
24 | S = "${WORKDIR}/git" | ||
25 | |||
26 | inherit cmake | ||
27 | |||
28 | DEPENDS = "level-zero" | ||
29 | |||
30 | PACKAGES =+ "${PN}-firmware ${PN}-tests" | ||
31 | |||
32 | FILES:${PN}-firmware = "${libdir}/firmware/updates/intel/vpu/*" | ||
33 | FILES:${PN}-tests = "${bindir}" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp-runtime_2024.0.0-49819.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp-runtime_2024.0.0-49819.bb new file mode 100644 index 00000000..cedbae1e --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp-runtime_2024.0.0-49819.bb | |||
@@ -0,0 +1,54 @@ | |||
1 | SUMMARY = "Intel® oneAPI DPC++/C++ Compiler runtime files" | ||
2 | DESCRIPTION = "The Intel® oneAPI DPC++/C++ Compiler provides optimizations \ | ||
3 | that help your applications run faster on Intel® 64 architectures with support \ | ||
4 | for the latest C, C++, and SYCL language standards. This compiler produces \ | ||
5 | optimized code that can run significantly faster by taking advantage of the \ | ||
6 | ever-increasing core count and vector register width in Intel® Xeon® processors \ | ||
7 | and compatible processors." | ||
8 | |||
9 | HOMEPAGE = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html" | ||
10 | |||
11 | LICENSE="EULA" | ||
12 | |||
13 | COMPILERMAINVER = "2024.0" | ||
14 | |||
15 | LIC_FILES_CHKSUM = " \ | ||
16 | file://opt/intel/oneapi/licensing/${COMPILERMAINVER}/licensing/${COMPILERMAINVER}/license.htm;md5=5ff64c6ff3ef98089ed69360e7a84c39 \ | ||
17 | " | ||
18 | COMPILERDOTVER = "2024.0.0-49406" | ||
19 | DEVUTILITVERSION = "2024.0-2024.0.0-49320" | ||
20 | SRC_URI = " \ | ||
21 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-dpcpp-cpp-runtime-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=dpcpp-runtime \ | ||
22 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-dpcpp-cpp-common-${COMPILERMAINVER}-${PV}_all.deb;subdir=${BPN};name=dpcpp-common \ | ||
23 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-shared-runtime-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=compiler-shared-runtime \ | ||
24 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-common-vars-${COMPILERDOTVER}_all.deb;subdir=${BPN};name=common-vars \ | ||
25 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-openmp-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=openmp \ | ||
26 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-openmp-common-${COMPILERMAINVER}-${PV}_all.deb;subdir=${BPN};name=openmp-common \ | ||
27 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-common-licensing-${COMPILERMAINVER}-${COMPILERDOTVER}_all.deb;subdir=${BPN};name=license \ | ||
28 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-dev-utilities-${DEVUTILITVERSION}_amd64.deb;subdir=${BPN};name=dev-utils \ | ||
29 | " | ||
30 | |||
31 | SRC_URI[dpcpp-runtime.sha256sum] = "e24f0ba69daf3f66ceaf23d5e632f183cdb90bac69f65407fdb4407fc9034f33" | ||
32 | SRC_URI[dpcpp-common.sha256sum] = "f5a3db6a725598224edf1099260955aee3e36beadcaed2af5b8b453e873a82fa" | ||
33 | SRC_URI[compiler-shared-runtime.sha256sum] = "bce010cbe076259ddd3feb8e69792869e22fccd5b4e2c9af9e815826f2c1a394" | ||
34 | SRC_URI[common-vars.sha256sum] = "368553c99db1b52060b8225355336778be0b00e5991d0f769c42f891c6328750" | ||
35 | SRC_URI[openmp.sha256sum] = "154ff1e81adfdc872ba1d47bd860de70d62188417c7128422435dfd0ceca62fe" | ||
36 | SRC_URI[openmp-common.sha256sum] = "8217001d78311cbef97dd139e684c6767932b532309c3843ba57d7894d15c07d" | ||
37 | SRC_URI[license.sha256sum] = "9f9c8a12fc0bc82ab5b71e118e66745eff23f42224eba304068225b366cd74b6" | ||
38 | SRC_URI[dev-utils.sha256sum] = "c675d960a5abca361cead9217d6e74adee499ee0a095c4e44092bd710b304d50" | ||
39 | |||
40 | S = "${WORKDIR}/${BPN}" | ||
41 | |||
42 | inherit bin_package | ||
43 | |||
44 | RDEPENDS:${PN} += "virtual-opencl-icd zlib tbb level-zero-loader bash tcsh" | ||
45 | SKIP_FILEDEPS:${PN} = '1' | ||
46 | |||
47 | INHIBIT_PACKAGE_STRIP = "1" | ||
48 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
49 | |||
50 | # doesn't have GNU_HASH (didn't pass LDFLAGS?) | ||
51 | INSANE_SKIP:${PN} += "textrel dev-so dev-elf ldflags already-stripped staticdev rpaths arch useless-rpaths file-rdeps" | ||
52 | |||
53 | FILES_SOLIBSDEV = "" | ||
54 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp_2024.0.0-49819.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp_2024.0.0-49819.bb new file mode 100644 index 00000000..90ada087 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/dpcpp-compiler/intel-oneapi-dpcpp-cpp_2024.0.0-49819.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | SUMMARY = "Intel® oneAPI DPC++/C++ Compiler" | ||
2 | DESCRIPTION = "The Intel® oneAPI DPC++/C++ Compiler provides optimizations \ | ||
3 | that help your applications run faster on Intel® 64 architectures with support \ | ||
4 | for the latest C, C++, and SYCL language standards. This compiler produces \ | ||
5 | optimized code that can run significantly faster by taking advantage of the \ | ||
6 | ever-increasing core count and vector register width in Intel® Xeon® processors \ | ||
7 | and compatible processors." | ||
8 | |||
9 | HOMEPAGE = "https://www.intel.com/content/www/us/en/developer/tools/oneapi/dpc-compiler.html" | ||
10 | |||
11 | LICENSE="EULA" | ||
12 | |||
13 | COMPILERMAINVER = "2024.0" | ||
14 | |||
15 | LIC_FILES_CHKSUM = " \ | ||
16 | file://opt/intel/oneapi/compiler/${COMPILERMAINVER}/share/doc/compiler/credist.txt;md5=b41f55af9f479b9570fc35b955d5ba1a \ | ||
17 | " | ||
18 | |||
19 | SRC_URI = " \ | ||
20 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-dpcpp-cpp-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=icx-compiler \ | ||
21 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-shared-${COMPILERMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=compiler-linker \ | ||
22 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-compiler-shared-common-${COMPILERMAINVER}-${PV}_all.deb;subdir=${BPN};name=shared-common \ | ||
23 | " | ||
24 | |||
25 | SRC_URI[icx-compiler.sha256sum] = "0dcbac766d5a1519d4cf393f5a85e71d19024fef65f77638f3f849796b62cd82" | ||
26 | SRC_URI[compiler-linker.sha256sum] = "e00faea6d797934d62143e4aa70b727ce30f80fdf30769d22122b3051140c236" | ||
27 | SRC_URI[shared-common.sha256sum] = "cf490a4a790f349da79e618359598d3b32312ca3b2639e5d4c84e1cfa2745558" | ||
28 | |||
29 | S = "${WORKDIR}/${BPN}" | ||
30 | |||
31 | inherit bin_package | ||
32 | |||
33 | RDEPENDS:${PN} += "intel-oneapi-dpcpp-cpp-runtime" | ||
34 | SKIP_FILEDEPS:${PN} = '1' | ||
35 | |||
36 | INHIBIT_PACKAGE_STRIP = "1" | ||
37 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
38 | |||
39 | # doesn't have GNU_HASH (didn't pass LDFLAGS?) | ||
40 | INSANE_SKIP:${PN} += "textrel dev-so dev-elf ldflags already-stripped file-rdeps staticdev rpaths arch useless-rpaths" | ||
41 | |||
42 | FILES_SOLIBSDEV = "" | ||
43 | |||
44 | EXCLUDE_FROM_SHLIBS = "1" | ||
45 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb new file mode 100644 index 00000000..1eeaf339 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/embree/embree_4.3.1.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | SUMMARY = "Collection of high-performance ray tracing kernels" | ||
2 | DESCRIPTION = "A collection of high-performance ray tracing kernels \ | ||
3 | intended to graphics application engineers that want to improve the \ | ||
4 | performance of their application." | ||
5 | HOMEPAGE = "https://github.com/embree/embree" | ||
6 | |||
7 | LICENSE = "Apache-2.0 & BSD-3-Clause" | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
9 | file://third-party-programs.txt;md5=f989f5b74cfff0d45d3ccf0e1366cbdc \ | ||
10 | file://common/math/transcendental.h;beginline=6;endline=8;md5=73380bb2ab6613b30b8464f114bd0ca8" | ||
11 | |||
12 | inherit pkgconfig cmake | ||
13 | |||
14 | S = "${WORKDIR}/git" | ||
15 | |||
16 | SRC_URI = "git://github.com/embree/embree.git;protocol=https;branch=master" | ||
17 | SRCREV = "daa8de0e714e18ad5e5c9841b67c1950d9c91c51" | ||
18 | |||
19 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
20 | COMPATIBLE_HOST:libc-musl = "null" | ||
21 | |||
22 | DEPENDS = "tbb jpeg libpng glfw ispc-native" | ||
23 | |||
24 | EXTRA_OECMAKE += " \ | ||
25 | -DEMBREE_IGNORE_CMAKE_CXX_FLAGS=OFF \ | ||
26 | -DEMBREE_MAX_ISA=DEFAULT \ | ||
27 | -DEMBREE_TUTORIALS=OFF \ | ||
28 | -DEMBREE_ISPC_SUPPORT=ON \ | ||
29 | -DEMBREE_ZIP_MODE=OFF \ | ||
30 | " | ||
31 | |||
32 | UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.10.0-653.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.10.0-653.bb new file mode 100644 index 00000000..1841253e --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/ipp/intel-oneapi-ipp_2021.10.0-653.bb | |||
@@ -0,0 +1,35 @@ | |||
1 | DESCRIPTION = "Intel® Integrated Performance Primitives are production-ready \ | ||
2 | building blocks for cross-platform performance. Develop high-performance vision, \ | ||
3 | signal, security, and storage applications with this multithreaded software library." | ||
4 | HOMEPAGE = "https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/ipp.html" | ||
5 | |||
6 | LICENSE = "ISSL" | ||
7 | |||
8 | MAXVER = "2021.10" | ||
9 | |||
10 | LIC_FILES_CHKSUM = " \ | ||
11 | file://opt/intel/oneapi/ipp/${MAXVER}/share/doc/ipp/licensing/license.txt;md5=d7cdc92ed6c4de1263da879599ddc3e2 \ | ||
12 | file://opt/intel/oneapi/ipp/${MAXVER}/share/doc/ipp/licensing/third-party-programs.txt;md5=22bd13987911dcf790907041b43081f3 \ | ||
13 | " | ||
14 | SRC_URI = " \ | ||
15 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-ipp-${MAXVER}-${PV}_amd64.deb;subdir=${BPN};name=ipp \ | ||
16 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-ipp-common-devel-${MAXVER}-${PV}_all.deb;subdir=${BPN};name=headers \ | ||
17 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-ipp-common-${MAXVER}-${PV}_all.deb;subdir=${BPN};name=env \ | ||
18 | " | ||
19 | |||
20 | SRC_URI[ipp.sha256sum] = "b51e45c6e691aa46c7136b0ab61f5abe346388433e017a30cf53fd23e92bea07" | ||
21 | SRC_URI[headers.sha256sum] = "342f37ab2f82bc9f4498435f848ee660591c2488b44d988bf6ee96b2a71fd005" | ||
22 | SRC_URI[env.sha256sum] = "731e8c28a3b8b757730cd874d0941de2eb744856128f24ade59d36c12b415bf6" | ||
23 | |||
24 | S = "${WORKDIR}/${BPN}" | ||
25 | |||
26 | COMPATIBLE_HOST:libc-musl = "null" | ||
27 | |||
28 | inherit bin_package | ||
29 | |||
30 | INHIBIT_PACKAGE_STRIP = "1" | ||
31 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
32 | INHIBIT_DEFAULT_DEPS = "" | ||
33 | |||
34 | RDEPENDS:${PN} += "tbb setup-intel-oneapi-env" | ||
35 | INSANE_SKIP:${PN} += "ldflags dev-so" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2024.0.0-49656.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2024.0.0-49656.bb new file mode 100644 index 00000000..e3e93028 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/mkl/intel-oneapi-mkl_2024.0.0-49656.bb | |||
@@ -0,0 +1,74 @@ | |||
1 | SUMMARY = "Intel® oneAPI Math Kernel Library (oneMKL)" | ||
2 | DESCRIPTION = "The Intel® oneAPI Math Kernel Library (oneMKL) is a computing \ | ||
3 | math library of highly optimized and extensively parallelized routines \ | ||
4 | for applications that require maximum performance. oneMKL contains \ | ||
5 | the high-performance optimizations from the full Intel® Math Kernel Library \ | ||
6 | for CPU architectures (with C/Fortran programming language interfaces)\ | ||
7 | and adds to them a set of DPC++ programming language interfaces for \ | ||
8 | achieving performance on various CPU architectures \ | ||
9 | and Intel Graphics Technology for certain key functionalities." | ||
10 | HOMEPAGE = "https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl.html" | ||
11 | |||
12 | LICENSE = "ISSL" | ||
13 | |||
14 | MKLMAINVER = "2024.0" | ||
15 | |||
16 | LIC_FILES_CHKSUM = " \ | ||
17 | file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/license.txt;md5=8510d21bf355a76e378c3216c3929ccd \ | ||
18 | file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs-benchmarks.txt;md5=cb98e1a1f14c05ea85a979ea8982e7a4 \ | ||
19 | file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs-ipp.txt;md5=a4b2bf15e38f5c1267cdafed18bc0b09 \ | ||
20 | file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs-openmp.txt;md5=6b3c1aa2a11393060074c0346ce21e49 \ | ||
21 | file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs-safestring.txt;md5=c3aeee91c6d35a0f0753aed6c2633b82 \ | ||
22 | file://opt/intel/oneapi/mkl/${MKLMAINVER}/share/doc/mkl/licensing/third-party-programs.txt;md5=27de873e4084d62530fe828406b33ca9 \ | ||
23 | " | ||
24 | |||
25 | SRC_URI = " \ | ||
26 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-${MKLMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=runtime \ | ||
27 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-common-devel-${MKLMAINVER}-${PV}_all.deb;subdir=${BPN};name=common-devel \ | ||
28 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-devel-${MKLMAINVER}-${PV}_amd64.deb;subdir=${BPN};name=devel \ | ||
29 | https://apt.repos.intel.com/oneapi/pool/main/intel-oneapi-mkl-common-${MKLMAINVER}-${PV}_all.deb;subdir=${BPN};name=common-vars \ | ||
30 | " | ||
31 | |||
32 | SRC_URI[runtime.sha256sum] = "10a86e24051d6ef4a80fd839c570e629190638a3c0ac9bcca99ab855f534b959" | ||
33 | SRC_URI[common-devel.sha256sum] = "adbf0ea946f63946d29b7f9c750c38a42ea7a65d8c81655b268aa2c7bb908192" | ||
34 | SRC_URI[devel.sha256sum] = "fab2a6f15e18bfd9b4d425f2703e4e98928c57f52c4feebc9ed886f097062e84" | ||
35 | SRC_URI[common-vars.sha256sum] = "ec2b67813739fa4a2895f63479a41acba2174afe2d0cb8a0c1c9119d1317d8ef" | ||
36 | |||
37 | S = "${WORKDIR}/${BPN}" | ||
38 | |||
39 | inherit bin_package | ||
40 | |||
41 | do_install:append () { | ||
42 | install -d ${D}${bindir} | ||
43 | (cd ${D}${bindir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/bin/* .) | ||
44 | install -d ${D}${libdir} | ||
45 | (cd ${D}${libdir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/intel64/*.so* .) | ||
46 | (cd ${D}${libdir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/intel64/*.a* .) | ||
47 | install -d ${D}${libdir}/pkgconfig | ||
48 | (cd ${D}${libdir}/pkgconfig ; ln -s ../../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/pkgconfig/* .) | ||
49 | install -d ${D}${libdir}/cmake | ||
50 | (cd ${D}${libdir}/cmake ; ln -s ../../../opt/intel/oneapi/mkl/${MKLMAINVER}/lib/cmake/* .) | ||
51 | |||
52 | install -d ${D}${includedir} | ||
53 | find ${D}/opt/intel/oneapi/mkl/${MKLMAINVER}/include/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read srcdir; do | ||
54 | install -d ${D}${includedir}/$srcdir | ||
55 | (cd ${D}${includedir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/include/$srcdir/* ./$srcdir/) | ||
56 | done | ||
57 | |||
58 | find ${D}/opt/intel/oneapi/mkl/${MKLMAINVER}/include/ -mindepth 1 -maxdepth 1 -type f -printf '%f\n' | while read srcfile; do | ||
59 | (cd ${D}${includedir} ; ln -s ../../opt/intel/oneapi/mkl/${MKLMAINVER}/include/$srcfile .) | ||
60 | done | ||
61 | } | ||
62 | |||
63 | AUTO_LIBNAME_PKGS = "" | ||
64 | INHIBIT_PACKAGE_STRIP = "1" | ||
65 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
66 | |||
67 | RDEPENDS:${PN} += "bash tbb intel-oneapi-dpcpp-cpp-runtime setup-intel-oneapi-env virtual-opencl-icd" | ||
68 | INSANE_SKIP:${PN} = "ldflags textrel dev-so staticdev arch already-stripped" | ||
69 | |||
70 | FILES:${PN}-staticdev += "/opt/intel/oneapi/mkl/${MKLMAINVER}/lib/*.a*" | ||
71 | |||
72 | SKIP_FILEDEPS:${PN} = '1' | ||
73 | |||
74 | SYSROOT_DIRS += "/opt" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb new file mode 100644 index 00000000..4ea6ffbe --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/oidn/oidn_2.1.0.bb | |||
@@ -0,0 +1,23 @@ | |||
1 | SUMMARY = "Intel® Open Image Denoise" | ||
2 | DESCRIPTION = "Intel Open Image Denoise is an open source library of \ | ||
3 | high-performance, high-quality denoising filters for images \ | ||
4 | rendered with ray tracing. Intel Open Image Denoise is part \ | ||
5 | of the Intel® oneAPI Rendering Toolkit" | ||
6 | HOMEPAGE = "https://www.openimagedenoise.org/" | ||
7 | |||
8 | LICENSE = "Apache-2.0 & BSD-3-Clause" | ||
9 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
10 | file://external/mkl-dnn/LICENSE;md5=b48e3de3bfd47c27882a0d85b20823f5 \ | ||
11 | file://external/mkl-dnn/src/cpu/x64/xbyak/COPYRIGHT;md5=3b9bf048d063d54cdb28964db558bcc7 \ | ||
12 | file://external/mkl-dnn/src/common/ittnotify/LICENSE.BSD;md5=e671ff178b24a95a382ba670503c66fb \ | ||
13 | file://weights/LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
14 | |||
15 | SRC_URI = "https://github.com/OpenImageDenoise/${BPN}/releases/download/v${PV}/${BP}.src.tar.gz\ | ||
16 | " | ||
17 | SRC_URI[sha256sum] = "ce144ba582ff36563d9442ee07fa2a4d249bc85aa93e5b25fc527ff4ee755ed6" | ||
18 | |||
19 | inherit cmake | ||
20 | |||
21 | DEPENDS += "tbb ispc-native" | ||
22 | |||
23 | UPSTREAM_CHECK_URI = "https://github.com/OpenImageDenoise/oidn/releases" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb new file mode 100644 index 00000000..a2d709a1 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/openvkl/openvkl_2.0.1.bb | |||
@@ -0,0 +1,42 @@ | |||
1 | SUMMARY = "Intel(R) Open Volume Kernel Library" | ||
2 | DESCRIPTION = "Intel(R) Open Volume Kernel Library (Intel(R) Open VKL) is a \ | ||
3 | collection of high-performance volume computation kernels. The target users \ | ||
4 | of Open VKL are graphics application engineers who want to improve the \ | ||
5 | performance of their volume rendering applications by leveraging Open VKL’s \ | ||
6 | performance-optimized kernels, which include volume traversal and sampling \ | ||
7 | functionality for a variety of volumetric data formats. The kernels are optimized \ | ||
8 | for the latest Intel(R) processors with support for SSE, AVX, AVX2, and AVX-512 \ | ||
9 | instructions." | ||
10 | HOMEPAGE = "https://www.openvkl.org/" | ||
11 | |||
12 | LICENSE = "Apache-2.0 & BSD-3-Clause & MIT & Zlib" | ||
13 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
14 | file://third-party-programs.txt;md5=69ec7caf49616c471161b921f53d5ec0 \ | ||
15 | file://testing/external/half.hpp;beginline=1;endline=17;md5=4b60058493630c3bd0ef145470f04a7b" | ||
16 | |||
17 | inherit pkgconfig cmake | ||
18 | |||
19 | S = "${WORKDIR}/git" | ||
20 | |||
21 | SRC_URI = "git://github.com/openvkl/openvkl.git;protocol=https;branch=master \ | ||
22 | " | ||
23 | SRCREV = "8c6ba526813b871a624cb9d73d4cbb689ac7f4ce" | ||
24 | |||
25 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
26 | COMPATIBLE_HOST:libc-musl = "null" | ||
27 | |||
28 | DEPENDS = "ispc ispc-native rkcommon embree" | ||
29 | |||
30 | EXTRA_OECMAKE += " \ | ||
31 | -DISPC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/ispc \ | ||
32 | " | ||
33 | EXTRA_OECMAKE:intel-corei7-64 += " \ | ||
34 | -DOPENVKL_ISA_AVX=OFF \ | ||
35 | -DOPENVKL_ISA_AVX2=OFF \ | ||
36 | -DOPENVKL_ISA_AVX512SKX=OFF \ | ||
37 | " | ||
38 | |||
39 | PACKAGES =+ "${PN}-examples" | ||
40 | FILES:${PN}-examples = "\ | ||
41 | ${bindir} \ | ||
42 | " | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray/0001-Fix-GCC11-Compile-Error-in-benchmark_register.h.patch b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray/0001-Fix-GCC11-Compile-Error-in-benchmark_register.h.patch new file mode 100644 index 00000000..c2136321 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray/0001-Fix-GCC11-Compile-Error-in-benchmark_register.h.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 09e6b6615d9a16e9555eff9d569356e32bd26aa4 Mon Sep 17 00:00:00 2001 | ||
2 | From: benradel <86351445+benradel@users.noreply.github.com> | ||
3 | Date: Wed, 23 Jun 2021 11:56:03 +0200 | ||
4 | Subject: [PATCH] Fix GCC11 Compile Error in benchmark_register.h | ||
5 | |||
6 | Fix GCC11 compilation error due to missing header "limits" in benchmark_register.h | ||
7 | |||
8 | Upstream-Status: Submitted [https://github.com/ospray/ospray/pull/484/files] | ||
9 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
10 | --- | ||
11 | apps/common/external/benchmark/src/benchmark_register.h | 1 + | ||
12 | 1 file changed, 1 insertion(+) | ||
13 | |||
14 | diff --git a/apps/common/external/benchmark/src/benchmark_register.h b/apps/common/external/benchmark/src/benchmark_register.h | ||
15 | index 61377d742..8f1bb7795 100644 | ||
16 | --- a/apps/common/external/benchmark/src/benchmark_register.h | ||
17 | +++ b/apps/common/external/benchmark/src/benchmark_register.h | ||
18 | @@ -2,6 +2,7 @@ | ||
19 | #define BENCHMARK_REGISTER_H | ||
20 | |||
21 | #include <vector> | ||
22 | +#include <limits> | ||
23 | |||
24 | #include "check.h" | ||
25 | |||
26 | -- | ||
27 | 2.32.0 | ||
28 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb new file mode 100644 index 00000000..3e03dcc2 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/ospray/ospray_3.1.0.bb | |||
@@ -0,0 +1,37 @@ | |||
1 | SUMMARY = "Intel OSPray, Ray Tracing based Rendering Engine" | ||
2 | DESCRIPTION = "Intel OSPRay is an open source, scalable, and portable ray \ | ||
3 | tracing engine for high-performance, high-fidelity visualization on \ | ||
4 | Intel Architecture CPUs." | ||
5 | HOMEPAGE = "https://www.ospray.org/" | ||
6 | |||
7 | LICENSE = "Apache-2.0 & BSD-3-Clause & MIT & Zlib" | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=1dece7821bf3fd70fe1309eaa37d52a2 \ | ||
9 | file://third-party-programs.txt;md5=e37b77e3bd997abccc359c710fb1f1db \ | ||
10 | " | ||
11 | |||
12 | inherit pkgconfig cmake | ||
13 | |||
14 | S = "${WORKDIR}/git" | ||
15 | |||
16 | SRC_URI = "git://github.com/ospray/ospray.git;protocol=https;branch=master \ | ||
17 | " | ||
18 | SRCREV = "f2a61c2eb58ccd666e34abfdb0fd7049ea073194" | ||
19 | |||
20 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
21 | COMPATIBLE_HOST:libc-musl = "null" | ||
22 | |||
23 | DEPENDS = "rkcommon ispc ispc-native openvkl embree" | ||
24 | |||
25 | EXTRA_OECMAKE += " \ | ||
26 | -DISPC_EXECUTABLE=${STAGING_BINDIR_NATIVE}/ispc \ | ||
27 | -DOSPRAY_ENABLE_APPS_BENCHMARK=OFF \ | ||
28 | -DOSPRAY_ENABLE_APPS_TESTING=OFF \ | ||
29 | -DOSPRAY_ENABLE_APPS_EXAMPLES=OFF \ | ||
30 | " | ||
31 | |||
32 | PACKAGES =+ "${PN}-apps" | ||
33 | FILES:${PN}-apps = "\ | ||
34 | ${bindir} \ | ||
35 | " | ||
36 | |||
37 | UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>(\d+(\.\d+)+))$" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb new file mode 100644 index 00000000..fe6b23ea --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-oneapi/rkcommon/rkcommon_1.13.0.bb | |||
@@ -0,0 +1,19 @@ | |||
1 | SUMMARY = "rkcommon - C++/CMake infrastructure" | ||
2 | DESCRIPTION = "A common set of C++ infrastructure and CMake utilities \ | ||
3 | used by various components of Intel® oneAPI Rendering Toolkit." | ||
4 | HOMEPAGE = "https://github.com/ospray/rkcommon" | ||
5 | |||
6 | LICENSE = "Apache-2.0" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=3b83ef96387f14655fc854ddc3c6bd57" | ||
8 | |||
9 | inherit pkgconfig cmake | ||
10 | |||
11 | S = "${WORKDIR}/git" | ||
12 | |||
13 | SRC_URI = "git://github.com/ospray/rkcommon.git;protocol=https;branch=master \ | ||
14 | " | ||
15 | SRCREV = "7ebfa0765ea590767202b328e7da38102c2f5a15" | ||
16 | |||
17 | DEPENDS = "tbb" | ||
18 | |||
19 | EXTRA_OECMAKE += " -DBUILD_TESTING=OFF" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-disable-Werror.patch b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-disable-Werror.patch new file mode 100644 index 00000000..4474aa3c --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-CMakeLists-disable-Werror.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From ef56be8e6bf2ea273cbeb960f3131164e7b517b6 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Wed, 18 May 2022 12:24:03 +0800 | ||
4 | Subject: [PATCH] CMakeLists: disable Werror | ||
5 | |||
6 | gcc12 highlights minor warnings that cause the build to fail. Ignore | ||
7 | those until they aren't fixed upstream. | ||
8 | |||
9 | Upstream-Status: Inappropriate | ||
10 | |||
11 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
12 | --- | ||
13 | CMakeLists.txt | 4 ++-- | ||
14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
17 | index 418483f7..c019fea0 100644 | ||
18 | --- a/CMakeLists.txt | ||
19 | +++ b/CMakeLists.txt | ||
20 | @@ -146,7 +146,7 @@ else() | ||
21 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -fno-strict-aliasing -D_FORTIFY_SOURCE=2") | ||
22 | if(LNX_BUILD) | ||
23 | #A few warnings yet to resolve under esx | ||
24 | - set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Werror") | ||
25 | + #set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Werror") | ||
26 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Werror") | ||
27 | endif() | ||
28 | set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -ggdb") | ||
29 | @@ -791,4 +791,4 @@ if(ESX_BUILD) | ||
30 | include(CMake/esx.cmake) | ||
31 | endif() | ||
32 | |||
33 | -add_subdirectory(src/os/nvm_api_sample) | ||
34 | \ No newline at end of file | ||
35 | +add_subdirectory(src/os/nvm_api_sample) | ||
36 | -- | ||
37 | 2.35.3 | ||
38 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch new file mode 100644 index 00000000..11305e83 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl/0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | Subject: [PATCH] [PATCH]: ignore static asserts and null define for os and ut | ||
2 | builds | ||
3 | Upstream-Status: Backport | ||
4 | Signed-off-by: Teoh Suh Haw <suh.haw.teoh@intel.com> | ||
5 | --- | ||
6 | MdePkg/Include/Base.h | 12 ++++++++++++ | ||
7 | 1 file changed, 12 insertions(+) | ||
8 | |||
9 | diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h | ||
10 | index d209e6de28..6e61b8f3d3 100644 | ||
11 | --- a/MdePkg/Include/Base.h | ||
12 | +++ b/MdePkg/Include/Base.h | ||
13 | @@ -316,8 +316,12 @@ struct _LIST_ENTRY { | ||
14 | #define NULL __null | ||
15 | #endif | ||
16 | #else | ||
17 | +#ifndef OS_BUILD | ||
18 | +#ifndef UNIT_TEST_UEFI_BUILD | ||
19 | #define NULL ((VOID *) 0) | ||
20 | #endif | ||
21 | +#endif | ||
22 | +#endif | ||
23 | |||
24 | // | ||
25 | // Null character | ||
26 | @@ -779,6 +783,8 @@ typedef UINTN *BASE_LIST; | ||
27 | // Section 2.3.1 of the UEFI 2.3 Specification. | ||
28 | // | ||
29 | |||
30 | +#ifndef OS_BUILD | ||
31 | +#ifndef UNIT_TEST_UEFI_BUILD | ||
32 | STATIC_ASSERT (sizeof (BOOLEAN) == 1, "sizeof (BOOLEAN) does not meet UEFI Specification Data Type requirements"); | ||
33 | STATIC_ASSERT (sizeof (INT8) == 1, "sizeof (INT8) does not meet UEFI Specification Data Type requirements"); | ||
34 | STATIC_ASSERT (sizeof (UINT8) == 1, "sizeof (UINT8) does not meet UEFI Specification Data Type requirements"); | ||
35 | @@ -792,6 +798,8 @@ STATIC_ASSERT (sizeof (CHAR8) == 1, "sizeof (CHAR8) does not meet UEFI Specifi | ||
36 | STATIC_ASSERT (sizeof (CHAR16) == 2, "sizeof (CHAR16) does not meet UEFI Specification Data Type requirements"); | ||
37 | STATIC_ASSERT (sizeof (L'A') == 2, "sizeof (L'A') does not meet UEFI Specification Data Type requirements"); | ||
38 | STATIC_ASSERT (sizeof (L"A") == 4, "sizeof (L\"A\") does not meet UEFI Specification Data Type requirements"); | ||
39 | +#endif | ||
40 | +#endif | ||
41 | |||
42 | // | ||
43 | // The following three enum types are used to verify that the compiler | ||
44 | @@ -812,9 +820,13 @@ typedef enum { | ||
45 | __VerifyUint32EnumValue = 0xffffffff | ||
46 | } __VERIFY_UINT32_ENUM_SIZE; | ||
47 | |||
48 | +#ifndef OS_BUILD | ||
49 | +#ifndef UNIT_TEST_UEFI_BUILD | ||
50 | STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); | ||
51 | STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); | ||
52 | STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); | ||
53 | +#endif | ||
54 | +#endif | ||
55 | |||
56 | /** | ||
57 | Macro that returns a pointer to the data structure that contains a specified field of | ||
58 | -- | ||
59 | 2.37.3 | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0485.bb b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0485.bb new file mode 100644 index 00000000..c4743d1c --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/ipmctl/ipmctl_03.00.00.0485.bb | |||
@@ -0,0 +1,47 @@ | |||
1 | SUMMARY = "Utility for managing Intel Optane DC persistent memory modules" | ||
2 | DESCRIPTION = "Utility for configuring and managing Intel Optane Persistent \ | ||
3 | Memory modules (PMem). It supports functionality to: \ | ||
4 | Discover DCPMMs on the platform. \ | ||
5 | Provision the platform memory configuration. \ | ||
6 | View and update the firmware on DCPMMs. \ | ||
7 | Configure data-at-rest security on DCPMMs. \ | ||
8 | Track health and performance of DCPMMs. \ | ||
9 | Debug and troubleshoot DCPMMs." | ||
10 | |||
11 | HOMEPAGE = "https://github.com/intel/ipmctl" | ||
12 | BUGTRACKER = "https://github.com/intel/ipmctl/issues" | ||
13 | |||
14 | LICENSE = "BSD-3-Clause | BSD-2-Clause" | ||
15 | LIC_FILES_CHKSUM = "file://LICENSE;md5=72b9da60da6219d612ce30b746a0fe71 \ | ||
16 | file://edk2/License.txt;md5=6123e5bf044a66db96c4ce88a36b2d08" | ||
17 | |||
18 | SRC_URI = "git://github.com/intel/ipmctl.git;protocol=https;branch=master;name=ipmctl; \ | ||
19 | git://github.com/tianocore/edk2.git;protocol=https;name=edk2;destsuffix=git/edk2;branch=master \ | ||
20 | file://0001-Ignore-STATIC_ASSERTs-and-NULL-define-for-os-and-ut-builds.patch;patchdir=edk2 \ | ||
21 | file://0001-CMakeLists-disable-Werror.patch \ | ||
22 | " | ||
23 | |||
24 | SRCREV_ipmctl = "c75bd840ea7820c8f93a5488fcff75d08beedd51" | ||
25 | #tag edk2-stable202302 | ||
26 | SRCREV_edk2 = "f80f052277c88a67c55e107b550f504eeea947d3" | ||
27 | SRCREV_FORMAT = "ipmctl_edk2" | ||
28 | |||
29 | S = "${WORKDIR}/git" | ||
30 | |||
31 | inherit cmake dos2unix | ||
32 | |||
33 | DEPENDS = "ndctl pkgconfig-native" | ||
34 | |||
35 | EXTRA_OECMAKE = "-DRELEASE=ON" | ||
36 | |||
37 | do_configure:prepend() { | ||
38 | for dir in BaseTools MdeModulePkg MdePkg ShellPkg ; do | ||
39 | ln -sf edk2/${dir} ${S} | ||
40 | done | ||
41 | } | ||
42 | |||
43 | do_install:append() { | ||
44 | # Remove /var/log/ipmctl as anything created in /var/log will not be | ||
45 | # available when tmpfs is mounted at /var/volatile/log. | ||
46 | rm -rf ${D}${localstatedir}/log | ||
47 | } | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch new file mode 100644 index 00000000..7f5b46c6 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0001-cmake-yocto-specific-tweaks-to-the-build-process.patch | |||
@@ -0,0 +1,86 @@ | |||
1 | From e4edbdae9a2dbfec6fd0706bdfff8abdfe3363fc Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Wed, 29 Nov 2023 12:42:57 +0530 | ||
4 | Subject: [PATCH] cmake: yocto specific tweaks to the build process | ||
5 | |||
6 | * Dont try to detect glibc version as that doesn't work when cross compiling. | ||
7 | * Dont try to detect CXX11_ABI | ||
8 | * Install sample binaries as well. | ||
9 | * Dont try to write triggers for CPack. We package ourselves. | ||
10 | * Fix the installation path for Python modules when baselib = lib64. | ||
11 | |||
12 | Upstream-Status: Inappropriate | ||
13 | |||
14 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
15 | --- | ||
16 | cmake/developer_package/packaging/rpm/rpm.cmake | 2 +- | ||
17 | cmake/developer_package/target_flags.cmake | 4 ++-- | ||
18 | samples/cpp/CMakeLists.txt | 6 +++--- | ||
19 | src/bindings/python/CMakeLists.txt | 2 +- | ||
20 | 4 files changed, 7 insertions(+), 7 deletions(-) | ||
21 | |||
22 | diff --git a/cmake/developer_package/packaging/rpm/rpm.cmake b/cmake/developer_package/packaging/rpm/rpm.cmake | ||
23 | index 99f11730983..1a1f61fcd3d 100644 | ||
24 | --- a/cmake/developer_package/packaging/rpm/rpm.cmake | ||
25 | +++ b/cmake/developer_package/packaging/rpm/rpm.cmake | ||
26 | @@ -156,7 +156,7 @@ ov_rpm_specific_settings() | ||
27 | # needed to add triggers for packages with libraries | ||
28 | set(def_triggers "${OpenVINO_BINARY_DIR}/_CPack_Packages/triggers") | ||
29 | set(triggers_content "# /bin/sh -p\n/sbin/ldconfig\n") | ||
30 | -file(WRITE "${def_triggers}" "${triggers_content}") | ||
31 | +#file(WRITE "${def_triggers}" "${triggers_content}") | ||
32 | |||
33 | # | ||
34 | # Functions helpful for packaging your modules with RPM cpack | ||
35 | diff --git a/cmake/developer_package/target_flags.cmake b/cmake/developer_package/target_flags.cmake | ||
36 | index d047a1aebd9..4e8ca68c60f 100644 | ||
37 | --- a/cmake/developer_package/target_flags.cmake | ||
38 | +++ b/cmake/developer_package/target_flags.cmake | ||
39 | @@ -149,7 +149,7 @@ function(ov_glibc_version) | ||
40 | endif() | ||
41 | endfunction() | ||
42 | |||
43 | -ov_glibc_version() | ||
44 | +#ov_glibc_version() | ||
45 | |||
46 | # | ||
47 | # Detects default value for _GLIBCXX_USE_CXX11_ABI for current compiler | ||
48 | @@ -160,4 +160,4 @@ macro(ov_get_glibcxx_use_cxx11_abi) | ||
49 | endif() | ||
50 | endmacro() | ||
51 | |||
52 | -ov_get_glibcxx_use_cxx11_abi() | ||
53 | +#ov_get_glibcxx_use_cxx11_abi() | ||
54 | diff --git a/samples/cpp/CMakeLists.txt b/samples/cpp/CMakeLists.txt | ||
55 | index 4d33bff944e..3e7f1458578 100644 | ||
56 | --- a/samples/cpp/CMakeLists.txt | ||
57 | +++ b/samples/cpp/CMakeLists.txt | ||
58 | @@ -206,9 +206,9 @@ macro(ov_add_sample) | ||
59 | target_link_libraries(${SAMPLE_NAME} PRIVATE ${ov_link_libraries} Threads::Threads ${SAMPLE_DEPENDENCIES}) | ||
60 | |||
61 | install(TARGETS ${SAMPLE_NAME} | ||
62 | - RUNTIME DESTINATION samples_bin/ | ||
63 | - COMPONENT samples_bin | ||
64 | - EXCLUDE_FROM_ALL) | ||
65 | + DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
66 | + COMPONENT samples_bin) | ||
67 | + | ||
68 | |||
69 | # create global target with all samples / demo apps | ||
70 | if(NOT TARGET ov_samples) | ||
71 | diff --git a/src/bindings/python/CMakeLists.txt b/src/bindings/python/CMakeLists.txt | ||
72 | index 6cf43ec3fed..d539b9d003f 100644 | ||
73 | --- a/src/bindings/python/CMakeLists.txt | ||
74 | +++ b/src/bindings/python/CMakeLists.txt | ||
75 | @@ -320,7 +320,7 @@ if(ENABLE_PYTHON_PACKAGING) | ||
76 | # install OpenVINO Python API | ||
77 | |||
78 | set(python_package_prefix "${CMAKE_CURRENT_BINARY_DIR}/install_${pyversion}") | ||
79 | - set(install_lib "${python_package_prefix}/lib/${python_versioned_folder}/${ov_site_packages}") | ||
80 | + set(install_lib "${python_package_prefix}/${CMAKE_INSTALL_LIBDIR}/${python_versioned_folder}/${ov_site_packages}") | ||
81 | set(openvino_meta_info_subdir "openvino-${OpenVINO_VERSION}-py${python_xy}.egg-info") | ||
82 | set(openvino_meta_info_file "${install_lib}/${openvino_meta_info_subdir}/PKG-INFO") | ||
83 | |||
84 | -- | ||
85 | 2.34.1 | ||
86 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cmake-Fix-overloaded-virtual-error.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cmake-Fix-overloaded-virtual-error.patch new file mode 100644 index 00000000..8a1464d5 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0002-cmake-Fix-overloaded-virtual-error.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 4a909a03b6dd336e7ea76e3f44d7cfb5d7e44798 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Wed, 29 Nov 2023 12:49:35 +0530 | ||
4 | Subject: [PATCH 2/3] cmake: Fix overloaded-virtual error | ||
5 | |||
6 | * Remove -Werror for: | ||
7 | |git/src/plugins/intel_gpu/src/kernel_selector/jitter.h:129:28: error: 'virtual kernel_selector::JitDefinitions kernel_selector::JitConstant::GetDefinitions() const' was hidden [-Werror=overloaded-virtual=] | ||
8 | | 129 | virtual JitDefinitions GetDefinitions() const = 0; | ||
9 | | | | ||
10 | |||
11 | Upstream-Status: Pending | ||
12 | |||
13 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
14 | --- | ||
15 | src/plugins/intel_gpu/CMakeLists.txt | 2 +- | ||
16 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
17 | |||
18 | diff --git a/src/plugins/intel_gpu/CMakeLists.txt b/src/plugins/intel_gpu/CMakeLists.txt | ||
19 | index 2f3d9127dde..2fd4f5c1b3c 100644 | ||
20 | --- a/src/plugins/intel_gpu/CMakeLists.txt | ||
21 | +++ b/src/plugins/intel_gpu/CMakeLists.txt | ||
22 | @@ -47,7 +47,7 @@ add_subdirectory(thirdparty) | ||
23 | include(thirdparty/cmake/rapidjson.cmake) | ||
24 | |||
25 | if(CMAKE_COMPILER_IS_GNUCXX) | ||
26 | - ov_add_compiler_flags(-Werror) | ||
27 | + #ov_add_compiler_flags(-Werror) | ||
28 | endif() | ||
29 | |||
30 | add_subdirectory(src/runtime) | ||
31 | -- | ||
32 | 2.34.1 | ||
33 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-protobuf-allow-target-protoc-to-be-built.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-protobuf-allow-target-protoc-to-be-built.patch new file mode 100644 index 00000000..bbdeaa2a --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/files/0003-protobuf-allow-target-protoc-to-be-built.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From 450d94b475460d1af32b207d0ced495794863f0d Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Wed, 29 Nov 2023 12:55:19 +0530 | ||
4 | Subject: [PATCH 3/3] protobuf: allow target protoc to be built | ||
5 | |||
6 | We can run target binaries using a qemu wrapper so allow these to be | ||
7 | built and run. | ||
8 | |||
9 | Upstream-Status: Inappropriate | ||
10 | |||
11 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
12 | --- | ||
13 | cmake/developer_package/frontends/frontends.cmake | 2 +- | ||
14 | thirdparty/protobuf/CMakeLists.txt | 2 +- | ||
15 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/cmake/developer_package/frontends/frontends.cmake b/cmake/developer_package/frontends/frontends.cmake | ||
18 | index f3b5520d6d2..7579f638c5a 100644 | ||
19 | --- a/cmake/developer_package/frontends/frontends.cmake | ||
20 | +++ b/cmake/developer_package/frontends/frontends.cmake | ||
21 | @@ -163,7 +163,7 @@ macro(ov_add_frontend) | ||
22 | set(OUTPUT_PB_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${relative_path}/${FILE_WE}.pb.h) | ||
23 | add_custom_command( | ||
24 | OUTPUT "${OUTPUT_PB_SRC}" "${OUTPUT_PB_HEADER}" | ||
25 | - COMMAND ${PROTOC_EXECUTABLE} ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${protofiles_root_dir} ${proto_file} | ||
26 | + COMMAND protoc ARGS --cpp_out ${CMAKE_CURRENT_BINARY_DIR} -I ${protofiles_root_dir} ${proto_file} | ||
27 | DEPENDS ${PROTOC_DEPENDENCY} ${proto_file} | ||
28 | COMMENT "Running C++ protocol buffer compiler (${PROTOC_EXECUTABLE}) on ${proto_file_relative}" | ||
29 | VERBATIM | ||
30 | diff --git a/thirdparty/protobuf/CMakeLists.txt b/thirdparty/protobuf/CMakeLists.txt | ||
31 | index 15f32601f23..36853caf7dc 100644 | ||
32 | --- a/thirdparty/protobuf/CMakeLists.txt | ||
33 | +++ b/thirdparty/protobuf/CMakeLists.txt | ||
34 | @@ -31,7 +31,7 @@ unset(HAVE_ZLIB CACHE) | ||
35 | if(CMAKE_CROSSCOMPILING OR | ||
36 | (APPLE AND (HOST_X86_64 AND AARCH64)) OR | ||
37 | (MSVC AND (HOST_X86_64 AND (AARCH64 OR ARM)))) | ||
38 | - set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build protoc binaries" FORCE) | ||
39 | + set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "Build protoc binaries" FORCE) | ||
40 | else() | ||
41 | set(protobuf_BUILD_PROTOC_BINARIES ON CACHE BOOL "Build protoc binaries" FORCE) | ||
42 | endif() | ||
43 | -- | ||
44 | 2.34.1 | ||
45 | |||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch new file mode 100644 index 00000000..816a98a3 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo/0001-use-oe-gflags.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 804b08023b3f8e72b8e3eb09e464d6775c11d966 Mon Sep 17 00:00:00 2001 | ||
2 | From: Naveen Saini <naveen.kumar.saini@intel.com> | ||
3 | Date: Fri, 21 Oct 2022 11:38:23 +0800 | ||
4 | Subject: [PATCH] demos: use gflags from meta-oe | ||
5 | |||
6 | Upstream-Status: Inappropriate | ||
7 | |||
8 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
9 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
10 | |||
11 | --- | ||
12 | demos/CMakeLists.txt | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt | ||
16 | index 51767051c..fb7e3d22f 100644 | ||
17 | --- a/demos/CMakeLists.txt | ||
18 | +++ b/demos/CMakeLists.txt | ||
19 | @@ -141,7 +141,7 @@ endmacro() | ||
20 | find_package(OpenCV REQUIRED COMPONENTS core highgui videoio imgproc imgcodecs) | ||
21 | find_package(OpenVINO REQUIRED COMPONENTS Runtime) | ||
22 | |||
23 | -add_subdirectory(thirdparty/gflags) | ||
24 | +#add_subdirectory(thirdparty/gflags) | ||
25 | add_subdirectory(common/cpp) | ||
26 | |||
27 | find_package(OpenCV QUIET COMPONENTS gapi) | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.1.0.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.1.0.bb new file mode 100644 index 00000000..a9422e70 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/open-model-zoo_2024.1.0.bb | |||
@@ -0,0 +1,54 @@ | |||
1 | SUMMARY = "OpenVINO(TM) Toolkit - Open Model Zoo repository" | ||
2 | HOMEPAGE = "https://github.com/opencv/open_model_zoo" | ||
3 | DESCRIPTION = "This repository includes optimized deep learning \ | ||
4 | models and a set of demos to expedite development of high-performance \ | ||
5 | deep learning inference applications." | ||
6 | |||
7 | SRC_URI = "git://github.com/opencv/open_model_zoo.git;protocol=https;branch=master \ | ||
8 | file://0001-use-oe-gflags.patch \ | ||
9 | " | ||
10 | |||
11 | SRCREV = "cf5141dad2a4f24e1c5d5b9d43219ed804c48bbf" | ||
12 | |||
13 | LICENSE = "Apache-2.0" | ||
14 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
15 | " | ||
16 | |||
17 | inherit cmake | ||
18 | |||
19 | S = "${WORKDIR}/git" | ||
20 | OECMAKE_SOURCEPATH = "${S}/demos" | ||
21 | |||
22 | DEPENDS += "openvino-inference-engine opencv gflags" | ||
23 | |||
24 | RDEPENDS:${PN} += " \ | ||
25 | python3-decorator \ | ||
26 | python3-defusedxml \ | ||
27 | python3-networkx \ | ||
28 | python3-protobuf \ | ||
29 | python3-requests \ | ||
30 | python3-pyyaml \ | ||
31 | python3-numpy \ | ||
32 | bash \ | ||
33 | " | ||
34 | |||
35 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
36 | COMPATIBLE_HOST:libc-musl = "null" | ||
37 | |||
38 | EXTRA_OECMAKE += " \ | ||
39 | -DENABLE_SAMPLES=ON \ | ||
40 | " | ||
41 | |||
42 | do_install(){ | ||
43 | install -d ${D}${libdir} | ||
44 | install -d ${D}${bindir} | ||
45 | install -d ${D}${datadir}/openvino/open-model-zoo/tools | ||
46 | install -d ${D}${datadir}/openvino/open-model-zoo/demos | ||
47 | cp -rf ${B}/intel64/Release/*.a ${D}${libdir} | ||
48 | cp -rf ${B}/intel64/Release/*_demo* ${D}${bindir} | ||
49 | cp -rf ${S}/models ${D}${datadir}/openvino/open-model-zoo | ||
50 | cp -rf ${S}/demos ${D}${datadir}/openvino/open-model-zoo | ||
51 | cp -rf ${S}/tools/model_tools ${D}${datadir}/openvino/open-model-zoo/tools | ||
52 | } | ||
53 | |||
54 | FILES:${PN} += "${datadir}/openvino" | ||
diff --git a/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.1.0.bb b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.1.0.bb new file mode 100644 index 00000000..675d9920 --- /dev/null +++ b/dynamic-layers/openembedded-layer/recipes-support/opencv/openvino-inference-engine_2024.1.0.bb | |||
@@ -0,0 +1,146 @@ | |||
1 | SUMMARY = "OpenVINO(TM) Toolkit - Deep Learning Deployment Toolkit" | ||
2 | HOMEPAGE = "https://github.com/opencv/dldt" | ||
3 | DESCRIPTION = "This toolkit allows developers to deploy pre-trained \ | ||
4 | deep learning models through a high-level C++ Inference Engine API \ | ||
5 | integrated with application logic." | ||
6 | |||
7 | SRC_URI = "git://github.com/openvinotoolkit/openvino.git;protocol=https;name=openvino;branch=releases/2024/1;lfs=0 \ | ||
8 | git://github.com/openvinotoolkit/oneDNN.git;protocol=https;destsuffix=git/src/plugins/intel_cpu/thirdparty/onednn;name=mkl;nobranch=1 \ | ||
9 | git://github.com/oneapi-src/oneDNN.git;protocol=https;destsuffix=git/src/plugins/intel_gpu/thirdparty/onednn_gpu;name=onednn;nobranch=1 \ | ||
10 | git://github.com/herumi/xbyak.git;protocol=https;destsuffix=git/thirdparty/xbyak;name=xbyak;branch=master \ | ||
11 | git://github.com/nlohmann/json.git;protocol=https;destsuffix=git/thirdparty/json/nlohmann_json;name=json;branch=develop \ | ||
12 | git://github.com/opencv/ade.git;protocol=https;destsuffix=git/thirdparty/ade;name=ade;nobranch=1 \ | ||
13 | git://github.com/protocolbuffers/protobuf.git;protocol=https;destsuffix=git/thirdparty/protobuf/protobuf;name=protobuf;branch=3.20.x \ | ||
14 | git://github.com/gflags/gflags.git;protocol=https;destsuffix=git/thirdparty/gflags/gflags;name=gflags;nobranch=1 \ | ||
15 | git://github.com/madler/zlib.git;protocol=https;destsuffix=git/thirdparty/zlib/zlib;name=zlib;nobranch=1 \ | ||
16 | git://github.com/openvinotoolkit/mlas.git;protocol=https;destsuffix=git/src/plugins/intel_cpu/thirdparty/mlas;name=mlas;nobranch=1 \ | ||
17 | git://github.com/nodejs/node-api-headers.git;protocol=https;destsuffix=git/node-api-headers-src;name=node-api-headers;nobranch=1 \ | ||
18 | git://github.com/nodejs/node-addon-api.git;protocol=https;destsuffix=git/node-addon-api-src;name=node-addon-api;nobranch=1 \ | ||
19 | git://github.com/openvinotoolkit/telemetry.git;protocol=https;destsuffix=git/thirdparty/telemetry;name=telemetry;nobranch=1;lfs=0 \ | ||
20 | file://0001-cmake-yocto-specific-tweaks-to-the-build-process.patch \ | ||
21 | file://0002-cmake-Fix-overloaded-virtual-error.patch \ | ||
22 | file://0003-protobuf-allow-target-protoc-to-be-built.patch \ | ||
23 | " | ||
24 | |||
25 | SRCREV_openvino = "f4afc983258bcb2592d999ed6700043fdb58ad78" | ||
26 | SRCREV_mkl = "26633ae49edd4353a29b7170d9fcef6b2d79f4b3" | ||
27 | SRCREV_onednn = "4e6ff043c439652fcf6c400ac4e0c81bbac7c71c" | ||
28 | SRCREV_xbyak = "740dff2e866f3ae1a70dd42d6e8836847ed95cc2" | ||
29 | SRCREV_json = "9cca280a4d0ccf0c08f47a99aa71d1b0e52f8d03" | ||
30 | SRCREV_ade = "0e8a2ccdd34f29dba55894f5f3c5179809888b9e" | ||
31 | SRCREV_protobuf = "fe271ab76f2ad2b2b28c10443865d2af21e27e0e" | ||
32 | SRCREV_gflags = "e171aa2d15ed9eb17054558e0b3a6a413bb01067" | ||
33 | SRCREV_zlib = "09155eaa2f9270dc4ed1fa13e2b4b2613e6e4851" | ||
34 | SRCREV_mlas = "d1bc25ec4660cddd87804fcf03b2411b5dfb2e94" | ||
35 | SRCREV_node-api-headers = "186e04b5e40e54d7fd1655bc67081cc483f12488" | ||
36 | SRCREV_node-addon-api = "39a25bf27788ff7a7ea5c64978c4dcd1e7b9d80d" | ||
37 | SRCREV_telemetry = "58e16c257a512ec7f451c9fccf9ff455065b285b" | ||
38 | SRCREV_FORMAT = "openvino_mkl_onednn_xbyak_json_ade_protobuf_gflags_zlib_node-api-headers_node-addon-api_mlas_telemetry" | ||
39 | |||
40 | LICENSE = "Apache-2.0 & MIT & BSD-3-Clause & Zlib" | ||
41 | LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
42 | file://thirdparty/xbyak/COPYRIGHT;md5=3c98edfaa50a86eeaef4c6109e803f16 \ | ||
43 | file://thirdparty/cnpy/LICENSE;md5=689f10b06d1ca2d4b1057e67b16cd580 \ | ||
44 | file://thirdparty/json/nlohmann_json/LICENSE.MIT;md5=f969127d7b7ed0a8a63c2bbeae002588 \ | ||
45 | file://thirdparty/ade/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57 \ | ||
46 | file://thirdparty/gflags/gflags/COPYING.txt;md5=c80d1a3b623f72bb85a4c75b556551df \ | ||
47 | file://thirdparty/zlib/zlib/LICENSE;md5=b51a40671bc46e961c0498897742c0b8 \ | ||
48 | file://src/plugins/intel_cpu/thirdparty/mlas/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
49 | file://src/plugins/intel_cpu/thirdparty/onednn/LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \ | ||
50 | file://src/plugins/intel_gpu/thirdparty/onednn_gpu/LICENSE;md5=3b64000f6e7d52516017622a37a94ce9 \ | ||
51 | file://node-api-headers-src/LICENSE;md5=6adb2909701d4605b4b2ae1a9b25d8bd \ | ||
52 | file://node-addon-api-src/LICENSE.md;md5=0492ef29a9d558a3e9660e7accc9ca6a \ | ||
53 | file://thirdparty/telemetry/LICENSE;md5=86d3f3a95c324c9479bd8986968f4327 \ | ||
54 | " | ||
55 | |||
56 | inherit cmake python3native pkgconfig qemu | ||
57 | |||
58 | S = "${WORKDIR}/git" | ||
59 | EXTRA_OECMAKE += " \ | ||
60 | -DCMAKE_CROSSCOMPILING_EMULATOR=${WORKDIR}/qemuwrapper \ | ||
61 | -DENABLE_OPENCV=OFF \ | ||
62 | -DENABLE_INTEL_GNA=OFF \ | ||
63 | -DENABLE_SYSTEM_TBB=ON \ | ||
64 | -DPYTHON_EXECUTABLE=${PYTHON} \ | ||
65 | -DCMAKE_BUILD_TYPE=RelWithDebInfo \ | ||
66 | -DTHREADING=TBB -DTBB_DIR="${STAGING_LIBDIR}/cmake/TBB" \ | ||
67 | -DTREAT_WARNING_AS_ERROR=FALSE \ | ||
68 | -DENABLE_DATA=FALSE \ | ||
69 | -DENABLE_SYSTEM_PUGIXML=TRUE \ | ||
70 | -DENABLE_OV_ONNX_FRONTEND=FALSE \ | ||
71 | -DUSE_BUILD_TYPE_SUBFOLDER=OFF \ | ||
72 | -DENABLE_FUZZING=OFF \ | ||
73 | -DENABLE_TBBBIND_2_5=OFF \ | ||
74 | -DCPACK_GENERATOR=RPM \ | ||
75 | -DENABLE_SYSTEM_FLATBUFFERS=ON \ | ||
76 | -DENABLE_SYSTEM_SNAPPY=ON \ | ||
77 | -DFETCHCONTENT_BASE_DIR="${S}" \ | ||
78 | -DENABLE_INTEL_NPU=OFF \ | ||
79 | " | ||
80 | |||
81 | DEPENDS += "\ | ||
82 | flatbuffers-native \ | ||
83 | pugixml \ | ||
84 | python3-pybind11 \ | ||
85 | python3-pybind11-native \ | ||
86 | qemu-native \ | ||
87 | snappy \ | ||
88 | tbb \ | ||
89 | " | ||
90 | |||
91 | COMPATIBLE_HOST = '(x86_64).*-linux' | ||
92 | COMPATIBLE_HOST:libc-musl = "null" | ||
93 | |||
94 | PACKAGECONFIG ?= "opencl samples" | ||
95 | PACKAGECONFIG[opencl] = "-DENABLE_INTEL_GPU=TRUE, -DENABLE_INTEL_GPU=FALSE, virtual/opencl-icd opencl-headers opencl-clhpp," | ||
96 | PACKAGECONFIG[python3] = "-DENABLE_PYTHON=ON -DPYTHON_LIBRARY=${PYTHON_LIBRARY} -DPYTHON_INCLUDE_DIR=${PYTHON_INCLUDE_DIR} -DENABLE_PYTHON_PACKAGING=ON, -DENABLE_PYTHON=OFF, patchelf-native, python3 python3-numpy python3-progress" | ||
97 | PACKAGECONFIG[samples] = "-DENABLE_SAMPLES=ON -DENABLE_COMPILE_TOOL=ON, -DENABLE_SAMPLES=OFF -DENABLE_COMPILE_TOOL=OFF, opencv" | ||
98 | PACKAGECONFIG[verbose] = "-DVERBOSE_BUILD=1,-DVERBOSE_BUILD=0" | ||
99 | |||
100 | do_configure:prepend() { | ||
101 | # Dont set PROJECT_ROOT_DIR | ||
102 | sed -i -e 's:\${OpenVINO_SOURCE_DIR}::;' ${S}/src/CMakeLists.txt | ||
103 | |||
104 | # qemu wrapper that can be used by cmake to run target binaries. | ||
105 | qemu_binary="${@qemu_wrapper_cmdline(d, d.getVar('STAGING_DIR_HOST'), [d.expand('${STAGING_DIR_HOST}${libdir}'),d.expand('${STAGING_DIR_HOST}${base_libdir}')])}" | ||
106 | cat > ${WORKDIR}/qemuwrapper << EOF | ||
107 | #!/bin/sh | ||
108 | $qemu_binary "\$@" | ||
109 | EOF | ||
110 | chmod +x ${WORKDIR}/qemuwrapper | ||
111 | } | ||
112 | |||
113 | do_install:append() { | ||
114 | rm -rf ${D}${prefix}/install_dependencies | ||
115 | rm -rf ${D}${prefix}/setupvars.sh | ||
116 | |||
117 | find ${B}/src/plugins/intel_cpu/cross-compiled/ -type f -name *_disp.cpp -exec sed -i -e 's%'"${S}"'%'"${TARGET_DBGSRC_DIR}"'%g' {} + | ||
118 | } | ||
119 | |||
120 | # Otherwise e.g. ros-openvino-toolkit-dynamic-vino-sample when using dldt-inference-engine uses dldt-inference-engine WORKDIR | ||
121 | # instead of RSS | ||
122 | SSTATE_SCAN_FILES:append = " *.cmake" | ||
123 | |||
124 | FILES:${PN} += "\ | ||
125 | ${libdir}/openvino-${PV}/lib*${SOLIBSDEV} \ | ||
126 | ${libdir}/openvino-${PV}/plugins.xml \ | ||
127 | ${libdir}/openvino-${PV}/cache.json \ | ||
128 | " | ||
129 | |||
130 | # Move inference engine samples into a separate package | ||
131 | PACKAGES =+ "${PN}-samples" | ||
132 | |||
133 | FILES:${PN}-samples = "${datadir}/openvino \ | ||
134 | ${bindir} \ | ||
135 | ${libdir}/libformat_reader.a \ | ||
136 | ${libdir}/libopencv_c_wrapper.a \ | ||
137 | " | ||
138 | |||
139 | RDEPENDS:${PN}-samples += "python3-core" | ||
140 | |||
141 | # Package for inference engine python API | ||
142 | PACKAGES =+ "${PN}-python3" | ||
143 | |||
144 | FILES:${PN}-python3 = "${PYTHON_SITEPACKAGES_DIR}" | ||
145 | |||
146 | UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>(\d+\.\d+\.\d+))$" | ||