Skip to content

Commit

Permalink
[SYCL] Implement kernel name type to name mapping in the integration …
Browse files Browse the repository at this point in the history
…header

Signed-off-by: Vladimir Lazarev <vladimir.lazarev@intel.com>
  • Loading branch information
vladimirlaz committed Jan 22, 2019
1 parent f7d0f61 commit 5a3040d
Show file tree
Hide file tree
Showing 2 changed files with 240 additions and 98 deletions.
16 changes: 10 additions & 6 deletions clang/include/clang/Sema/Sema.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ class FileNullabilityMap {
// - SYCL kernel parameters and offsets of corresponding actual arguments
class SYCLIntegrationHeader {
public:
// Kind of kernel's lambda parameters as captured by the compiler in the
// kernel lambda object
// Kind of kernel's parameters as captured by the compiler in the
// kernel lambda or function object
enum kernel_param_kind_t {
kind_first,
kind_none = kind_first,
Expand All @@ -319,7 +319,7 @@ class SYCLIntegrationHeader {

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

/// Adds a kernel parameter descriptor to current kernel invocation
/// descriptor.
Expand All @@ -333,15 +333,15 @@ class SYCLIntegrationHeader {
// Kernel actual parameter descriptor.
struct KernelParamDesc {
// Represents a parameter kind.
kernel_param_kind_t Kind;
kernel_param_kind_t Kind = kind_none;
// If Kind is kind_scalar or kind_struct, then
// denotes parameter size in bytes (includes padding for structs)
// If Kind is kind_accessor
// denotes access target; possible access targets are defined in
// access/access.hpp
int Info;
int Info = 0;
// Offset of the captured parameter value in the lambda or function object.
unsigned Offset;
unsigned Offset = 0;

KernelParamDesc() = default;
};
Expand All @@ -350,6 +350,10 @@ class SYCLIntegrationHeader {
struct KernelDesc {
/// Kernel name.
std::string Name;

/// Kernel name type.
QualType NameType;

/// Descriptor of kernel actual parameters.
SmallVector<KernelParamDesc, 8> Params;

Expand Down
Loading

0 comments on commit 5a3040d

Please sign in to comment.