Skip to content

Commit b6d1acb

Browse files
committed
[SYCL] Support device binary properties and file tables in the offload wrapper.
1. New option - "-properties=<file>". <file> must be a property set registry file, as defined by llvm/Support/PropertySetIO.h. The wrapper will add the property sets to the binary image descriptor and the them available to the runtime. 2. New options - "-batch". With this option the only input can be a file table, as defined by llvm/Support/SimpleTable.h. Column names are a part of interface between this tool and the sycl-post-link, which produces the file table. 3. Binary image descriptor LLVM type updated to resemble changes in Plugin Interface v1.2. Signed-off-by: Konstantin S Bobrovsky <[email protected]>
1 parent 1580c00 commit b6d1acb

File tree

3 files changed

+563
-113
lines changed

3 files changed

+563
-113
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
// REQUIRES: system-linux || system-windows
2+
3+
// End-to-end clang-offload-wrapper executable test: check that -batch options
4+
// works, and that the tool generates data properly accessible at runtime.
5+
6+
// --- Prepare test data
7+
// RUN: echo -e -n 'device binary image\n' > %t.bin
8+
// RUN: echo -e -n '[Category1]\nint_prop1=1|10\n[Category2]\nint_prop2=1|20\n' > %t.props
9+
// RUN: echo -e -n 'kernel1\nkernel2\n' > %t.sym
10+
// RUN: echo -e -n 'Manifest file - arbitrary data generated by the toolchain\n' > %t.mnf
11+
// RUN: echo '[Code|Properties|Symbols|Manifest]' > %t.batch
12+
// RUN: echo %t.bin"|"%t.props"|"%t.sym"|"%t.mnf >> %t.batch
13+
// --- Generate "gold" output
14+
// RUN: cat %t.bin %t.mnf %t.props %t.sym > %t.all
15+
// --- Create the wrapper object
16+
// -host omitted - generate object for the host triple:
17+
// RUN: clang-offload-wrapper -kind=sycl -target=TARGET -format=native -batch %t.batch -o %t.wrapped.bc
18+
// RUN: llc --filetype=obj %t.wrapped.bc -o %t.wrapped.o
19+
// --- Compile & link the test with the wrapper
20+
// RUN: %clangxx %t.wrapped.o %s -o %t.batch.exe -v
21+
// --- Run and check ignoring white spaces
22+
// RUN: %t.batch.exe > %t.batch.exe.out
23+
// RUN: diff -b %t.batch.exe.out %t.all
24+
25+
#include <iostream>
26+
#include <string>
27+
28+
// Data types created by the offload wrapper and inserted in the wrapper object.
29+
// Match those defined in SYCL runtime Plugin Interface.
30+
struct _pi_offload_entry_struct {
31+
void *addr;
32+
char *name;
33+
size_t size;
34+
int32_t flags;
35+
int32_t reserved;
36+
};
37+
38+
typedef _pi_offload_entry_struct *_pi_offload_entry;
39+
40+
struct _pi_device_binary_property_struct {
41+
char *Name; // null-terminated property name
42+
void *ValAddr; // address of property value
43+
uint32_t Type; // pi_property_type
44+
uint64_t ValSize; // size of property value in bytes
45+
};
46+
47+
typedef _pi_device_binary_property_struct *pi_device_binary_property;
48+
49+
struct _pi_device_binary_property_set_struct {
50+
char *Name; // the name
51+
pi_device_binary_property PropertiesBegin; // array start
52+
pi_device_binary_property PropertiesEnd; // array end
53+
};
54+
55+
typedef _pi_device_binary_property_set_struct *pi_device_binary_property_set;
56+
57+
struct pi_device_binary_struct {
58+
uint16_t Version;
59+
uint8_t Kind; // 4 for SYCL
60+
uint8_t Format; // 1 for native
61+
const char *DeviceTargetSpec;
62+
const char *CompileOptions;
63+
const char *LinkOptions;
64+
const char *ManifestStart;
65+
const char *ManifestEnd;
66+
const unsigned char *BinaryStart;
67+
const unsigned char *BinaryEnd;
68+
_pi_offload_entry EntriesBegin;
69+
_pi_offload_entry EntriesEnd;
70+
pi_device_binary_property_set PropertySetsBegin;
71+
pi_device_binary_property_set PropertySetsEnd;
72+
};
73+
typedef pi_device_binary_struct *pi_device_binary;
74+
75+
struct pi_device_binaries_struct {
76+
uint16_t Version;
77+
uint16_t NumDeviceBinaries;
78+
pi_device_binary DeviceBinaries;
79+
_pi_offload_entry *HostEntriesBegin;
80+
_pi_offload_entry *HostEntriesEnd;
81+
};
82+
typedef pi_device_binaries_struct *pi_device_binaries;
83+
84+
static pi_device_binaries BinDesc = nullptr;
85+
86+
// Wrapper object has code which calls these 2 functions below
87+
extern "C" void __sycl_register_lib(pi_device_binaries desc) {
88+
BinDesc = desc;
89+
}
90+
91+
extern "C" void __sycl_unregister_lib() {}
92+
93+
#define ASSERT(Cond, Msg) \
94+
if (!(Cond)) { \
95+
std::cerr << "*** ERROR: wrong " << Msg << "\n"; \
96+
return 1; \
97+
}
98+
99+
static std::string getString(const unsigned char *B, const unsigned char *E) {
100+
return std::string(reinterpret_cast<const char *>(B), E - B);
101+
}
102+
103+
static int getInt(void *Addr) {
104+
const char *Ptr = reinterpret_cast<const char *>(Addr);
105+
return Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16) | (Ptr[3] << 24);
106+
}
107+
108+
int main(int argc, char **argv) {
109+
ASSERT(BinDesc->NumDeviceBinaries == 1, "BinDesc->NumDeviceBinaries");
110+
ASSERT(BinDesc->Version == 1, "BinDesc->Version");
111+
112+
for (int I = 0; I < BinDesc->NumDeviceBinaries; ++I) {
113+
pi_device_binary Bin = &BinDesc->DeviceBinaries[I];
114+
ASSERT(Bin->Kind == 4, "Bin->Kind");
115+
ASSERT(Bin->Format == 1, "Bin->Format");
116+
117+
// dump code
118+
std::cout << getString(Bin->BinaryStart, Bin->BinaryEnd);
119+
// dump manifest
120+
std::cout << std::string(Bin->ManifestStart, Bin->ManifestEnd - Bin->ManifestStart);
121+
// dump properties
122+
for (pi_device_binary_property_set PropSet = Bin->PropertySetsBegin; PropSet != Bin->PropertySetsEnd; ++PropSet) {
123+
std::cout << "[" << PropSet->Name << "]"
124+
<< "\n";
125+
126+
for (pi_device_binary_property Prop = PropSet->PropertiesBegin; Prop != PropSet->PropertiesEnd; ++Prop)
127+
// values fitting into 64 bits are written into the 'ValAddr' field:
128+
std::cout << Prop->Name << "=" << Prop->Type << "|" << getInt(&Prop->ValSize) << "\n";
129+
}
130+
// dump symbols
131+
for (_pi_offload_entry Entry = Bin->EntriesBegin; Entry != Bin->EntriesEnd; ++Entry)
132+
std::cout << Entry->name << "\n";
133+
}
134+
return 0;
135+
}

clang/test/Driver/clang-offload-wrapper.c

Lines changed: 78 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//
66

77
// RUN: clang-offload-wrapper --help | FileCheck %s --check-prefix CHECK-HELP
8-
// CHECK-HELP: A tool to create a wrapper bitcode for offload target binaries.
8+
// CHECK-HELP: OVERVIEW: A tool to create a wrapper bitcode for offload target binaries.
99
// CHECK-HELP: Takes offload target binaries and optional manifest files as input
1010
// CHECK-HELP: and produces bitcode file containing target binaries packaged as data
1111
// CHECK-HELP: and initialization code which registers target binaries in the offload
@@ -16,53 +16,77 @@
1616
// CHECK-HELP: command line. Options annotating a device binary have effect on all
1717
// CHECK-HELP: subsequent input, until redefined.
1818
// CHECK-HELP: For example:
19-
// CHECK-HELP: clang-offload-wrapper
20-
// CHECK-HELP: -host x86_64-pc-linux-gnu
21-
// CHECK-HELP: -kind=sycl
22-
// CHECK-HELP: -target=spir64
23-
// CHECK-HELP: -format=spirv
24-
// CHECK-HELP: -compile-opts=-g
25-
// CHECK-HELP: -link-opts=-cl-denorms-are-zero
26-
// CHECK-HELP: a.spv
27-
// CHECK-HELP: a_mf.txt
28-
// CHECK-HELP: -target=xxx
29-
// CHECK-HELP: -format=native
30-
// CHECK-HELP: -compile-opts=""
31-
// CHECK-HELP: -link-opts=""
32-
// CHECK-HELP: b.bin
33-
// CHECK-HELP: b_mf.txt
34-
// CHECK-HELP: -kind=openmp
35-
// CHECK-HELP: c.bin
19+
// CHECK-HELP: clang-offload-wrapper \
20+
// CHECK-HELP: -host x86_64-pc-linux-gnu \
21+
// CHECK-HELP: -kind=sycl \
22+
// CHECK-HELP: -target=spir64 \
23+
// CHECK-HELP: -format=spirv \
24+
// CHECK-HELP: -compile-opts=-g \
25+
// CHECK-HELP: -link-opts=-cl-denorms-are-zero \
26+
// CHECK-HELP: -entries=sym.txt \
27+
// CHECK-HELP: -properties=props.txt \
28+
// CHECK-HELP: a.spv \
29+
// CHECK-HELP: a_mf.txt \
30+
// CHECK-HELP: -target=xxx \
31+
// CHECK-HELP: -format=native \
32+
// CHECK-HELP: -compile-opts="" \
33+
// CHECK-HELP: -link-opts="" \
34+
// CHECK-HELP: -entries="" \
35+
// CHECK-HELP: -properties="" \
36+
// CHECK-HELP: b.bin \
37+
// CHECK-HELP: b_mf.txt \
38+
// CHECK-HELP: -kind=openmp \
39+
// CHECK-HELP: c.bin\n
3640
// CHECK-HELP: This command generates an x86 wrapper object (.bc) enclosing the
3741
// CHECK-HELP: following tuples describing a single device binary each:
38-
// CHECK-HELP: offload kind | target | data format | data | manifest | build options:
39-
// CHECK-HELP: ----------------------------------------------------------------------
40-
// CHECK-HELP: sycl | spir64 | spirv | a.spv| a_mf.txt | -g
41-
// CHECK-HELP: sycl | xxx | native | b.bin| b_mf.txt | -
42-
// CHECK-HELP: openmp | xxx | native | c.bin| n/a | -
43-
// CHECK-HELP: USAGE: clang-offload-wrapper [options] <input files>
42+
// CHECK-HELP: |offload|target|data |data |manifest|compile|entries|properties|...|
43+
// CHECK-HELP: | kind | |format| | |options| | |...|
44+
// CHECK-HELP: |-------|------|------|-----|--------|-------|-------|----------|---|
45+
// CHECK-HELP: |sycl |spir64|spirv |a.spv|a_mf.txt| -g |sym.txt|props.txt |...|
46+
// CHECK-HELP: |sycl |xxx |native|b.bin|b_mf.txt| | | |...|
47+
// CHECK-HELP: |openmp |xxx |native|c.bin| | | | |...|
48+
// CHECK-HELP: |...| link |
49+
// CHECK-HELP: |...| options |
50+
// CHECK-HELP: |---|--------------------|
51+
// CHECK-HELP: |...|-cl-denorms-are-zero|
52+
// CHECK-HELP: |...| |
53+
// CHECK-HELP: |...| |
54+
// CHECK-HELP: USAGE: clang-offload-wrapper [options] <input files>
4455
// CHECK-HELP: OPTIONS:
56+
// CHECK-HELP: Generic Options:
57+
// CHECK-HELP: --help - Display available options (--help-hidden for more)
58+
// CHECK-HELP: --help-list - Display list of available options (--help-list-hidden for more)
59+
// CHECK-HELP: --version - Display the version of this program
4560
// CHECK-HELP: clang-offload-wrapper options:
46-
// CHECK-HELP: --compile-opts=<string> - compile options passed to the offload runtime
47-
// CHECK-HELP: --desc-name=<name> - Specifies offload descriptor symbol name: '.<offload kind>.<name>', and makes it globally visible
48-
// CHECK-HELP: --emit-reg-funcs - Emit [un-]registration functions
49-
// CHECK-HELP: --entries=<filename> - File listing all offload function entries, SYCL offload only
50-
// CHECK-HELP: --format=<value> - device binary image formats:
51-
// CHECK-HELP: =none - not set
52-
// CHECK-HELP: =native - unknown or native
53-
// CHECK-HELP: =spirv - SPIRV binary
54-
// CHECK-HELP: =llvmbc - LLVMIR bitcode
55-
// CHECK-HELP: --host=<triple> - Target triple for the output module
56-
// CHECK-HELP: --kind=<value> - offload kind:
57-
// CHECK-HELP: =unknown - unknown
58-
// CHECK-HELP: =host - host
59-
// CHECK-HELP: =openmp - OpenMP
60-
// CHECK-HELP: =hip - HIP
61-
// CHECK-HELP: =sycl - SYCL
62-
// CHECK-HELP: --link-opts=<string> - link options passed to the offload runtime
63-
// CHECK-HELP: -o=<filename> - Output filename
64-
// CHECK-HELP: --target=<string> - offload target triple
65-
// CHECK-HELP: -v - verbose output
61+
// CHECK-HELP: --batch - All input files are provided as cells in a file table file,
62+
// CHECK-HELP: other command-line input files are not allowed.
63+
// CHECK-HELP: Example input file table in batch mode:
64+
// CHECK-HELP: [Code|Symbols|Properties|Manifest]
65+
// CHECK-HELP: a_0.bc|a_0.sym|a_0.props|a_0.mnf
66+
// CHECK-HELP: a_1.bin|||
67+
// CHECK-HELP: --compile-opts=<string> - compile options passed to the offload runtime
68+
// CHECK-HELP: --desc-name=<name> - Specifies offload descriptor symbol name: '.<offload kind>.<name>',
69+
// CHECK-HELP: and makes it globally visible
70+
// CHECK-HELP: --emit-reg-funcs - Emit [un-]registration functions
71+
// CHECK-HELP: --entries=<filename> - File listing all offload function entries, SYCL offload only
72+
// CHECK-HELP: --format=<value> - device binary image formats:
73+
// CHECK-HELP: =none - not set
74+
// CHECK-HELP: =native - unknown or native
75+
// CHECK-HELP: =spirv - SPIRV binary
76+
// CHECK-HELP: =llvmbc - LLVMIR bitcode
77+
// CHECK-HELP: --host=<triple> - Target triple for the output module. If omitted, the host
78+
// CHECK-HELP: triple is used.
79+
// CHECK-HELP: --kind=<value> - offload kind:
80+
// CHECK-HELP: =unknown - unknown
81+
// CHECK-HELP: =host - host
82+
// CHECK-HELP: =openmp - OpenMP
83+
// CHECK-HELP: =hip - HIP
84+
// CHECK-HELP: =sycl - SYCL
85+
// CHECK-HELP: --link-opts=<string> - link options passed to the offload runtime
86+
// CHECK-HELP: -o=<filename> - Output filename
87+
// CHECK-HELP: --properties=<filename> - File listing device binary image properties, SYCL offload only
88+
// CHECK-HELP: --target=<string> - offload target triple
89+
// CHECK-HELP: -v - verbose output
6690

6791
// -------
6892
// Generate files to wrap.
@@ -87,11 +111,15 @@
87111

88112
// CHECK-IR: target triple = "x86_64-pc-linux-gnu"
89113

114+
// --- OpenMP device binary image descriptor structure
90115
// CHECK-IR-DAG: [[ENTTY:%.+]] = type { i8*, i8*, i{{32|64}}, i32, i32 }
91116
// CHECK-IR-DAG: [[IMAGETY:%.+]] = type { i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
92117
// CHECK-IR-DAG: [[DESCTY:%.+]] = type { i32, [[IMAGETY]]*, [[ENTTY]]*, [[ENTTY]]* }
93118

94-
// CHECK-IR-DAG: [[SYCL_IMAGETY:%.+]] = type { i16, i8, i8, i8*, i8*, i8*, i8*, i8*, i8*, i8*, [[ENTTY]]*, [[ENTTY]]* }
119+
// --- SYCL device binary image descriptor structure
120+
// CHECK-IR-DAG: [[SYCL_IMAGETY:%.+]] = type { i16, i8, i8, i8*, i8*, i8*, i8*, i8*, i8*, i8*, [[ENTTY]]*, [[ENTTY]]*, [[PROPSETTY:%.+]]*, [[PROPSETTY]]* }
121+
// CHECK-IR-DAG: [[PROPSETTY]] = type { i8*, [[PROPTY:%.+]]*, [[PROPTY]]* }
122+
// CHECK-IR-DAG: [[PROPTY]] = type { i8*, i8*, i32, i64 }
95123
// CHECK-IR-DAG: [[SYCL_DESCTY:%.+]] = type { i16, i16, [[SYCL_IMAGETY]]*, [[ENTTY]]*, [[ENTTY]]* }
96124

97125
// CHECK-IR: [[ENTBEGIN:@.+]] = external hidden constant [[ENTTY]]
@@ -113,9 +141,9 @@
113141
// CHECK-IR: [[SYCL_TGT1:@.+]] = internal unnamed_addr constant [4 x i8] c"tg2\00"
114142
// CHECK-IR: [[SYCL_COMPILE_OPTS1:@.+]] = internal unnamed_addr constant [1 x i8] zeroinitializer
115143
// CHECK-IR: [[SYCL_LINK_OPTS1:@.+]] = internal unnamed_addr constant [1 x i8] zeroinitializer
116-
// CHECK-IR: [[SYCL_BIN1:@.+]] = internal unnamed_addr constant [[SYCL_BIN1TY:\[[0-9]+ x i8\]]] c"Content of device file2{{.+}}"
144+
// CHECK-IR: [[SYCL_BIN1:@.+]] = internal unnamed_addr constant [[SYCL_BIN1TY:\[[0-9]+ x i8\]]] c"Content of device file2{{.+}}"
117145

118-
// CHECK-IR: [[SYCL_IMAGES:@.+]] = internal unnamed_addr constant [2 x [[SYCL_IMAGETY]]] [{{.+}} { i16 1, i8 4, i8 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[SYCL_TGT0]], i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[SYCL_COMPILE_OPTS0]], i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* [[SYCL_LINK_OPTS0]], i64 0, i64 0), i8* null, i8* null, i8* getelementptr inbounds ([[SYCL_BIN0TY]], [[SYCL_BIN0TY]]* [[SYCL_BIN0]], i64 0, i64 0), i8* getelementptr inbounds ([[SYCL_BIN0TY]], [[SYCL_BIN0TY]]* [[SYCL_BIN0]], i64 1, i64 0), [[ENTTY]]* null, [[ENTTY]]* null }, [[SYCL_IMAGETY]] { i16 1, i8 4, i8 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[SYCL_TGT1]], i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* [[SYCL_COMPILE_OPTS1]], i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* [[SYCL_LINK_OPTS1]], i64 0, i64 0), i8* null, i8* null, i8* getelementptr inbounds ([[SYCL_BIN1TY]], [[SYCL_BIN1TY]]* [[SYCL_BIN1]], i64 0, i64 0), i8* getelementptr inbounds ([[SYCL_BIN1TY]], [[SYCL_BIN1TY]]* [[SYCL_BIN1]], i64 1, i64 0), [[ENTTY]]* null, [[ENTTY]]* null }]
146+
// CHECK-IR: [[SYCL_IMAGES:@.+]] = internal unnamed_addr constant [2 x [[SYCL_IMAGETY]]] [{{.*}} { i16 2, i8 4, i8 2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[SYCL_TGT0]], i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* [[SYCL_COMPILE_OPTS0]], i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* [[SYCL_LINK_OPTS0]], i64 0, i64 0), i8* null, i8* null, i8* getelementptr inbounds ([[SYCL_BIN0TY]], [[SYCL_BIN0TY]]* [[SYCL_BIN0]], i64 0, i64 0), i8* getelementptr inbounds ([[SYCL_BIN0TY]], [[SYCL_BIN0TY]]* [[SYCL_BIN0]], i64 1, i64 0), [[ENTTY]]* null, [[ENTTY]]* null, [[PROPSETTY]]* null, [[PROPSETTY]]* null }, [[SYCL_IMAGETY]] { i16 2, i8 4, i8 1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* [[SYCL_TGT1]], i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* [[SYCL_COMPILE_OPTS1]], i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* [[SYCL_LINK_OPTS1]], i64 0, i64 0), i8* null, i8* null, i8* getelementptr inbounds ([[SYCL_BIN1TY]], [[SYCL_BIN1TY]]* [[SYCL_BIN1]], i64 0, i64 0), i8* getelementptr inbounds ([[SYCL_BIN1TY]], [[SYCL_BIN1TY]]* [[SYCL_BIN1]], i64 1, i64 0), [[ENTTY]]* null, [[ENTTY]]* null, [[PROPSETTY]]* null, [[PROPSETTY]]* null }]
119147

120148
// CHECK-IR: [[SYCL_DESC:@.+]] = internal constant [[SYCL_DESCTY]] { i16 1, i16 2, [[SYCL_IMAGETY]]* getelementptr inbounds ([2 x [[SYCL_IMAGETY]]], [2 x [[SYCL_IMAGETY]]]* [[SYCL_IMAGES]], i64 0, i64 0), [[ENTTY]]* null, [[ENTTY]]* null }
121149

@@ -154,12 +182,12 @@
154182
//
155183
// RUN: clang-offload-wrapper -kind sycl -host=x86_64-pc-linux-gnu -emit-reg-funcs=0 -desc-name=lalala -o - %t.tgt | llvm-dis | FileCheck %s --check-prefix CHECK-IR1
156184
// CHECK-IR1: source_filename = "offload.wrapper.object"
157-
// CHECK-IR1: [[IMAGETY:%.+]] = type { i16, i8, i8, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %__tgt_offload_entry*, %__tgt_offload_entry* }
185+
// CHECK-IR1: [[IMAGETY:%.+]] = type { i16, i8, i8, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %__tgt_offload_entry*, %__tgt_offload_entry*, %_pi_device_binary_property_set_struct*, %_pi_device_binary_property_set_struct* }
158186
// CHECK-IR1: [[ENTTY:%.+]] = type { i8*, i8*, i64, i32, i32 }
159187
// CHECK-IR1: [[DESCTY:%.+]] = type { i16, i16, [[IMAGETY]]*, [[ENTTY]]*, [[ENTTY]]* }
160188
// CHECK-IR1-NOT: @llvm.global_ctors
161189
// CHECK-IR1-NOT: @llvm.global_dtors
162-
// CHECK-IR1: @.sycl_offloading.lalala = constant [[DESCTY]] { i16 1, i16 1, [[IMAGETY]]* getelementptr inbounds ([1 x [[IMAGETY]]], [1 x [[IMAGETY]]]* @.sycl_offloading.device_images, i64 0, i64 0), [[ENTTY]]* null, [[ENTTY]]* null }
190+
// CHECK-IR1: @.sycl_offloading.lalala = constant [[DESCTY]] { i16 {{[0-9]+}}, i16 1, [[IMAGETY]]* getelementptr inbounds ([1 x [[IMAGETY]]], [1 x [[IMAGETY]]]* @.sycl_offloading.device_images, i64 0, i64 0), [[ENTTY]]* null, [[ENTTY]]* null }
163191

164192
// -------
165193
// Check option's effects: -entries
@@ -171,7 +199,7 @@
171199
// CHECK-IR3: @__sycl_offload_entry_name = internal unnamed_addr constant [7 x i8] c"entryA\00"
172200
// CHECK-IR3: @__sycl_offload_entry_name.1 = internal unnamed_addr constant [7 x i8] c"entryB\00"
173201
// CHECK-IR3: @__sycl_offload_entries_arr = internal constant [2 x %__tgt_offload_entry] [%__tgt_offload_entry { i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__sycl_offload_entry_name, i64 0, i64 0), i64 0, i32 0, i32 0 }, %__tgt_offload_entry { i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @__sycl_offload_entry_name.1, i64 0, i64 0), i64 0, i32 0, i32 0 }]
174-
// CHECK-IR3: @.sycl_offloading.device_images = internal unnamed_addr constant [1 x %__tgt_device_image] [%__tgt_device_image { {{.*}}, %__tgt_offload_entry* getelementptr inbounds ([2 x %__tgt_offload_entry], [2 x %__tgt_offload_entry]* @__sycl_offload_entries_arr, i64 0, i64 0), %__tgt_offload_entry* getelementptr inbounds ([2 x %__tgt_offload_entry], [2 x %__tgt_offload_entry]* @__sycl_offload_entries_arr, i64 1, i64 0) }]
202+
// CHECK-IR3: @.sycl_offloading.device_images = internal unnamed_addr constant [1 x %__tgt_device_image] [%__tgt_device_image { {{.*}}, %__tgt_offload_entry* getelementptr inbounds ([2 x %__tgt_offload_entry], [2 x %__tgt_offload_entry]* @__sycl_offload_entries_arr, i64 0, i64 0), %__tgt_offload_entry* getelementptr inbounds ([2 x %__tgt_offload_entry], [2 x %__tgt_offload_entry]* @__sycl_offload_entries_arr, i64 1, i64 0), %_pi_device_binary_property_set_struct* null, %_pi_device_binary_property_set_struct* null }]
175203

176204
// -------
177205
// Check that device image can be extracted from the wrapper object by the clang-offload-bundler tool.

0 commit comments

Comments
 (0)