Skip to content

Commit 8e961dd

Browse files
author
iclsrc
committed
Merge from 'sycl' to 'sycl-web'
2 parents 5305875 + 3139f5c commit 8e961dd

18 files changed

+1174
-675
lines changed

clang/lib/CodeGen/CGCall.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5688,10 +5688,11 @@ RValue CodeGenFunction::EmitCall(const CGFunctionInfo &CallInfo,
56885688
if (!getLangOpts().FPAccuracyFuncMap.empty() ||
56895689
!getLangOpts().FPAccuracyVal.empty()) {
56905690
const auto *FD = dyn_cast_if_present<FunctionDecl>(TargetDecl);
5691-
assert(FD && "expecting a function");
5692-
CI = EmitFPBuiltinIndirectCall(IRFuncTy, IRCallArgs, CalleePtr, FD);
5693-
if (CI)
5694-
return RValue::get(CI);
5691+
if (FD) {
5692+
CI = EmitFPBuiltinIndirectCall(IRFuncTy, IRCallArgs, CalleePtr, FD);
5693+
if (CI)
5694+
return RValue::get(CI);
5695+
}
56955696
}
56965697
CI = Builder.CreateCall(IRFuncTy, CalleePtr, IRCallArgs, BundleList);
56975698
} else {

sycl/doc/design/KernelFusionJIT.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
## Context
44

5-
To support the [user driven kernel fusion extension](https://github.com/intel/llvm/pull/7098) (a presentation can be found [here](https://github.com/oneapi-src/oneAPI-tab/blob/main/tab-dpcpp-onedpl/presentations/oneAPI-TAB-20220727-Kernel-Fusion.pdf)).
6-
Currently, only targets able to consume SPIR-V are supported.
5+
To support the [user driven kernel fusion extension](https://github.com/intel/llvm/pull/7098) (a presentation can be found [here](https://github.com/oneapi-src/oneAPI-tab/blob/main/language/presentations/oneAPI-TAB-20220727-Kernel-Fusion.pdf)).
76

87
The basic workflow is shown in the diagram below
98

@@ -284,3 +283,13 @@ flag during static compilation.
284283
During the fusion process at runtime, the JIT will load the LLVM IR and
285284
finalize the fused kernel to the final target. More information is available
286285
[here](./CompilerAndRuntimeDesign.md#kernel-fusion-support).
286+
287+
### Unsupported SYCL constructs
288+
289+
The following SYCL API constructs are currently not officially supported for
290+
kernel fusion and should be considered untested/unsupported:
291+
292+
- Reductions
293+
- `sycl::stream`
294+
- Specialization constants and `sycl::kernel_handler`
295+
- Images (`sycl::unsampled_image` and `sycl::sampled_image`)

sycl/doc/extensions/experimental/sycl_ext_codeplay_kernel_fusion.asciidoc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ on an API for kernel fusion in SYCL to inform a future extension proposal
7373
addressing the mentioned problems.
7474
====
7575

76-
[NOTE]
77-
====
78-
This extension is currently being implemented in {dpcpp} only for kernels in
79-
SPIRV format.
80-
====
81-
8276
== Overview
8377

8478
Every kernel launch in SYCL carries an overhead due to memory traffic and device

sycl/source/detail/scheduler/commands.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ pi_int32 ExecCGCommand::enqueueImpCommandBuffer() {
27362736
Req->MDims, Req->MAccessRange,
27372737
/*DstOffset=*/{0, 0, 0}, Req->MElemSize, std::move(MSyncPointDeps),
27382738
&OutSyncPoint);
2739-
2739+
MEvent->setSyncPoint(OutSyncPoint);
27402740
return PI_SUCCESS;
27412741
}
27422742
case CG::CGTYPE::CopyPtrToAcc: {
@@ -2750,7 +2750,7 @@ pi_int32 ExecCGCommand::enqueueImpCommandBuffer() {
27502750
/*SrcOffset*/ {0, 0, 0}, Req->MElemSize, AllocaCmd->getMemAllocation(),
27512751
Req->MDims, Req->MMemoryRange, Req->MAccessRange, Req->MOffset,
27522752
Req->MElemSize, std::move(MSyncPointDeps), &OutSyncPoint);
2753-
2753+
MEvent->setSyncPoint(OutSyncPoint);
27542754
return PI_SUCCESS;
27552755
}
27562756
default:

sycl/test-e2e/AOT/early_aot.cpp

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
// Test early-AOT behaviors with -fsycl -fno-sycl-rdc. This targets spir64_gen
2+
3+
// REQUIRES: ocloc, gpu
4+
// UNSUPPORTED: cuda, hip
5+
6+
// Build the early AOT device binaries
7+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts -fno-sycl-rdc -c -DADD_CPP %s -o %t_add.o
8+
// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts -fno-sycl-rdc -c -DSUB_CPP %s -o %t_sub.o
9+
// RUN: %clangxx -fsycl -DMAIN_CPP %s %t_add.o %t_sub.o -o %t.out
10+
11+
// RUN: %{run} %t.out
12+
13+
#ifdef MAIN_CPP
14+
// main.cpp
15+
16+
#include "sycl/sycl.hpp"
17+
#include <iostream>
18+
19+
void add(sycl::queue q, int *result, int a, int b);
20+
void sub(sycl::queue q, int *result, int a, int b);
21+
22+
int main() {
23+
sycl::queue q;
24+
int *result = sycl::malloc_host<int>(2, q);
25+
if (!result)
26+
std::cout << "Error: failed to allocate USM host memory\n";
27+
28+
try {
29+
add(q, &(result[0]), 2, 1);
30+
} catch (sycl::exception const &e) {
31+
std::cout
32+
<< "Caught synchronous SYCL exception while launching add kernel:\n"
33+
<< e.what() << "\n";
34+
std::terminate();
35+
}
36+
try {
37+
sub(q, &(result[1]), 2, 1);
38+
} catch (sycl::exception const &e) {
39+
std::cout
40+
<< "Caught synchronous SYCL exception while launching sub kernel:\n"
41+
<< e.what() << "\n";
42+
std::terminate();
43+
}
44+
q.wait();
45+
46+
// Check the results
47+
if (!(result[0] == 3 && result[1] == 1)) {
48+
std::cout << "FAILED\n";
49+
return 1;
50+
}
51+
std::cout << "PASSED\n";
52+
return 0;
53+
}
54+
55+
#endif // MAIN_CPP
56+
57+
#ifdef ADD_CPP
58+
// add.cpp
59+
#include "sycl/sycl.hpp"
60+
61+
void add(sycl::queue q, int *result, int a, int b) {
62+
q.single_task<class add_dummy>([=] { *result = a + b; });
63+
}
64+
65+
#endif // ADD_CPP
66+
67+
#ifdef SUB_CPP
68+
// sub.cpp
69+
#include "sycl/sycl.hpp"
70+
71+
void sub(sycl::queue q, int *result, int a, int b) {
72+
q.single_task<class sub_dummy>([=] { *result = a - b; });
73+
}
74+
#endif // SUB_CPP

sycl/test-e2e/Matrix/Legacy/XMX8/element_wise_all_ops_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix-xmx8
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=1
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/Legacy/XMX8/joint_matrix_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix-xmx8
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=1
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/Legacy/element_wise_all_ops_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=1
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/Legacy/joint_matrix_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=1
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/SG32/element_wise_all_ops_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix,gpu
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/SG32/joint_matrix_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/XMX8/element_wise_all_ops_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix-xmx8
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/XMX8/joint_matrix_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix-xmx8
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/element_wise_all_ops_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4
1213
// RUN: %{run} %t.out

sycl/test-e2e/Matrix/joint_matrix_half.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//===----------------------------------------------------------------------===//
88
// REQUIRES: aspect-fp16
99
// REQUIRES: matrix
10+
// REQUIRES: matrix-fp16
1011

1112
// RUN: %{build} -o %t.out -DSYCL_EXT_ONEAPI_MATRIX_VERSION=4
1213
// RUN: %{run} %t.out

0 commit comments

Comments
 (0)