Skip to content

[SYCL] Non-standard RT namespace removed(#7133) #9837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions sycl/include/sycl/detail/pi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,6 @@ template <class To, class FromE> To cast(std::vector<FromE> Values) {
} // namespace pi
} // namespace detail

// For shortness of using PI from the top-level sycl files.
namespace RT = sycl::detail::pi;

} // __SYCL_INLINE_VER_NAMESPACE(_V1)
} // namespace sycl

Expand Down
2 changes: 1 addition & 1 deletion sycl/include/sycl/handler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3199,7 +3199,7 @@ class __SYCL_EXPORT handler {
}

// Set value of the gpu cache configuration for the kernel.
void setKernelCacheConfig(RT::PiKernelCacheConfig);
void setKernelCacheConfig(sycl::detail::pi::PiKernelCacheConfig);
};
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
} // namespace sycl
2 changes: 1 addition & 1 deletion sycl/source/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ context::context(const std::vector<device> &DeviceList,
}
}
context::context(cl_context ClContext, async_handler AsyncHandler) {
const auto &Plugin = RT::getPlugin<backend::opencl>();
const auto &Plugin = sycl::detail::pi::getPlugin<backend::opencl>();
impl = std::make_shared<detail::context_impl>(
detail::pi::cast<detail::RT::PiContext>(ClContext), AsyncHandler, Plugin);
}
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/detail/usm/usm_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ alloc get_pointer_type(const void *Ptr, const context &Ctxt) {

// query type using PI function
const detail::PluginPtr &Plugin = CtxImpl->getPlugin();
RT::PiResult Err =
sycl::detail::pi::PiResult Err =
Plugin->call_nocheck<detail::PiApiKind::piextUSMGetMemAllocInfo>(
PICtx, Ptr, PI_MEM_ALLOC_TYPE, sizeof(pi_usm_type), &AllocTy,
nullptr);
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ event::event() : impl(std::make_shared<detail::event_impl>(std::nullopt)) {}

event::event(cl_event ClEvent, const context &SyclContext)
: impl(std::make_shared<detail::event_impl>(
detail::pi::cast<RT::PiEvent>(ClEvent), SyclContext)) {
detail::pi::cast<sycl::detail::pi::PiEvent>(ClEvent), SyclContext)) {
// This is a special interop constructor for OpenCL, so the event must be
// retained.
impl->getPlugin()->call<detail::PiApiKind::piEventRetain>(
detail::pi::cast<RT::PiEvent>(ClEvent));
detail::pi::cast<sycl::detail::pi::PiEvent>(ClEvent));
}

bool event::operator==(const event &rhs) const { return rhs.impl == impl; }
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ event handler::finalize() {
// this faster path is used to submit kernel bypassing scheduler and
// avoiding CommandGroup, Command objects creation.

std::vector<RT::PiEvent> RawEvents;
std::vector<sycl::detail::pi::PiEvent> RawEvents;
detail::EventImplPtr NewEvent;
RT::PiEvent *OutEvent = nullptr;
sycl::detail::pi::PiEvent *OutEvent = nullptr;

auto EnqueueKernel = [&]() {
// 'Result' for single point of return
Expand Down
2 changes: 1 addition & 1 deletion sycl/source/queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ queue::queue(cl_command_queue clQueue, const context &SyclContext,
const async_handler &AsyncHandler) {
const property_list PropList{};
impl = std::make_shared<detail::queue_impl>(
reinterpret_cast<RT::PiQueue>(clQueue),
reinterpret_cast<sycl::detail::pi::PiQueue>(clQueue),
detail::getSyclObjImpl(SyclContext), AsyncHandler, PropList);
}

Expand Down
4 changes: 2 additions & 2 deletions sycl/unittests/kernel-and-program/KernelInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ static pi_result redefinedKernelGetInfo(pi_kernel kernel,
size_t *param_value_size_ret) {
EXPECT_EQ(param_name, PI_KERNEL_INFO_CONTEXT)
<< "Unexpected kernel info requested";
auto *Result = reinterpret_cast<RT::PiContext *>(param_value);
RT::PiContext PiCtx =
auto *Result = reinterpret_cast<sycl::detail::pi::PiContext *>(param_value);
sycl::detail::pi::PiContext PiCtx =
detail::getSyclObjImpl(TestContext->Ctx)->getHandleRef();
*Result = PiCtx;
return PI_SUCCESS;
Expand Down
4 changes: 2 additions & 2 deletions sycl/unittests/kernel-and-program/KernelRelease.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ static pi_result redefinedKernelGetInfo(pi_kernel kernel,
size_t *param_value_size_ret) {
EXPECT_EQ(param_name, PI_KERNEL_INFO_CONTEXT)
<< "Unexpected kernel info requested";
auto *Result = reinterpret_cast<RT::PiContext *>(param_value);
RT::PiContext PiCtx =
auto *Result = reinterpret_cast<sycl::detail::pi::PiContext *>(param_value);
sycl::detail::pi::PiContext PiCtx =
detail::getSyclObjImpl(TestContext->Ctx)->getHandleRef();
*Result = PiCtx;
return PI_SUCCESS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class PersistentDeviceCodeCache
/*PropertySetsEnd*/ nullptr};
pi_device_binary Bin = &BinStruct;
detail::RTDeviceBinaryImage Img{Bin};
RT::PiProgram NativeProg;
sycl::detail::pi::PiProgram NativeProg;
};

/* Checks that key values with \0 symbols are processed correctly
Expand Down
5 changes: 3 additions & 2 deletions sycl/unittests/scheduler/Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ pi_result redefinePiEnqueueEventsWaitWithBarrier(pi_queue Queue,
}

// Hack that allows to return a context in redefinePiEventGetInfo
RT::PiContext queue_global_context = nullptr;
sycl::detail::pi::PiContext queue_global_context = nullptr;

pi_result redefinePiEventGetInfo(pi_event, pi_event_info, size_t,
void *param_value, size_t *) {
*reinterpret_cast<RT::PiContext *>(param_value) = queue_global_context;
*reinterpret_cast<sycl::detail::pi::PiContext *>(param_value) =
queue_global_context;
return PI_SUCCESS;
}

Expand Down