-
Notifications
You must be signed in to change notification settings - Fork 747
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'intel_llvm/sycl' into llvmspirv_pulldow…
…n_ww46-47
- Loading branch information
Showing
88 changed files
with
1,686 additions
and
200 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
clang/test/SemaSYCL/Inputs/CL/sycl/detail/defines_elementary.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
#ifndef __SYCL_DISABLE_NAMESPACE_INLINE__ | ||
#define __SYCL_INLINE_NAMESPACE(X) inline namespace X | ||
#else | ||
#define __SYCL_INLINE_NAMESPACE(X) namespace X | ||
#endif // __SYCL_DISABLE_NAMESPACE_INLINE__ | ||
#define __SYCL_DLL_LOCAL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#pragma once | ||
|
||
#include <CL/sycl/detail/defines_elementary.hpp> | ||
|
||
__SYCL_INLINE_NAMESPACE(cl) { | ||
namespace sycl { | ||
namespace detail { | ||
|
||
#ifndef __SYCL_DEVICE_ONLY__ | ||
#define _Bool bool | ||
#endif | ||
|
||
// kernel parameter kinds | ||
enum class kernel_param_kind_t { | ||
kind_accessor = 0, | ||
kind_std_layout = 1, // standard layout object parameters | ||
kind_sampler = 2, | ||
kind_pointer = 3, | ||
kind_specialization_constants_buffer = 4, | ||
kind_stream = 5, | ||
kind_invalid = 0xf, // not a valid kernel kind | ||
}; | ||
|
||
// describes a kernel parameter | ||
struct kernel_param_desc_t { | ||
// parameter kind | ||
kernel_param_kind_t kind; | ||
// kind == kind_std_layout | ||
// parameter size in bytes (includes padding for structs) | ||
// kind == kind_accessor | ||
// access target; possible access targets are defined in access/access.hpp | ||
int info; | ||
// offset of the captured value of the parameter in the lambda or function | ||
// object | ||
int offset; | ||
}; | ||
|
||
template <class KernelNameType> struct KernelInfo { | ||
static constexpr unsigned getNumParams() { return 0; } | ||
static const kernel_param_desc_t &getParamDesc(int) { | ||
static kernel_param_desc_t Dummy; | ||
return Dummy; | ||
} | ||
static constexpr const char *getName() { return ""; } | ||
static constexpr bool isESIMD() { return 0; } | ||
static constexpr bool callsThisItem() { return false; } | ||
static constexpr bool callsAnyThisFreeFunction() { return false; } | ||
}; | ||
} // namespace detail | ||
} // namespace sycl | ||
} // __SYCL_INLINE_NAMESPACE(cl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// RUN: %clang_cc1 -fsycl-is-device -internal-isystem %S/Inputs -fno-sycl-unnamed-lambda -fsyntax-only -sycl-std=2020 -fsycl-int-header=%t.h %s | ||
// RUN: %clang_cc1 -fsycl-is-host -internal-isystem %S/Inputs -fno-sycl-unnamed-lambda -fsyntax-only -verify -include %t.h %s | ||
|
||
// This test verifies that incorrect kernel names are diagnosed correctly. | ||
|
||
#include "sycl.hpp" | ||
|
||
using namespace cl::sycl; | ||
|
||
// user-defined function | ||
void function() { | ||
} | ||
|
||
// user-defined struct | ||
struct myWrapper { | ||
class insideStruct; | ||
}; | ||
|
||
template <typename KernelName> class RandomTemplate; | ||
|
||
int main() { | ||
queue q; | ||
|
||
q.submit([&](handler &h) { | ||
h.single_task<class Ok>([]() { function(); }); | ||
}); | ||
q.submit([&](handler &h) { | ||
h.single_task<RandomTemplate<class Ok>>([]() { function(); }); | ||
}); | ||
|
||
class NotOk; | ||
// expected-error@#KernelSingleTask {{'NotOk' is invalid; kernel name should be forward declarable at namespace scope}} | ||
// expected-note@+2 {{in instantiation of function template specialization}} | ||
q.submit([&](handler &h) { | ||
h.single_task<class NotOk>([]() { function(); }); | ||
}); | ||
// expected-error@#KernelSingleTask {{'myWrapper::insideStruct' is invalid; kernel name should be forward declarable at namespace scope}} | ||
// expected-note@+2 {{in instantiation of function template specialization}} | ||
q.submit([&](handler &h) { | ||
h.single_task<class myWrapper::insideStruct>([]() { function(); }); | ||
}); | ||
// expected-error@#KernelSingleTask {{'RandomTemplate<NotOk>' is invalid; kernel name should be forward declarable at namespace scope}} | ||
// expected-note@+2 {{in instantiation of function template specialization}} | ||
q.submit([&](handler &h) { | ||
h.single_task<RandomTemplate<NotOk>>([]() { function(); }); | ||
}); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.