Skip to content

Commit 5a3040d

Browse files
committed
[SYCL] Implement kernel name type to name mapping in the integration header
Signed-off-by: Vladimir Lazarev <[email protected]>
1 parent f7d0f61 commit 5a3040d

File tree

2 files changed

+240
-98
lines changed

2 files changed

+240
-98
lines changed

clang/include/clang/Sema/Sema.h

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,8 @@ class FileNullabilityMap {
294294
// - SYCL kernel parameters and offsets of corresponding actual arguments
295295
class SYCLIntegrationHeader {
296296
public:
297-
// Kind of kernel's lambda parameters as captured by the compiler in the
298-
// kernel lambda object
297+
// Kind of kernel's parameters as captured by the compiler in the
298+
// kernel lambda or function object
299299
enum kernel_param_kind_t {
300300
kind_first,
301301
kind_none = kind_first,
@@ -319,7 +319,7 @@ class SYCLIntegrationHeader {
319319

320320
/// Signals that subsequent parameter descriptor additions will go to
321321
/// the kernel with given name. Starts new kernel invocation descriptor.
322-
void startKernel(StringRef KernelName);
322+
void startKernel(StringRef KernelName, QualType KernelNameType);
323323

324324
/// Adds a kernel parameter descriptor to current kernel invocation
325325
/// descriptor.
@@ -333,15 +333,15 @@ class SYCLIntegrationHeader {
333333
// Kernel actual parameter descriptor.
334334
struct KernelParamDesc {
335335
// Represents a parameter kind.
336-
kernel_param_kind_t Kind;
336+
kernel_param_kind_t Kind = kind_none;
337337
// If Kind is kind_scalar or kind_struct, then
338338
// denotes parameter size in bytes (includes padding for structs)
339339
// If Kind is kind_accessor
340340
// denotes access target; possible access targets are defined in
341341
// access/access.hpp
342-
int Info;
342+
int Info = 0;
343343
// Offset of the captured parameter value in the lambda or function object.
344-
unsigned Offset;
344+
unsigned Offset = 0;
345345

346346
KernelParamDesc() = default;
347347
};
@@ -350,6 +350,10 @@ class SYCLIntegrationHeader {
350350
struct KernelDesc {
351351
/// Kernel name.
352352
std::string Name;
353+
354+
/// Kernel name type.
355+
QualType NameType;
356+
353357
/// Descriptor of kernel actual parameters.
354358
SmallVector<KernelParamDesc, 8> Params;
355359

0 commit comments

Comments
 (0)