Skip to content

Commit 73be194

Browse files
authored
[SYCL] Add support for optional kernel features in AOT x86_64 compilation (#14590)
1 parent dbeb50c commit 73be194

File tree

8 files changed

+68
-28
lines changed

8 files changed

+68
-28
lines changed

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10842,6 +10842,8 @@ void SYCLPostLink::ConstructJob(Compilation &C, const JobAction &JA,
1084210842
std::string OutputArg = Output.getFilename();
1084310843
if (T.getSubArch() == llvm::Triple::SPIRSubArch_gen && Device.data())
1084410844
OutputArg = ("intel_gpu_" + Device + "," + OutputArg).str();
10845+
else if (T.getSubArch() == llvm::Triple::SPIRSubArch_x86_64)
10846+
OutputArg = "spir64_x86_64," + OutputArg;
1084510847

1084610848
const toolchains::SYCLToolChain &TC =
1084710849
static_cast<const toolchains::SYCLToolChain &>(getToolChain());

clang/test/Driver/sycl-offload-aot.cpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// Check error for -fsycl-targets -fintelfpga conflict
1212
// RUN: not %clang -### -fsycl-targets=spir64-unknown-unknown -fintelfpga %s 2>&1 \
1313
// RUN: | FileCheck -check-prefix=CHK-SYCL-FPGA-CONFLICT %s
14-
// RUN: not %clang_cl -### -fsycl-targets=spir64-unknown-unknown -fintelfpga %s 2>&1 \
14+
// RUN: not %clang_cl -### -fsycl-targets=spir64-unknown-unknown -fintelfpga -- %s 2>&1 \
1515
// RUN: | FileCheck -check-prefix=CHK-SYCL-FPGA-CONFLICT %s
1616
// CHK-SYCL-FPGA-CONFLICT: clang: error: the option -fsycl-targets= conflicts with -fintelfpga
1717

@@ -23,7 +23,7 @@
2323
/// Check error for -fsycl-targets with bad triple
2424
// RUN: not %clang -### -fsycl-targets=spir64_bad-unknown-unknown -fsycl %s 2>&1 \
2525
// RUN: | FileCheck -check-prefix=CHK-SYCL-BAD-TRIPLE %s
26-
// RUN: not %clang_cl -### -fsycl-targets=spir64_bad-unknown-unknown -fsycl %s 2>&1 \
26+
// RUN: not %clang_cl -### -fsycl-targets=spir64_bad-unknown-unknown -fsycl -- %s 2>&1 \
2727
// RUN: | FileCheck -check-prefix=CHK-SYCL-BAD-TRIPLE %s
2828
// CHK-SYCL-BAD-TRIPLE: error: SYCL target is invalid: 'spir64_bad-unknown-unknown'
2929

@@ -55,7 +55,7 @@
5555
/// Check -Xsycl-target-backend triggers error when multiple triples are used.
5656
// RUN: not %clang -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown,spir_fpga-unknown-unknown -Xsycl-target-backend -DFOO %s 2>&1 \
5757
// RUN: | FileCheck -check-prefix=CHK-FSYCL-TARGET-AMBIGUOUS-ERROR %s
58-
// RUN: not %clang_cl -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown,spir_fpga-unknown-unknown -Xsycl-target-backend -DFOO %s 2>&1 \
58+
// RUN: not %clang_cl -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown,spir_fpga-unknown-unknown -Xsycl-target-backend -DFOO -- %s 2>&1 \
5959
// RUN: | FileCheck -check-prefix=CHK-FSYCL-TARGET-AMBIGUOUS-ERROR %s
6060
// CHK-FSYCL-TARGET-AMBIGUOUS-ERROR: clang{{.*}} error: cannot deduce implicit triple value for '-Xsycl-target-backend', specify triple using '-Xsycl-target-backend=<triple>'
6161

@@ -140,7 +140,9 @@
140140
// CHK-TOOLS-AOT: "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INPUT1:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[OUTPUT1:.+\.bc]]"
141141
// CHK-TOOLS-AOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-include" "[[INPUT1]]" {{.*}} "-o" "[[OUTPUT7:.+\.o]]
142142
// CHK-TOOLS-AOT: llvm-link{{.*}} "[[OUTPUT1]]" "-o" "[[OUTPUT2:.+\.bc]]"
143-
// CHK-TOOLS-AOT: sycl-post-link{{.*}} "-o" "[[OUTPUT2_T:.+\.table]]" "[[OUTPUT2]]"
143+
// CHK-TOOLS-FPGA: sycl-post-link{{.*}} "-o" "[[OUTPUT2_T:.+\.table]]" "[[OUTPUT2]]"
144+
// CHK-TOOLS-GEN: sycl-post-link{{.*}} "-o" "[[OUTPUT2_T:.+\.table]]" "[[OUTPUT2]]"
145+
// CHK-TOOLS-CPU: sycl-post-link{{.*}} "-o" "spir64_x86_64,[[OUTPUT2_T:.+\.table]]" "[[OUTPUT2]]"
144146
// CHK-TOOLS-AOT: file-table-tform{{.*}} "-extract=Code" "-drop_titles" "-o" "[[OUTPUT2_1:.+\.txt]]" "[[OUTPUT2_T]]"
145147
// CHK-TOOLS-CPU: llvm-spirv{{.*}} "-o" "[[OUTPUT3_T:.+\.txt]]" "-spirv-max-version=1.4" "-spirv-debug-info-version=nonsemantic-shader-200" "-spirv-allow-unknown-intrinsics=llvm.genx.,llvm.fpbuiltin" {{.*}} "[[OUTPUT2_1]]"
146148
// CHK-TOOLS-GEN: llvm-spirv{{.*}} "-o" "[[OUTPUT3_T:.+\.txt]]" "-spirv-max-version=1.4" "-spirv-debug-info-version=nonsemantic-shader-200" "-spirv-allow-unknown-intrinsics=llvm.genx." {{.*}} "[[OUTPUT2_1]]"
@@ -158,15 +160,15 @@
158160
// CHK-TOOLS-AOT: ld{{.*}} "[[OUTPUT7]]" "[[OUTPUT6]]" {{.*}} "-lsycl"
159161

160162
// Check to be sure that for windows, the 'exe' tools are called
161-
// RUN: %clang_cl -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \
163+
// RUN: %clang_cl -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown -### -- %s 2>&1 \
162164
// RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-CPU-WIN
163165
// RUN: %clang -target x86_64-pc-windows-msvc -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown %s -### 2>&1 \
164166
// RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-CPU-WIN
165-
// RUN: %clang_cl -fsycl -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \
167+
// RUN: %clang_cl -fsycl -fsycl-targets=spir64_gen-unknown-unknown -### -- %s 2>&1 \
166168
// RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-GEN-WIN
167169
// RUN: %clang -target x86_64-pc-windows-msvc -fsycl -fsycl-targets=spir64_gen-unknown-unknown %s -### 2>&1 \
168170
// RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-GEN-WIN
169-
// RUN: %clang_cl -fsycl -Xshardware -fsycl-targets=spir64_fpga-unknown-unknown %s -### 2>&1 \
171+
// RUN: %clang_cl -fsycl -Xshardware -fsycl-targets=spir64_fpga-unknown-unknown -### -- %s 2>&1 \
170172
// RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-FPGA-WIN
171173
// RUN: %clang -target x86_64-pc-windows-msvc -fsycl -fsycl-targets=spir64_fpga-unknown-unknown -Xshardware %s -### 2>&1 \
172174
// RUN: | FileCheck %s -check-prefixes=CHK-TOOLS-FPGA-WIN
@@ -203,19 +205,19 @@
203205

204206
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_fpga-unknown-unknown -g -O0 -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
205207
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-FPGA %s
206-
// RUN: %clang_cl -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown -Zi -Od -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
208+
// RUN: %clang_cl -### -fsycl -fsycl-targets=spir64_fpga-unknown-unknown -Zi -Od -Xsycl-target-backend "-DFOO1 -DFOO2" -- %s 2>&1 \
207209
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-FPGA %s
208210
// CHK-TOOLS-IMPLIED-OPTS-FPGA: opencl-aot{{.*}} "--bo=-g -cl-opt-disable" "-DFOO1" "-DFOO2"
209211

210212
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown -g -O0 -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
211213
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-CPU %s
212-
// RUN: %clang_cl -### -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown -Zi -Od -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
214+
// RUN: %clang_cl -### -fsycl -fsycl-targets=spir64_x86_64-unknown-unknown -Zi -Od -Xsycl-target-backend "-DFOO1 -DFOO2" -- %s 2>&1 \
213215
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-CPU %s
214216
// CHK-TOOLS-IMPLIED-OPTS-CPU: opencl-aot{{.*}} "--bo=-g -cl-opt-disable" "-DFOO1" "-DFOO2"
215217

216218
// RUN: %clang -### -target x86_64-unknown-linux-gnu -fsycl -fsycl-targets=spir64_gen-unknown-unknown -g -O0 -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
217219
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-GEN %s
218-
// RUN: %clang_cl -### -fsycl -fsycl-targets=spir64_gen-unknown-unknown -Zi -Od -Xsycl-target-backend "-DFOO1 -DFOO2" %s 2>&1 \
220+
// RUN: %clang_cl -### -fsycl -fsycl-targets=spir64_gen-unknown-unknown -Zi -Od -Xsycl-target-backend "-DFOO1 -DFOO2" -- %s 2>&1 \
219221
// RUN: | FileCheck -check-prefix=CHK-TOOLS-IMPLIED-OPTS-GEN %s
220222
// CHK-TOOLS-IMPLIED-OPTS-GEN: ocloc{{.*}} "-options" "-g -cl-opt-disable" "-DFOO1" "-DFOO2"
221223

clang/test/Driver/sycl-offload-with-split-old-model.c

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
/// The same phase graph will be used with -fsycl-device-obj=llvmir
1414
// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split -fsycl-targets=spir64-unknown-unknown %s 2>&1 \
1515
// RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s
16-
// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-targets=spir64-unknown-unknown %s 2>&1 \
16+
// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-targets=spir64-unknown-unknown -- %s 2>&1 \
1717
// RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s
1818
// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=spirv %s 2>&1 \
1919
// RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s
20-
// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=spirv %s 2>&1 \
20+
// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=spirv -- %s 2>&1 \
2121
// RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s
2222
// RUN: %clang -ccc-print-phases -target x86_64-unknown-linux-gnu -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=llvmir %s 2>&1 \
2323
// RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-DEFAULT-MODE %s
24-
// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=llvmir %s 2>&1 \
24+
// RUN: %clang_cl -ccc-print-phases --target=x86_64-pc-windows-msvc -fsycl --no-offload-new-driver -fno-sycl-instrument-device-code -fno-sycl-device-lib=all -fsycl-device-code-split=per_source -fsycl-device-obj=llvmir -- %s 2>&1 \
2525
// RUN: | FileCheck -check-prefixes=CHK-PHASES,CHK-PHASES-CL-MODE %s
2626
// CHK-PHASES: 0: input, "[[INPUT:.+\.c]]", c++, (host-sycl)
2727
// CHK-PHASES: 1: preprocessor, {0}, c++-cpp-output, (host-sycl)
@@ -199,7 +199,9 @@
199199
// CHK-TOOLS-AOT: clang{{.*}} "-fsycl-is-device"{{.*}} "-fsycl-int-header=[[INPUT1:.+\-header.+\.h]]" "-fsycl-int-footer={{.*}}"{{.*}} "-o" "[[OUTPUT1:.+\.bc]]"
200200
// CHK-TOOLS-AOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-o" "[[OUTPUT10:.+\.o]]"
201201
// CHK-TOOLS-AOT: llvm-link{{.*}} "[[OUTPUT1]]" "-o" "[[OUTPUT2:.+\.bc]]"
202-
// CHK-TOOLS-AOT: sycl-post-link{{.*}} "-split=auto"{{.*}} "-spec-const=emulation"{{.*}} "-o" "[[OUTPUT3:.+\.table]]" "[[OUTPUT2]]"
202+
// CHK-TOOLS-FPGA: sycl-post-link{{.*}} "-split=auto"{{.*}} "-spec-const=emulation"{{.*}} "-o" "[[OUTPUT3:.+\.table]]" "[[OUTPUT2]]"
203+
// CHK-TOOLS-GEN: sycl-post-link{{.*}} "-split=auto"{{.*}} "-spec-const=emulation"{{.*}} "-o" "[[OUTPUT3:.+\.table]]" "[[OUTPUT2]]"
204+
// CHK-TOOLS-CPU: sycl-post-link{{.*}} "-split=auto"{{.*}} "-spec-const=emulation"{{.*}} "-o" "spir64_x86_64,[[OUTPUT3:.+\.table]]" "[[OUTPUT2]]"
203205
// CHK-TOOLS-AOT: file-table-tform{{.*}} "-o" "[[OUTPUT4:.+\.txt]]" "[[OUTPUT3]]"
204206
// CHK-TOOLS-AOT: llvm-foreach{{.*}} "--in-file-list=[[OUTPUT4]]" "--in-replace=[[OUTPUT4]]" "--out-ext=spv" "--out-file-list=[[OUTPUT5:.+\.txt]]" "--out-replace=[[OUTPUT5]]" "--" "{{.*}}llvm-spirv{{.*}}" "-o" "[[OUTPUT5]]" {{.*}} "[[OUTPUT4]]"
205207
// CHK-TOOLS-FPGA: llvm-foreach{{.*}} "--out-file-list=[[OUTPUT6:.+\.txt]]{{.*}} "--" "{{.*}}aoc{{.*}} "-o" "[[OUTPUT6]]" "[[OUTPUT5]]"
@@ -276,34 +278,34 @@
276278
// Check -fsycl-device-code-split=per_kernel option passing.
277279
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-device-code-split=per_kernel %s 2>&1 \
278280
// RUN: | FileCheck %s -check-prefixes=CHK-ONE-KERNEL
279-
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split=per_kernel %s 2>&1 \
281+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split=per_kernel -- %s 2>&1 \
280282
// RUN: | FileCheck %s -check-prefixes=CHK-ONE-KERNEL
281283
// CHK-ONE-KERNEL: sycl-post-link{{.*}} "-split=kernel"{{.*}} "-o"{{.*}}
282284

283285
// Check -fsycl-device-code-split=per_source option passing.
284286
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-device-code-split=per_source %s 2>&1 \
285287
// RUN: | FileCheck %s -check-prefixes=CHK-PER-SOURCE
286-
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split=per_source %s 2>&1 \
288+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split=per_source -- %s 2>&1 \
287289
// RUN: | FileCheck %s -check-prefixes=CHK-PER-SOURCE
288290
// CHK-PER-SOURCE: sycl-post-link{{.*}} "-split=source"{{.*}} "-o"{{.*}}
289291

290292
// Check -fsycl-device-code-split option passing.
291293
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-device-code-split %s 2>&1 \
292294
// RUN: | FileCheck %s -check-prefixes=CHK-AUTO
293-
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split %s 2>&1 \
295+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split -- %s 2>&1 \
294296
// RUN: | FileCheck %s -check-prefixes=CHK-AUTO
295297
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-device-code-split=auto %s 2>&1 \
296298
// RUN: | FileCheck %s -check-prefixes=CHK-AUTO
297-
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split=auto %s 2>&1 \
299+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split=auto -- %s 2>&1 \
298300
// RUN: | FileCheck %s -check-prefixes=CHK-AUTO
299301
// RUN: %clang -### -fsycl --no-offload-new-driver %s 2>&1 | FileCheck %s -check-prefixes=CHK-AUTO
300-
// RUN: %clang_cl -### -fsycl --no-offload-new-driver %s 2>&1 | FileCheck %s -check-prefixes=CHK-AUTO
302+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -- %s 2>&1 | FileCheck %s -check-prefixes=CHK-AUTO
301303
// CHK-AUTO: sycl-post-link{{.*}} "-split=auto"{{.*}} "-o"{{.*}}
302304

303305
// Check no device code split mode.
304306
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-device-code-split -fsycl-device-code-split=off %s 2>&1 \
305307
// RUN: | FileCheck %s -check-prefixes=CHK-NO-SPLIT
306-
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split -fsycl-device-code-split=off %s 2>&1 \
308+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -fsycl-device-code-split -fsycl-device-code-split=off -- %s 2>&1 \
307309
// RUN: | FileCheck %s -check-prefixes=CHK-NO-SPLIT
308310
// CHK-NO-SPLIT-NOT: sycl-post-link{{.*}} "-split={{.*}}
309311

@@ -319,18 +321,18 @@
319321

320322
// Check ESIMD device code split.
321323
// RUN: %clang -### -fsycl --no-offload-new-driver %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
322-
// RUN: %clang_cl -### -fsycl --no-offload-new-driver %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
324+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -- %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
323325
// RUN: %clang -### -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
324326
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-targets=spir64_fpga-unknown-unknown %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
325-
// RUN: %clang_cl -### -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
327+
// RUN: %clang_cl -### -fintelfpga -- %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-SPLIT
326328
// CHK-ESIMD-SPLIT: sycl-post-link{{.*}} "-split-esimd"
327329

328330
// Check lowering of ESIMD device code.
329331
// RUN: %clang -### -fsycl --no-offload-new-driver %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
330-
// RUN: %clang_cl -### -fsycl --no-offload-new-driver %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
332+
// RUN: %clang_cl -### -fsycl --no-offload-new-driver -- %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
331333
// RUN: %clang -### -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
332334
// RUN: %clang -### -fsycl --no-offload-new-driver -fsycl-targets=spir64_fpga-unknown-unknown %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
333-
// RUN: %clang_cl -### -fintelfpga %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
335+
// RUN: %clang_cl -### -fintelfpga -- %s 2>&1 | FileCheck %s -check-prefixes=CHK-ESIMD-LOWER
334336
// CHK-ESIMD-LOWER: sycl-post-link{{.*}} "-lower-esimd"
335337

336338
// Check -f[no]sycl-device-code-split-esimd option's effect on sycl-post-link invocation

clang/test/Driver/sycl-oneapi-gpu-intelgpu.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@
293293
// CHECK_TOOLS_BEOPTS_MIX: ocloc{{.*}} "-device" "skl"{{.*}}"-DSKL2"
294294

295295
/// Check that target is passed to sycl-post-link for filtering
296-
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_pvc,intel_gpu_dg1 \
296+
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_pvc,intel_gpu_dg1,spir64_x86_64 \
297297
// RUN: -### %s 2>&1 | FileCheck %s --check-prefix=CHECK_TOOLS_FILTER
298298
// CHECK_TOOLS_FILTER: sycl-post-link{{.*}} "-o" "intel_gpu_pvc,{{.*}}"
299299
// CHECK_TOOLS_FILTER: sycl-post-link{{.*}} "-o" "intel_gpu_dg1,{{.*}}"
300+
// CHECK_TOOLS_FILTER: sycl-post-link{{.*}} "-o" "spir64_x86_64,{{.*}}"

llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def : TargetInfo<"__TestDeprecatedAspectList",
154154

155155
def : TargetInfo<"spir64", [], [], "", "", 1>;
156156
def : TargetInfo<"spir64_gen", [], [], "", "", 1>;
157-
def : TargetInfo<"spir64_x86_64", [], [], "", "", 1>;
157+
def : TargetInfo<"spir64_x86_64", [AspectFp64, AspectAtomic64], [4, 8, 16, 32, 64], "", "", 1>;
158158
def : TargetInfo<"spir64_fpga", [], [], "", "", 1>;
159159
def : TargetInfo<"x86_64", [], [], "", "", 1>;
160160
// Examples of how to use a combination of explicitly specified values + predefined lists

sycl/test-e2e/AOT/double.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// This test ensures that a program that has a kernel
22
// using fp64 can be compiled AOT.
33

4-
// REQUIRES: ocloc
4+
// REQUIRES: ocloc, opencl-aot, any-device-is-cpu
55
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s
6+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s
67

78
// ocloc on windows does not have support for PVC/CFL, so this command will
89
// result in an error when on windows. (In general, there is no support

sycl/test-e2e/AOT/half.cpp

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// This test ensures that a program that has a kernel
2+
// using fp16 can be compiled AOT.
3+
4+
// REQUIRES: ocloc, opencl-aot, any-device-is-cpu
5+
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s
6+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s
7+
8+
// ocloc on windows does not have support for PVC/CFL, so this command will
9+
// result in an error when on windows. (In general, there is no support
10+
// for pvc/cfl on windows.)
11+
// RUN: %if !windows %{ %clangxx -fsycl -fsycl-targets=intel_gpu_cfl -o %t.cfl.out %s %}
12+
// RUN: %if !windows %{ %clangxx -fsycl -fsycl-targets=intel_gpu_pvc -o %t.pvc.out %s %}
13+
14+
#include <sycl/detail/core.hpp>
15+
16+
using namespace sycl;
17+
18+
int main() {
19+
queue q;
20+
if (q.get_device().has(aspect::fp16)) {
21+
sycl::half h = 2.5;
22+
{
23+
buffer<sycl::half, 1> buf(&h, 1);
24+
q.submit([&](handler &cgh) {
25+
accessor acc{buf, cgh};
26+
cgh.single_task([=] { acc[0] *= 2; });
27+
});
28+
}
29+
std::cout << h << "\n";
30+
}
31+
}

sycl/test-e2e/AOT/reqd-sg-size.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// This test ensures that a program that has a kernel
22
// using various required sub-group sizes can be compiled AOT.
33

4-
// REQUIRES: ocloc
4+
// REQUIRES: ocloc, opencl-aot, any-device-is-cpu
55
// RUN: %clangxx -fsycl -fsycl-targets=intel_gpu_tgllp -o %t.tgllp.out %s
6+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 -o %t.x86.out %s
67

78
// ocloc on windows does not have support for PVC/CFL, so this command will
89
// result in an error when on windows. (In general, there is no support

0 commit comments

Comments
 (0)