Skip to content

Commit fd636ef

Browse files
[SYCL] Non-standard RT namespace removed (#7133) (#9972)
Continuation of previous partial removal (#9837)
1 parent 79ea9b7 commit fd636ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+919
-774
lines changed

sycl/include/sycl/detail/backend_traits_opencl.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,10 @@ namespace pi {
162162
// Cast for std::vector<cl_event>, according to the spec, make_event
163163
// should create one(?) event from a vector of cl_event
164164
template <class To> inline To cast(std::vector<cl_event> value) {
165-
RT::assertion(value.size() == 1,
166-
"Temporary workaround requires that the "
167-
"size of the input vector for make_event be equal to one.");
165+
sycl::detail::pi::assertion(
166+
value.size() == 1,
167+
"Temporary workaround requires that the "
168+
"size of the input vector for make_event be equal to one.");
168169
return cast<To>(value[0]);
169170
}
170171

sycl/include/sycl/detail/cg.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ class CGExecKernel : public CG {
167167
std::string MKernelName;
168168
std::vector<std::shared_ptr<detail::stream_impl>> MStreams;
169169
std::vector<std::shared_ptr<const void>> MAuxiliaryResources;
170-
RT::PiKernelCacheConfig MKernelCacheConfig;
170+
sycl::detail::pi::PiKernelCacheConfig MKernelCacheConfig;
171171

172172
CGExecKernel(NDRDescT NDRDesc, std::shared_ptr<HostKernelBase> HKernel,
173173
std::shared_ptr<detail::kernel_impl> SyclKernel,
@@ -176,7 +176,8 @@ class CGExecKernel : public CG {
176176
std::string KernelName,
177177
std::vector<std::shared_ptr<detail::stream_impl>> Streams,
178178
std::vector<std::shared_ptr<const void>> AuxiliaryResources,
179-
CGTYPE Type, RT::PiKernelCacheConfig KernelCacheConfig,
179+
CGTYPE Type,
180+
sycl::detail::pi::PiKernelCacheConfig KernelCacheConfig,
180181
detail::code_location loc = {})
181182
: CG(Type, std::move(CGData), std::move(loc)),
182183
MNDRDesc(std::move(NDRDesc)), MHostKernel(std::move(HKernel)),

sycl/include/sycl/detail/helpers.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ namespace detail {
4040
class context_impl;
4141
// The function returns list of events that can be passed to OpenCL API as
4242
// dependency list and waits for others.
43-
__SYCL_EXPORT std::vector<RT::PiEvent>
43+
__SYCL_EXPORT std::vector<sycl::detail::pi::PiEvent>
4444
getOrWaitEvents(std::vector<sycl::event> DepEvents,
4545
std::shared_ptr<sycl::detail::context_impl> Context);
4646

sycl/include/sycl/detail/pi.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,6 @@ PiDeviceBinaryType getBinaryImageFormat(const unsigned char *ImgData,
241241

242242
} // namespace pi
243243

244-
namespace RT = sycl::detail::pi;
245-
246244
// Workaround for build with GCC 5.x
247245
// An explicit specialization shall be declared in the namespace block.
248246
// Having namespace as part of template name is not supported by GCC
@@ -253,7 +251,8 @@ namespace pi {
253251
// operators.
254252
template <class To, class From> inline To cast(From value) {
255253
// TODO: see if more sanity checks are possible.
256-
RT::assertion((sizeof(From) == sizeof(To)), "assert: cast failed size check");
254+
sycl::detail::pi::assertion((sizeof(From) == sizeof(To)),
255+
"assert: cast failed size check");
257256
return (To)(value);
258257
}
259258

sycl/source/backend.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ __SYCL_EXPORT queue make_queue(pi_native_handle NativeHandle,
104104
const device *Device, bool KeepOwnership,
105105
const property_list &PropList,
106106
const async_handler &Handler, backend Backend) {
107-
RT::PiDevice PiDevice =
107+
sycl::detail::pi::PiDevice PiDevice =
108108
Device ? getSyclObjImpl(*Device)->getHandleRef() : nullptr;
109109
const auto &Plugin = getPlugin(Backend);
110110
const auto &ContextImpl = getSyclObjImpl(Context);
111111

112112
// Create PI properties from SYCL properties.
113-
RT::PiQueueProperties Properties[] = {
113+
sycl::detail::pi::PiQueueProperties Properties[] = {
114114
PI_QUEUE_FLAGS,
115115
queue_impl::createPiQueueProperties(
116116
PropList, PropList.has_property<property::queue::in_order>()

sycl/source/backend/opencl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ __SYCL_EXPORT bool has_extension(const sycl::platform &SyclPlatform,
6161

6262
std::shared_ptr<sycl::detail::platform_impl> PlatformImpl =
6363
getSyclObjImpl(SyclPlatform);
64-
detail::RT::PiPlatform PluginPlatform = PlatformImpl->getHandleRef();
64+
sycl::detail::pi::PiPlatform PluginPlatform = PlatformImpl->getHandleRef();
6565
const PluginPtr &Plugin = PlatformImpl->getPlugin();
6666

6767
// Manual invocation of plugin API to avoid using deprecated
@@ -92,7 +92,7 @@ __SYCL_EXPORT bool has_extension(const sycl::device &SyclDevice,
9292

9393
std::shared_ptr<sycl::detail::device_impl> DeviceImpl =
9494
getSyclObjImpl(SyclDevice);
95-
detail::RT::PiDevice PluginDevice = DeviceImpl->getHandleRef();
95+
sycl::detail::pi::PiDevice PluginDevice = DeviceImpl->getHandleRef();
9696
const PluginPtr &Plugin = DeviceImpl->getPlugin();
9797

9898
// Manual invocation of plugin API to avoid using deprecated

sycl/source/context.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ context::context(const std::vector<device> &DeviceList,
8787
context::context(cl_context ClContext, async_handler AsyncHandler) {
8888
const auto &Plugin = sycl::detail::pi::getPlugin<backend::opencl>();
8989
impl = std::make_shared<detail::context_impl>(
90-
detail::pi::cast<detail::RT::PiContext>(ClContext), AsyncHandler, Plugin);
90+
detail::pi::cast<sycl::detail::pi::PiContext>(ClContext), AsyncHandler,
91+
Plugin);
9192
}
9293

9394
template <typename Param>

sycl/source/detail/allowlist.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ bool deviceIsAllowed(const DeviceDescT &DeviceDesc,
334334
return ShouldDeviceBeAllowed;
335335
}
336336

337-
void applyAllowList(std::vector<RT::PiDevice> &PiDevices,
338-
RT::PiPlatform PiPlatform, const PluginPtr &Plugin) {
337+
void applyAllowList(std::vector<sycl::detail::pi::PiDevice> &PiDevices,
338+
sycl::detail::pi::PiPlatform PiPlatform,
339+
const PluginPtr &Plugin) {
339340

340341
AllowListParsedT AllowListParsed =
341342
parseAllowList(SYCLConfig<SYCL_DEVICE_ALLOWLIST>::get());
@@ -363,13 +364,13 @@ void applyAllowList(std::vector<RT::PiDevice> &PiDevices,
363364
PiPlatform, Plugin));
364365

365366
int InsertIDx = 0;
366-
for (RT::PiDevice Device : PiDevices) {
367+
for (sycl::detail::pi::PiDevice Device : PiDevices) {
367368
auto DeviceImpl = PlatformImpl->getOrMakeDeviceImpl(Device, PlatformImpl);
368369
// get DeviceType value and put it to DeviceDesc
369-
RT::PiDeviceType PiDevType;
370-
Plugin->call<PiApiKind::piDeviceGetInfo>(Device, PI_DEVICE_INFO_TYPE,
371-
sizeof(RT::PiDeviceType),
372-
&PiDevType, nullptr);
370+
sycl::detail::pi::PiDeviceType PiDevType;
371+
Plugin->call<PiApiKind::piDeviceGetInfo>(
372+
Device, PI_DEVICE_INFO_TYPE, sizeof(sycl::detail::pi::PiDeviceType),
373+
&PiDevType, nullptr);
373374
sycl::info::device_type DeviceType = pi::cast<info::device_type>(PiDevType);
374375
for (const auto &SyclDeviceType : getSyclDeviceTypeMap()) {
375376
if (SyclDeviceType.second == DeviceType) {

sycl/source/detail/allowlist.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@ AllowListParsedT parseAllowList(const std::string &AllowListRaw);
2727
bool deviceIsAllowed(const DeviceDescT &DeviceDesc,
2828
const AllowListParsedT &AllowListParsed);
2929

30-
void applyAllowList(std::vector<RT::PiDevice> &PiDevices,
31-
RT::PiPlatform PiPlatform, const PluginPtr &Plugin);
30+
void applyAllowList(std::vector<sycl::detail::pi::PiDevice> &PiDevices,
31+
sycl::detail::pi::PiPlatform PiPlatform,
32+
const PluginPtr &Plugin);
3233

3334
} // namespace detail
3435
} // __SYCL_INLINE_VER_NAMESPACE(_V1)

sycl/source/detail/buffer_impl.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ namespace detail {
2020
uint8_t GBufferStreamID;
2121
#endif
2222
void *buffer_impl::allocateMem(ContextImplPtr Context, bool InitFromUserData,
23-
void *HostPtr, RT::PiEvent &OutEventToWait) {
23+
void *HostPtr,
24+
sycl::detail::pi::PiEvent &OutEventToWait) {
2425
bool HostPtrReadOnly = false;
2526
BaseT::determineHostPtr(Context, InitFromUserData, HostPtr, HostPtrReadOnly);
2627

@@ -52,7 +53,7 @@ void buffer_impl::addInteropObject(
5253
Handles.end()) {
5354
const PluginPtr &Plugin = getPlugin();
5455
Plugin->call<PiApiKind::piMemRetain>(
55-
pi::cast<RT::PiMem>(MInteropMemObject));
56+
pi::cast<sycl::detail::pi::PiMem>(MInteropMemObject));
5657
Handles.push_back(pi::cast<pi_native_handle>(MInteropMemObject));
5758
}
5859
}
@@ -67,7 +68,8 @@ buffer_impl::getNativeVector(backend BackendName) const {
6768
}
6869

6970
for (auto &Cmd : MRecord->MAllocaCommands) {
70-
RT::PiMem NativeMem = pi::cast<RT::PiMem>(Cmd->getMemAllocation());
71+
sycl::detail::pi::PiMem NativeMem =
72+
pi::cast<sycl::detail::pi::PiMem>(Cmd->getMemAllocation());
7173
auto Ctx = Cmd->getWorkerContext();
7274
auto Platform = Ctx->getPlatformImpl();
7375
// If Host Shared Memory is not supported then there is alloca for host that

0 commit comments

Comments
 (0)