1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
Vanilla LLVM does not support calling AMDGPU_KERNEL across different sources/bitcodes.
Without this patch https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/issues/45 occurs.
Reference: https://github.com/llvm/llvm-project/issues/60313
===================================================================
Index: comgr/test/source/source1.cl
===================================================================
--- comgr.orig/test/source/source1.cl
+++ comgr/test/source/source1.cl
@@ -35,7 +35,9 @@
#include "include-a.h"
+void kernel source3(__global int *j) { *j = FOO; }
+
void kernel source1(__global int *j) {
*j += 2;
- source2(j);
+ source3(j);
}
Index: comgr/test/mangled_names_test.c
===================================================================
--- comgr.orig/test/mangled_names_test.c
+++ comgr/test/mangled_names_test.c
@@ -162,7 +162,7 @@ int main(int argc, char *argv[]) {
exit(1);
}
- const char *bcNames[] = {"source1", "source2"};
+ const char *bcNames[] = {"source3", "source1"};
for (size_t I = 0; I < numNames; ++I) {
size_t Size;
@@ -249,14 +249,14 @@ int main(int argc, char *argv[]) {
Status = amd_comgr_populate_mangled_names(DataExec, &numNames);
- if (numNames != 4) {
+ if (numNames != 6) {
printf("amd_populate_mangled_names Failed: "
- "produced %zu executable names (expected 4)\n",
+ "produced %zu executable names (expected 6)\n",
Count);
exit(1);
}
- const char *execNames[] = {"source1", "source1.kd", "source2", "source2.kd"};
+ const char *execNames[] = {"source3", "source3.kd", "source1", "source1.kd", "source2", "source2.kd"};
for (size_t I = 0; I < numNames; ++I) {
size_t Size;
|