Skip to content

Commit 39483ab

Browse files
lbushi25lorenc.bushi
and
lorenc.bushi
authored
[SYCL] Add support for work group memory free function kernel parameter (#15861)
This PR concludes the implementation of the work group memory [extension](https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/proposed/sycl_ext_oneapi_work_group_memory.asciidoc). It adds support for work group memory parameters when using free function kernels. --------- Co-authored-by: lorenc.bushi <[email protected]>
1 parent 8922ee7 commit 39483ab

File tree

10 files changed

+210
-33
lines changed

10 files changed

+210
-33
lines changed

clang/lib/Sema/SemaSYCL.cpp

Lines changed: 123 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1522,7 +1522,7 @@ class KernelObjVisitor {
15221522
void visitParam(ParmVarDecl *Param, QualType ParamTy,
15231523
HandlerTys &...Handlers) {
15241524
if (isSyclSpecialType(ParamTy, SemaSYCLRef))
1525-
KP_FOR_EACH(handleOtherType, Param, ParamTy);
1525+
KP_FOR_EACH(handleSyclSpecialType, Param, ParamTy);
15261526
else if (ParamTy->isStructureOrClassType()) {
15271527
if (KP_FOR_EACH(handleStructType, Param, ParamTy)) {
15281528
CXXRecordDecl *RD = ParamTy->getAsCXXRecordDecl();
@@ -2075,8 +2075,11 @@ class SyclKernelFieldChecker : public SyclKernelFieldHandler {
20752075
}
20762076

20772077
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
2078-
Diag.Report(PD->getLocation(), diag::err_bad_kernel_param_type) << ParamTy;
2079-
IsInvalid = true;
2078+
if (!SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory)) {
2079+
Diag.Report(PD->getLocation(), diag::err_bad_kernel_param_type)
2080+
<< ParamTy;
2081+
IsInvalid = true;
2082+
}
20802083
return isValid();
20812084
}
20822085

@@ -2228,8 +2231,8 @@ class SyclKernelUnionChecker : public SyclKernelFieldHandler {
22282231
}
22292232

22302233
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
2231-
// TODO
2232-
unsupportedFreeFunctionParamType();
2234+
if (!SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory))
2235+
unsupportedFreeFunctionParamType(); // TODO
22332236
return true;
22342237
}
22352238

@@ -3013,9 +3016,26 @@ class SyclKernelDeclCreator : public SyclKernelFieldHandler {
30133016
return handleSpecialType(FD, FieldTy);
30143017
}
30153018

3016-
bool handleSyclSpecialType(ParmVarDecl *, QualType) final {
3017-
// TODO
3018-
unsupportedFreeFunctionParamType();
3019+
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
3020+
if (SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory)) {
3021+
const auto *RecordDecl = ParamTy->getAsCXXRecordDecl();
3022+
assert(RecordDecl && "The type must be a RecordDecl");
3023+
CXXMethodDecl *InitMethod = getMethodByName(RecordDecl, InitMethodName);
3024+
assert(InitMethod && "The type must have the __init method");
3025+
// Don't do -1 here because we count on this to be the first parameter
3026+
// added (if any).
3027+
size_t ParamIndex = Params.size();
3028+
for (const ParmVarDecl *Param : InitMethod->parameters()) {
3029+
QualType ParamTy = Param->getType();
3030+
addParam(Param, ParamTy.getCanonicalType());
3031+
// Propagate add_ir_attributes_kernel_parameter attribute.
3032+
if (const auto *AddIRAttr =
3033+
Param->getAttr<SYCLAddIRAttributesKernelParameterAttr>())
3034+
Params.back()->addAttr(AddIRAttr->clone(SemaSYCLRef.getASTContext()));
3035+
}
3036+
LastParamIndex = ParamIndex;
3037+
} else // TODO
3038+
unsupportedFreeFunctionParamType();
30193039
return true;
30203040
}
30213041

@@ -3291,9 +3311,7 @@ class SyclKernelArgsSizeChecker : public SyclKernelFieldHandler {
32913311
}
32923312

32933313
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
3294-
// TODO
3295-
unsupportedFreeFunctionParamType();
3296-
return true;
3314+
return handleSpecialType(ParamTy);
32973315
}
32983316

32993317
bool handleSyclSpecialType(const CXXRecordDecl *, const CXXBaseSpecifier &BS,
@@ -4442,6 +4460,45 @@ class FreeFunctionKernelBodyCreator : public SyclKernelFieldHandler {
44424460
{});
44434461
}
44444462

4463+
MemberExpr *buildMemberExpr(Expr *Base, ValueDecl *Member) {
4464+
DeclAccessPair MemberDAP = DeclAccessPair::make(Member, AS_none);
4465+
MemberExpr *Result = SemaSYCLRef.SemaRef.BuildMemberExpr(
4466+
Base, /*IsArrow */ false, FreeFunctionSrcLoc, NestedNameSpecifierLoc(),
4467+
FreeFunctionSrcLoc, Member, MemberDAP,
4468+
/*HadMultipleCandidates*/ false,
4469+
DeclarationNameInfo(Member->getDeclName(), FreeFunctionSrcLoc),
4470+
Member->getType(), VK_LValue, OK_Ordinary);
4471+
return Result;
4472+
}
4473+
4474+
void createSpecialMethodCall(const CXXRecordDecl *RD, StringRef MethodName,
4475+
Expr *MemberBaseExpr,
4476+
SmallVectorImpl<Stmt *> &AddTo) {
4477+
CXXMethodDecl *Method = getMethodByName(RD, MethodName);
4478+
if (!Method)
4479+
return;
4480+
unsigned NumParams = Method->getNumParams();
4481+
llvm::SmallVector<Expr *, 4> ParamDREs(NumParams);
4482+
llvm::ArrayRef<ParmVarDecl *> KernelParameters =
4483+
DeclCreator.getParamVarDeclsForCurrentField();
4484+
for (size_t I = 0; I < NumParams; ++I) {
4485+
QualType ParamType = KernelParameters[I]->getOriginalType();
4486+
ParamDREs[I] = SemaSYCLRef.SemaRef.BuildDeclRefExpr(
4487+
KernelParameters[I], ParamType, VK_LValue, FreeFunctionSrcLoc);
4488+
}
4489+
MemberExpr *MethodME = buildMemberExpr(MemberBaseExpr, Method);
4490+
QualType ResultTy = Method->getReturnType();
4491+
ExprValueKind VK = Expr::getValueKindForType(ResultTy);
4492+
ResultTy = ResultTy.getNonLValueExprType(SemaSYCLRef.getASTContext());
4493+
llvm::SmallVector<Expr *, 4> ParamStmts;
4494+
const auto *Proto = cast<FunctionProtoType>(Method->getType());
4495+
SemaSYCLRef.SemaRef.GatherArgumentsForCall(FreeFunctionSrcLoc, Method,
4496+
Proto, 0, ParamDREs, ParamStmts);
4497+
AddTo.push_back(CXXMemberCallExpr::Create(
4498+
SemaSYCLRef.getASTContext(), MethodME, ParamStmts, ResultTy, VK,
4499+
FreeFunctionSrcLoc, FPOptionsOverride()));
4500+
}
4501+
44454502
public:
44464503
static constexpr const bool VisitInsideSimpleContainers = false;
44474504

@@ -4461,9 +4518,53 @@ class FreeFunctionKernelBodyCreator : public SyclKernelFieldHandler {
44614518
return true;
44624519
}
44634520

4464-
bool handleSyclSpecialType(ParmVarDecl *, QualType) final {
4465-
// TODO
4466-
unsupportedFreeFunctionParamType();
4521+
// Default inits the type, then calls the init-method in the body.
4522+
// A type may not have a public default constructor as per its spec so
4523+
// typically if this is the case the default constructor will be private and
4524+
// in such cases we must manually override the access specifier from private
4525+
// to public just for the duration of this default initialization.
4526+
// TODO: Revisit this approach once https://github.com/intel/llvm/issues/16061
4527+
// is closed.
4528+
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
4529+
if (SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory)) {
4530+
const auto *RecordDecl = ParamTy->getAsCXXRecordDecl();
4531+
AccessSpecifier DefaultConstructorAccess;
4532+
auto DefaultConstructor =
4533+
std::find_if(RecordDecl->ctor_begin(), RecordDecl->ctor_end(),
4534+
[](auto it) { return it->isDefaultConstructor(); });
4535+
DefaultConstructorAccess = DefaultConstructor->getAccess();
4536+
DefaultConstructor->setAccess(AS_public);
4537+
4538+
QualType Ty = PD->getOriginalType();
4539+
ASTContext &Ctx = SemaSYCLRef.SemaRef.getASTContext();
4540+
VarDecl *WorkGroupMemoryClone = VarDecl::Create(
4541+
Ctx, DeclCreator.getKernelDecl(), FreeFunctionSrcLoc,
4542+
FreeFunctionSrcLoc, PD->getIdentifier(), PD->getType(),
4543+
Ctx.getTrivialTypeSourceInfo(Ty), SC_None);
4544+
InitializedEntity VarEntity =
4545+
InitializedEntity::InitializeVariable(WorkGroupMemoryClone);
4546+
InitializationKind InitKind =
4547+
InitializationKind::CreateDefault(FreeFunctionSrcLoc);
4548+
InitializationSequence InitSeq(SemaSYCLRef.SemaRef, VarEntity, InitKind,
4549+
std::nullopt);
4550+
ExprResult Init = InitSeq.Perform(SemaSYCLRef.SemaRef, VarEntity,
4551+
InitKind, std::nullopt);
4552+
WorkGroupMemoryClone->setInit(
4553+
SemaSYCLRef.SemaRef.MaybeCreateExprWithCleanups(Init.get()));
4554+
WorkGroupMemoryClone->setInitStyle(VarDecl::CallInit);
4555+
DefaultConstructor->setAccess(DefaultConstructorAccess);
4556+
4557+
Stmt *DS = new (SemaSYCLRef.getASTContext())
4558+
DeclStmt(DeclGroupRef(WorkGroupMemoryClone), FreeFunctionSrcLoc,
4559+
FreeFunctionSrcLoc);
4560+
BodyStmts.push_back(DS);
4561+
Expr *MemberBaseExpr = SemaSYCLRef.SemaRef.BuildDeclRefExpr(
4562+
WorkGroupMemoryClone, Ty, VK_PRValue, FreeFunctionSrcLoc);
4563+
createSpecialMethodCall(RecordDecl, InitMethodName, MemberBaseExpr,
4564+
BodyStmts);
4565+
ArgExprs.push_back(MemberBaseExpr);
4566+
} else // TODO
4567+
unsupportedFreeFunctionParamType();
44674568
return true;
44684569
}
44694570

@@ -4748,9 +4849,11 @@ class SyclKernelIntHeaderCreator : public SyclKernelFieldHandler {
47484849
return true;
47494850
}
47504851

4751-
bool handleSyclSpecialType(ParmVarDecl *, QualType) final {
4752-
// TODO
4753-
unsupportedFreeFunctionParamType();
4852+
bool handleSyclSpecialType(ParmVarDecl *PD, QualType ParamTy) final {
4853+
if (SemaSYCL::isSyclType(ParamTy, SYCLTypeAttr::work_group_memory))
4854+
addParam(PD, ParamTy, SYCLIntegrationHeader::kind_work_group_memory);
4855+
else
4856+
unsupportedFreeFunctionParamType(); // TODO
47544857
return true;
47554858
}
47564859

@@ -6227,7 +6330,6 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
62276330
O << "#include <sycl/detail/defines_elementary.hpp>\n";
62286331
O << "#include <sycl/detail/kernel_desc.hpp>\n";
62296332
O << "#include <sycl/ext/oneapi/experimental/free_function_traits.hpp>\n";
6230-
62316333
O << "\n";
62326334

62336335
LangOptions LO;
@@ -6502,6 +6604,7 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
65026604

65036605
O << "\n";
65046606
O << "// Forward declarations of kernel and its argument types:\n";
6607+
Policy.SuppressDefaultTemplateArgs = false;
65056608
FwdDeclEmitter.Visit(K.SyclKernel->getType());
65066609
O << "\n";
65076610

@@ -6579,6 +6682,8 @@ void SYCLIntegrationHeader::emit(raw_ostream &O) {
65796682
}
65806683
O << ";\n";
65816684
O << "}\n";
6685+
Policy.SuppressDefaultTemplateArgs = true;
6686+
Policy.EnforceDefaultTemplateArgs = false;
65826687

65836688
// Generate is_kernel, is_single_task_kernel and nd_range_kernel functions.
65846689
O << "namespace sycl {\n";

clang/test/CodeGenSYCL/free_function_int_header.cpp

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: FileCheck -input-file=%t.h %s
33
//
44
// This test checks integration header contents for free functions with scalar,
5-
// pointer and non-decomposed struct parameters.
5+
// pointer, non-decomposed struct parameters and work group memory parameters.
66

77
#include "mock_properties.hpp"
88
#include "sycl.hpp"
@@ -96,6 +96,12 @@ void ff_7(KArgWithPtrArray<ArrSize> KArg) {
9696

9797
template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
9898

99+
__attribute__((sycl_device))
100+
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 0)]]
101+
void ff_8(sycl::work_group_memory<int>) {
102+
}
103+
104+
99105
// CHECK: const char* const kernel_names[] = {
100106
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_2Piii
101107
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_2Piiii
@@ -105,6 +111,7 @@ template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
105111
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_410NoPointers8Pointers3Agg
106112
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_6I3Agg7DerivedEvT_T0_i
107113
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_7ILi3EEv16KArgWithPtrArrayIXT_EE
114+
// CHECK-NEXT: {{.*}}__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE
108115
// CHECK-NEXT: ""
109116
// CHECK-NEXT: };
110117

@@ -148,6 +155,9 @@ template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
148155
// CHECK: //--- _Z18__sycl_kernel_ff_7ILi3EEv16KArgWithPtrArrayIXT_EE
149156
// CHECK-NEXT: { kernel_param_kind_t::kind_std_layout, 48, 0 },
150157

158+
// CHECK: //--- _Z18__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE
159+
// CHECK-NEXT: { kernel_param_kind_t::kind_work_group_memory, 8, 0 },
160+
151161
// CHECK: { kernel_param_kind_t::kind_invalid, -987654321, -987654321 },
152162
// CHECK-NEXT: };
153163

@@ -294,6 +304,26 @@ template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
294304
// CHECK-NEXT: };
295305
// CHECK-NEXT: }
296306

307+
// CHECK: Definition of _Z18__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE as a free function kernel
308+
309+
// CHECK: Forward declarations of kernel and its argument types:
310+
// CHECK: template <typename DataT> class work_group_memory;
311+
312+
// CHECK: void ff_8(sycl::work_group_memory<int>);
313+
// CHECK-NEXT: static constexpr auto __sycl_shim9() {
314+
// CHECK-NEXT: return (void (*)(class sycl::work_group_memory<int>))ff_8;
315+
// CHECK-NEXT: }
316+
// CHECK-NEXT: namespace sycl {
317+
// CHECK-NEXT: template <>
318+
// CHECK-NEXT: struct ext::oneapi::experimental::is_kernel<__sycl_shim9()> {
319+
// CHECK-NEXT: static constexpr bool value = true;
320+
// CHECK-NEXT: };
321+
// CHECK-NEXT: template <>
322+
// CHECK-NEXT: struct ext::oneapi::experimental::is_single_task_kernel<__sycl_shim9()> {
323+
// CHECK-NEXT: static constexpr bool value = true;
324+
// CHECK-NEXT: };
325+
// CHECK-NEXT: }
326+
297327
// CHECK: #include <sycl/kernel_bundle.hpp>
298328

299329
// CHECK: Definition of kernel_id of _Z18__sycl_kernel_ff_2Piii
@@ -359,3 +389,11 @@ template void ff_7(KArgWithPtrArray<TestArrSize> KArg);
359389
// CHECK-NEXT: return sycl::detail::get_kernel_id_impl(std::string_view{"_Z18__sycl_kernel_ff_7ILi3EEv16KArgWithPtrArrayIXT_EE"});
360390
// CHECK-NEXT: }
361391
// CHECK-NEXT: }
392+
393+
// CHECK: Definition of kernel_id of _Z18__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE
394+
// CHECK-NEXT: namespace sycl {
395+
// CHECK-NEXT: template <>
396+
// CHECK-NEXT: kernel_id ext::oneapi::experimental::get_kernel_id<__sycl_shim9()>() {
397+
// CHECK-NEXT: return sycl::detail::get_kernel_id_impl(std::string_view{"_Z18__sycl_kernel_ff_8N4sycl3_V117work_group_memoryIiEE"});
398+
// CHECK-NEXT: }
399+
// CHECK-NEXT: }

clang/test/CodeGenSYCL/free_function_kernel_params.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clang_cc1 -internal-isystem %S/Inputs -fsycl-is-device -triple spir64 \
22
// RUN: -emit-llvm %s -o - | FileCheck %s
33
// This test checks parameter IR generation for free functions with parameters
4-
// of non-decomposed struct type.
4+
// of non-decomposed struct type and work group memory type.
55

66
#include "sycl.hpp"
77

@@ -56,3 +56,18 @@ template void ff_6(KArgWithPtrArray<TestArrSize> KArg);
5656
// CHECK: %struct.KArgWithPtrArray = type { [3 x ptr addrspace(4)], [3 x i32], [3 x i32] }
5757
// CHECK: define dso_local spir_kernel void @{{.*}}__sycl_kernel{{.*}}(ptr noundef byval(%struct.NoPointers) align 4 %__arg_S1, ptr noundef byval(%struct.__generated_Pointers) align 8 %__arg_S2, ptr noundef byval(%struct.__generated_Agg) align 8 %__arg_S3)
5858
// CHECK: define dso_local spir_kernel void @{{.*}}__sycl_kernel_ff_6{{.*}}(ptr noundef byval(%struct.__generated_KArgWithPtrArray) align 8 %__arg_KArg)
59+
60+
__attribute__((sycl_device))
61+
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 0)]]
62+
void ff_7(sycl::work_group_memory<int> mem) {
63+
}
64+
65+
// CHECK: define dso_local spir_kernel void @{{.*}}__sycl_kernel_ff_7{{.*}}(ptr addrspace(3) noundef align 4 %__arg_Ptr)
66+
// CHECK: %__arg_Ptr.addr = alloca ptr addrspace(3), align 8
67+
// CHECK-NEXT: %mem = alloca %"class.sycl::_V1::work_group_memory", align 8
68+
// CHECK: %__arg_Ptr.addr.ascast = addrspacecast ptr %__arg_Ptr.addr to ptr addrspace(4)
69+
// CHECK-NEXT: %mem.ascast = addrspacecast ptr %mem to ptr addrspace(4)
70+
// CHECK: store ptr addrspace(3) %__arg_Ptr, ptr addrspace(4) %__arg_Ptr.addr.ascast, align 8
71+
// CHECK-NEXT: [[REGISTER:%[a-zA-Z0-9_]+]] = load ptr addrspace(3), ptr addrspace(4) %__arg_Ptr.addr.ascast, align 8
72+
// CHECK-NEXT: call spir_func void @{{.*}}work_group_memory{{.*}}__init{{.*}}(ptr addrspace(4) noundef align 8 dereferenceable_or_null(8) %mem.ascast, ptr addrspace(3) noundef [[REGISTER]])
73+

clang/test/SemaSYCL/free_function_kernel_params.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clang_cc1 -internal-isystem %S/Inputs -fsycl-is-device -ast-dump \
22
// RUN: %s -o - | FileCheck %s
33
// This test checks parameter rewriting for free functions with parameters
4-
// of type scalar, pointer and non-decomposed struct.
4+
// of type scalar, pointer, non-decomposed struct and work group memory.
55

66
#include "sycl.hpp"
77

@@ -171,3 +171,23 @@ template void ff_6(Agg S1, Derived1 S2, int);
171171
// CHECK-NEXT: DeclRefExpr {{.*}} '__generated_Derived1' lvalue ParmVar {{.*}} '__arg_S2' '__generated_Derived1'
172172
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'int' <LValueToRValue>
173173
// CHECK-NEXT: DeclRefExpr {{.*}} 'int' lvalue ParmVar {{.*}} '__arg_end' 'int'
174+
175+
__attribute__((sycl_device))
176+
[[__sycl_detail__::add_ir_attributes_function("sycl-nd-range-kernel", 0)]]
177+
void ff_7(sycl::work_group_memory<int> mem) {
178+
}
179+
// CHECK: FunctionDecl {{.*}}__sycl_kernel{{.*}}'void (__local int *)'
180+
// CHECK-NEXT: ParmVarDecl {{.*}} used __arg_Ptr '__local int *'
181+
// CHECK-NEXT: CompoundStmt
182+
// CHECK-NEXT: DeclStmt
183+
// CHECK-NEXT: VarDecl {{.*}} used mem 'sycl::work_group_memory<int>' callinit
184+
// CHECK-NEXT: CXXConstructExpr {{.*}} 'sycl::work_group_memory<int>' 'void () noexcept'
185+
// CHECK-NEXT: CXXMemberCallExpr {{.*}} 'void'
186+
// CHECK-NEXT: MemberExpr {{.*}} 'void (__local int *)' lvalue .__init
187+
// CHECK-NEXT: DeclRefExpr {{.*}} 'sycl::work_group_memory<int>' Var {{.*}} 'mem' 'sycl::work_group_memory<int>'
188+
// CHECK-NEXT: ImplicitCastExpr {{.*}} '__local int *' <LValueToRValue>
189+
// CHECK-NEXT: DeclRefExpr {{.*}} '__local int *' lvalue ParmVar {{.*}} '__arg_Ptr' '__local int *'
190+
// CHECK-NEXT: CallExpr {{.*}} 'void'
191+
// CHECK-NEXT: ImplicitCastExpr {{.*}} 'void (*)(sycl::work_group_memory<int>)' <FunctionToPointerDecay>
192+
// CHECK-NEXT: DeclRefExpr {{.*}} 'void (sycl::work_group_memory<int>)' lvalue Function {{.*}} 'ff_7' 'void (sycl::work_group_memory<int>)'
193+
// CHECK-NEXT: DeclRefExpr {{.*}} 'sycl::work_group_memory<int>' Var {{.*}} 'mem' 'sycl::work_group_memory<int>'

sycl/doc/extensions/proposed/sycl_ext_oneapi_work_group_memory.asciidoc renamed to sycl/doc/extensions/experimental/sycl_ext_oneapi_work_group_memory.asciidoc

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,10 @@ This extension also depends on the following other SYCL extensions:
4949

5050
== Status
5151

52-
This is a proposed extension specification, intended to gather community
53-
feedback.
54-
Interfaces defined in this specification may not be implemented yet or may be
55-
in a preliminary state.
56-
The specification itself may also change in incompatible ways before it is
57-
finalized.
52+
This is an experimental extension specification, intended to provide early
53+
access to features and gather community feedback. Interfaces defined in this
54+
specification are implemented in {dpcpp}, but they are not finalized and may
55+
change incompatibly in future versions of {dpcpp} without prior notice.
5856
*Shipping software products should not rely on APIs defined in this
5957
specification.*
6058

sycl/include/sycl/ext/oneapi/experimental/work_group_memory.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//===-------------------- work_group_memory.hpp ---------------------------===//
2-
//
32
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
43
// See https://llvm.org/LICENSE.txt for license information.
54
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
@@ -103,6 +102,9 @@ class __SYCL_SPECIAL_CLASS __SYCL_TYPE(work_group_memory) work_group_memory
103102
}
104103

105104
private:
105+
friend class sycl::handler; // needed in order for handler class to be aware
106+
// of the private inheritance with
107+
// work_group_memory_impl as base class
106108
decoratedPtr ptr = nullptr;
107109
};
108110
} // namespace ext::oneapi::experimental

0 commit comments

Comments
 (0)