@@ -80,6 +80,7 @@ void SYCLFuncDescriptor::declareFunction(ModuleOp &module, OpBuilder &b) {
80
80
81
81
bool SYCLAccessorFuncDescriptor::isValid (FuncId funcId) const {
82
82
switch (funcId) {
83
+ case FuncId::AccessorInt1ReadWriteGlobalBufferFalseCtorDefault:
83
84
case FuncId::AccessorInt1ReadWriteGlobalBufferFalseInit:
84
85
return true ;
85
86
default :
@@ -180,11 +181,12 @@ SYCLFuncRegistry::getFuncId(SYCLFuncDescriptor::FuncKind funcKind, Type retType,
180
181
continue ;
181
182
}
182
183
if (desc.argTys .size () != argTypes.size ()) {
183
- LLVM_DEBUG (llvm::dbgs () << " \t skip, number of arguments does not match\n " );
184
+ LLVM_DEBUG (llvm::dbgs ()
185
+ << " \t skip, number of arguments does not match\n " );
184
186
continue ;
185
187
}
186
188
if (!std::equal (argTypes.begin (), argTypes.end (), desc.argTys .begin ())) {
187
- LLVM_DEBUG (llvm::dbgs () << " \t skip, arguments types do not match\n " );
189
+ LLVM_DEBUG (llvm::dbgs () << " \t skip, arguments types do not match\n " );
188
190
continue ;
189
191
}
190
192
@@ -212,19 +214,35 @@ void SYCLFuncRegistry::declareAccessorFuncDescriptors(
212
214
MLIRContext *context = module.getContext ();
213
215
auto voidTy = LLVM::LLVMVoidType::get (context);
214
216
auto i32Ty = IntegerType::get (context, 32 );
215
- auto i32PtrTy = LLVM::LLVMPointerType::get (i32Ty);
216
- Type accessorInt1ReadWriteGlobalBufferPtrTy =
217
- converter.convertType (MemRefType::get (
218
- -1 , AccessorType::get (context, i32Ty, 1 , MemoryAccessMode::ReadWrite,
219
- MemoryTargetMode::GlobalBuffer, {})));
220
- Type id1Ty = converter.convertType (IDType::get (context, 1 ));
221
- Type range1Ty = converter.convertType (RangeType::get (context, 1 ));
217
+ auto i32PtrTy = converter.convertType (MemRefType::get (-1 , i32Ty));
218
+
219
+ constexpr unsigned int dim = 1 ;
220
+ Type id1SYCLTy = IDType::get (context, dim);
221
+ Type range1SYCLTy = RangeType::get (context, dim);
222
+ Type accessorImplDeviceSYCLTy = AccessorImplDeviceType::get (
223
+ context, dim, {id1SYCLTy, range1SYCLTy, range1SYCLTy});
224
+ Type accessorInt1ReadWriteGlobalBufferSYCLTy = AccessorType::get (
225
+ context, i32Ty, dim, MemoryAccessMode::ReadWrite,
226
+ MemoryTargetMode::GlobalBuffer, {accessorImplDeviceSYCLTy});
227
+ Type accessorInt1ReadWriteGlobalBufferPtrTy = converter.convertType (
228
+ MemRefType::get (-1 , accessorInt1ReadWriteGlobalBufferSYCLTy));
229
+
230
+ Type id1Ty = converter.convertType (id1SYCLTy);
231
+ Type range1Ty = converter.convertType (range1SYCLTy);
222
232
223
233
// Construct the SYCL functions descriptors for the sycl::accessor<n> type.
224
234
// Descriptor format: (enum, function name, signature).
225
235
// clang-format off
226
236
std::vector<SYCLFuncDescriptor> descriptors = {
227
237
// sycl::accessor<int, 1, read_write, global_buffer, (placeholder)0>::
238
+ // accessor()
239
+ SYCLAccessorFuncDescriptor (
240
+ FuncId::AccessorInt1ReadWriteGlobalBufferFalseCtorDefault,
241
+ " _ZN2cl4sycl8accessorIiLi1ELNS0_6access4modeE1026ELNS2_"
242
+ " 6targetE2014ELNS2_11placeholderE0ENS0_3ext6oneapi22accessor_"
243
+ " property_listIJEEEEC2Ev" ,
244
+ voidTy, {accessorInt1ReadWriteGlobalBufferPtrTy}),
245
+ // sycl::accessor<int, 1, read_write, global_buffer, (placeholder)0>::
228
246
// __init(int AS1*, sycl::range<1>, sycl::range<1>, sycl::id<1>)
229
247
SYCLAccessorFuncDescriptor (
230
248
FuncId::AccessorInt1ReadWriteGlobalBufferFalseInit,
0 commit comments