Skip to content

Commit ce4904a

Browse files
committed
Merge remote-tracking branch 'origin/sycl' into yc/UR-pr-2293
2 parents 112c192 + bee8a39 commit ce4904a

File tree

130 files changed

+2556
-641
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+2556
-641
lines changed

.github/workflows/sycl-containers-igc-dev.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ jobs:
2626
strategy:
2727
matrix:
2828
include:
29-
- name: Intel Drivers Ubuntu 22.04 Docker image with dev IGC
30-
dockerfile: ubuntu2204_intel_drivers_igc_dev
31-
imagefile: ubuntu2204_intel_drivers
29+
- name: Intel Drivers Ubuntu 24.04 Docker image with dev IGC
30+
dockerfile: ubuntu2404_intel_drivers_igc_dev
31+
imagefile: ubuntu2404_intel_drivers
3232
tag: devigc
3333
build_args: |
3434
"use_latest=false"

.github/workflows/sycl-containers.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ jobs:
5151
file: ubuntu2204_intel_drivers
5252
tag: latest
5353
build_args: "use_latest=false"
54-
- name: Intel Drivers (unstable) Ubuntu 22.04 Docker image
55-
file: ubuntu2204_intel_drivers
54+
- name: Intel Drivers (unstable) Ubuntu 24.04 Docker image
55+
file: ubuntu2404_intel_drivers
5656
tag: unstable
5757
build_args: "use_latest=true"
5858
- name: Build + Intel Drivers Ubuntu 22.04 Docker image

.github/workflows/sycl-linux-precommit.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ jobs:
4545
build_cache_root: "/__w/"
4646
build_artifact_suffix: "default"
4747
build_cache_suffix: "default"
48+
# Docker image has last nightly pre-installed and added to the PATH
49+
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build"
50+
cc: clang
51+
cxx: clang++
4852
changes: ${{ needs.detect_changes.outputs.filters }}
4953

5054
determine_arc_tests:
@@ -103,7 +107,7 @@ jobs:
103107
env: '{"LIT_FILTER":${{ needs.determine_arc_tests.outputs.arc_tests }} }'
104108
- name: E2E tests with dev igc on Intel Arc A-Series Graphics
105109
runner: '["Linux", "arc"]'
106-
image: ghcr.io/intel/llvm/ubuntu2204_intel_drivers:devigc
110+
image: ghcr.io/intel/llvm/ubuntu2404_intel_drivers:devigc
107111
image_options: -u 1001 --device=/dev/dri -v /dev/dri/by-path:/dev/dri/by-path --privileged --cap-add SYS_ADMIN
108112
target_devices: level_zero:gpu;opencl:gpu
109113
reset_intel_gpu: true

.github/workflows/sycl-post-commit.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ jobs:
3535
build_cache_root: "/__w/llvm"
3636
build_cache_suffix: default
3737
build_artifact_suffix: default
38-
build_configure_extra_args: --no-assertions --hip --cuda --native_cpu --cmake-opt="-DSYCL_ENABLE_STACK_PRINTING=ON" --cmake-opt="-DSYCL_LIB_WITH_DEBUG_SYMBOL=ON"
39-
# Docker image has last nightly pre-installed and added to the PATH
40-
build_image: "ghcr.io/intel/llvm/sycl_ubuntu2204_nightly:build"
41-
cc: clang
42-
cxx: clang++
38+
build_configure_extra_args: --no-assertions --hip --cuda --native_cpu --cmake-opt="-DSYCL_ENABLE_STACK_PRINTING=ON" --cmake-opt="-DSYCL_LIB_WITH_DEBUG_SYMBOL=ON"
4339
merge_ref: ''
4440

4541
e2e-lin:

clang/include/clang/Basic/Attr.td

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,12 +1682,12 @@ def SYCLIntelESimdVectorize : InheritableAttr {
16821682
}
16831683

16841684
def SYCLScope : Attr {
1685-
// No spelling, as this attribute can't be created in the source code.
1686-
let Spellings = [];
1685+
let Spellings = [CXX11<"__sycl_detail__", "wg_scope">];
16871686
let Args = [EnumArgument<"level", "Level", /*is_string=*/false,
16881687
["work_group", "work_item"],
1689-
["WorkGroup", "WorkItem"]>];
1690-
let Subjects = SubjectList<[Function, Var]>;
1688+
["WorkGroup", "WorkItem"],
1689+
/*optional=*/true>];
1690+
let Subjects = SubjectList<[Function, Var, CXXRecord]>;
16911691
let LangOpts = [SYCLIsDevice];
16921692

16931693
let AdditionalMembers = [{
@@ -1700,7 +1700,7 @@ def SYCLScope : Attr {
17001700
}
17011701
}];
17021702

1703-
let Documentation = [InternalOnly];
1703+
let Documentation = [SYCLWGScopeDocs];
17041704
}
17051705

17061706
def SYCLDeviceIndirectlyCallable : InheritableAttr {

clang/include/clang/Basic/AttrDocs.td

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4271,6 +4271,18 @@ function pointer for the specified function.
42714271
}];
42724272
}
42734273

4274+
def SYCLWGScopeDocs : Documentation {
4275+
let Category = DocCatFunction;
4276+
let Heading = "__sycl_detail__::wg_scope";
4277+
let Content = [{
4278+
This attribute can only be applied to records with a trivial default constructor and destructor.
4279+
Types with this attribute cannot be used for non-static data members.
4280+
It indicates that any block and namespace scope variable of a type holding this attribute
4281+
will be allocated in local memory. For variables allocated in block scope, they behave
4282+
as implicitly declared as static.
4283+
}];
4284+
}
4285+
42744286
def SYCLDeviceDocs : Documentation {
42754287
let Category = DocCatFunction;
42764288
let Heading = "sycl_device";

clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12556,6 +12556,11 @@ def err_sycl_external_global : Error<
1255612556
def warn_sycl_kernel_too_big_args : Warning<
1255712557
"size of kernel arguments (%0 bytes) may exceed the supported maximum "
1255812558
"of %1 bytes on some devices">, InGroup<SyclStrict>, ShowInSystemHeader;
12559+
def err_sycl_wg_scope : Error<
12560+
"SYCL work group scope only applies to class with a trivial "
12561+
"%select{default constructor|destructor}0">;
12562+
def err_sycl_field_with_wg_scope : Error<
12563+
"non-static data member is of a type with a SYCL work group scope attribute applied to it">;
1255912564
def err_sycl_virtual_types : Error<
1256012565
"no class with a vtable can be used in a SYCL kernel or any code included in the kernel">;
1256112566
def note_sycl_recursive_function_declared_here: Note<"function implemented using recursion declared here">;

clang/include/clang/Sema/SemaSYCL.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ class SemaSYCL : public SemaBase {
267267

268268
void CheckSYCLKernelCall(FunctionDecl *CallerFunc,
269269
ArrayRef<const Expr *> Args);
270+
void CheckSYCLScopeAttr(CXXRecordDecl *Decl);
270271

271272
/// Creates a SemaDiagnosticBuilder that emits the diagnostic if the current
272273
/// context is "used as device code".
@@ -478,6 +479,7 @@ class SemaSYCL : public SemaBase {
478479
const ParsedAttr &AL);
479480
void handleSYCLIntelMaxWorkGroupsPerMultiprocessor(Decl *D,
480481
const ParsedAttr &AL);
482+
void handleSYCLScopeAttr(Decl *D, const ParsedAttr &AL);
481483

482484
void checkSYCLAddIRAttributesFunctionAttrConflicts(Decl *D);
483485

clang/lib/CodeGen/CGDecl.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ void CodeGenFunction::EmitVarDecl(const VarDecl &D) {
217217
if (D.getType().getAddressSpace() == LangAS::opencl_local)
218218
return CGM.getOpenCLRuntime().EmitWorkGroupLocalVarDecl(*this, D);
219219

220-
if (D.getAttr<SYCLScopeAttr>() && D.getAttr<SYCLScopeAttr>()->isWorkGroup())
220+
SYCLScopeAttr *ScopeAttr = D.getAttr<SYCLScopeAttr>();
221+
if (!ScopeAttr)
222+
if (auto *RD = D.getType()->getAsCXXRecordDecl())
223+
ScopeAttr = RD->getAttr<SYCLScopeAttr>();
224+
if (ScopeAttr && ScopeAttr->isWorkGroup())
221225
return CGM.getSYCLRuntime().emitWorkGroupLocalVarDecl(*this, D);
222226

223227
assert(D.hasLocalStorage());

clang/lib/CodeGen/CGSYCLRuntime.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ void CGSYCLRuntime::emitWorkGroupLocalVarDecl(CodeGenFunction &CGF,
9696
const VarDecl &D) {
9797
#ifndef NDEBUG
9898
SYCLScopeAttr *Scope = D.getAttr<SYCLScopeAttr>();
99-
assert(Scope && Scope->isWorkGroup() && "work group scope expected");
99+
if (!Scope)
100+
if (auto *RD = D.getType()->getAsCXXRecordDecl())
101+
Scope = RD->getAttr<SYCLScopeAttr>();
102+
assert((Scope && Scope->isWorkGroup()) && "work group scope expected");
100103
#endif // NDEBUG
101104
// generate global variable in the address space selected by the clang CodeGen
102105
// (should be local)

0 commit comments

Comments
 (0)