Skip to content

Commit 8e7ec0f

Browse files
[NFCI][SYCL] Minor code cleanup (#17647)
1 parent 42990a6 commit 8e7ec0f

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

sycl/include/sycl/detail/cg_types.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,7 @@ class HostKernelBase {
164164
// Class which stores specific lambda object.
165165
template <class KernelType, class KernelArgType, int Dims>
166166
class HostKernel : public HostKernelBase {
167-
using IDBuilder = sycl::detail::Builder;
168167
KernelType MKernel;
169-
// Allowing accessing MKernel from 'ResetHostKernelHelper' method of
170-
// 'sycl::handler'
171-
friend class sycl::handler;
172168

173169
public:
174170
HostKernel(KernelType Kernel) : MKernel(Kernel) {}
@@ -182,6 +178,7 @@ class HostKernel : public HostKernelBase {
182178
// kernel code instructions with source code lines.
183179
// NOTE: InstatiateKernelOnHost() should not be called.
184180
void InstantiateKernelOnHost() override {
181+
using IDBuilder = sycl::detail::Builder;
185182
if constexpr (std::is_same_v<KernelArgType, void>) {
186183
runKernelWithoutArg(MKernel);
187184
} else if constexpr (std::is_same_v<KernelArgType, sycl::id<Dims>>) {

sycl/include/sycl/handler.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ class __SYCL_EXPORT handler {
753753
#endif
754754
// Empty name indicates that the compilation happens without integration
755755
// header, so don't perform things that require it.
756-
if (KernelHasName) {
756+
if constexpr (KernelHasName) {
757757
// TODO support ESIMD in no-integration-header case too.
758758
clearArgs();
759759
extractArgsAndReqsFromLambda(MHostKernel->getPtr(),
@@ -770,7 +770,7 @@ class __SYCL_EXPORT handler {
770770

771771
// If the kernel lambda is callable with a kernel_handler argument, manifest
772772
// the associated kernel handler.
773-
if (IsCallableWithKernelHandler) {
773+
if constexpr (IsCallableWithKernelHandler) {
774774
getOrInsertHandlerKernelBundle(/*Insert=*/true);
775775
}
776776
}

0 commit comments

Comments
 (0)