Skip to content

Commit 0cbc130

Browse files
committed
Fix Jenkins issue
1 parent 88dc093 commit 0cbc130

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

sycl/source/detail/kernel_impl.cpp

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ kernel_impl::kernel_impl(Managed<ur_kernel_handle_t> &&Kernel,
2727
MKernelBundleImpl(KernelBundleImpl ? KernelBundleImpl->shared_from_this()
2828
: nullptr),
2929
MIsInterop(true), MKernelArgMaskPtr{ArgMask},
30-
MInteropDeviceKernelInfoHolder(CompileTimeKernelInfoTy{getName()}),
31-
MDeviceKernelInfo(MInteropDeviceKernelInfoHolder) {
30+
MInteropDeviceKernelInfo(CompileTimeKernelInfoTy{getName()}) {
3231
ur_context_handle_t UrContext = nullptr;
3332
// Using the adapter from the passed ContextImpl
3433
getAdapter().call<UrApiKind::urKernelGetInfo>(
@@ -55,14 +54,8 @@ kernel_impl::kernel_impl(Managed<ur_kernel_handle_t> &&Kernel,
5554
MKernelBundleImpl(KernelBundleImpl.shared_from_this()),
5655
MIsInterop(MDeviceImageImpl->getOriginMask() & ImageOriginInterop),
5756
MKernelArgMaskPtr{ArgMask}, MCacheMutex{CacheMutex},
58-
MInteropDeviceKernelInfoHolder(MIsInterop
59-
? CompileTimeKernelInfoTy{getName()}
60-
: CompileTimeKernelInfoTy{}),
61-
MDeviceKernelInfo(
62-
MIsInterop
63-
? MInteropDeviceKernelInfoHolder
64-
: ProgramManager::getInstance().getOrCreateDeviceKernelInfo(
65-
KernelNameStrT(getName()))) {
57+
MInteropDeviceKernelInfo(MIsInterop ? CompileTimeKernelInfoTy{getName()}
58+
: CompileTimeKernelInfoTy{}) {
6659
// Enable USM indirect access for interop and non-sycl-jit source kernels.
6760
// sycl-jit kernels will enable this if needed through the regular kernel
6861
// path.

sycl/source/detail/kernel_impl.hpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ class kernel_impl {
238238
std::mutex *getCacheMutex() const { return MCacheMutex; }
239239
std::string_view getName() const;
240240

241-
DeviceKernelInfo &getDeviceKernelInfo() const { return MDeviceKernelInfo; }
241+
DeviceKernelInfo &getDeviceKernelInfo() {
242+
return MIsInterop
243+
? MInteropDeviceKernelInfo
244+
: ProgramManager::getInstance().getOrCreateDeviceKernelInfo(
245+
KernelNameStrT(getName()));
246+
}
242247

243248
private:
244249
Managed<ur_kernel_handle_t> MKernel;
@@ -253,11 +258,9 @@ class kernel_impl {
253258
std::mutex *MCacheMutex = nullptr;
254259
mutable std::string MName;
255260

256-
// For the interop kernel we create the DeviceKernelInfo
257-
// as part of the kernel_impl.
261+
// It is used for the interop kernels only.
258262
// For regular kernel we get DeviceKernelInfo from the ProgramManager.
259-
DeviceKernelInfo MInteropDeviceKernelInfoHolder;
260-
DeviceKernelInfo &MDeviceKernelInfo;
263+
DeviceKernelInfo MInteropDeviceKernelInfo;
261264

262265
bool isBuiltInKernel(device_impl &Device) const;
263266
void checkIfValidForNumArgsInfoQuery() const;

0 commit comments

Comments
 (0)