Skip to content

Commit ac77ad8

Browse files
authored
[SYCL][NFC] plugin.hpp code cleanup (#15244)
Replace the name of OCL specific macro to reflect the move from OpenCL API to UR API.
1 parent 101307f commit ac77ad8

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

sycl/source/detail/device_impl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ device_impl::~device_impl() {
8080
// TODO catch an exception and put it to list of asynchronous exceptions
8181
const PluginPtr &Plugin = getPlugin();
8282
ur_result_t Err = Plugin->call_nocheck(urDeviceRelease, MDevice);
83-
__SYCL_CHECK_OCL_CODE_NO_EXC(Err);
83+
__SYCL_CHECK_UR_CODE_NO_EXC(Err);
8484
} catch (std::exception &e) {
8585
__SYCL_REPORT_EXCEPTION_TO_STREAM("exception in ~device_impl", e);
8686
}

sycl/source/detail/kernel_program_cache.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class KernelProgramCache {
103103
try {
104104
if (Val) {
105105
ur_result_t Err = Plugin->call_nocheck(urProgramRelease, Val);
106-
__SYCL_CHECK_OCL_CODE_NO_EXC(Err);
106+
__SYCL_CHECK_UR_CODE_NO_EXC(Err);
107107
}
108108
} catch (std::exception &e) {
109109
__SYCL_REPORT_EXCEPTION_TO_STREAM("exception in ~ProgramBuildResult",
@@ -141,7 +141,7 @@ class KernelProgramCache {
141141
try {
142142
if (Val.first) {
143143
ur_result_t Err = Plugin->call_nocheck(urKernelRelease, Val.first);
144-
__SYCL_CHECK_OCL_CODE_NO_EXC(Err);
144+
__SYCL_CHECK_UR_CODE_NO_EXC(Err);
145145
}
146146
} catch (std::exception &e) {
147147
__SYCL_REPORT_EXCEPTION_TO_STREAM("exception in ~KernelBuildResult", e);

sycl/source/detail/plugin.hpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//==------------------------- plugin.hpp - SYCL platform -------------------==//
1+
//==- plugin.hpp -----------------------------------------------------------==//
22
//
33
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
44
// See https://llvm.org/LICENSE.txt for license information.
@@ -7,24 +7,23 @@
77
//===----------------------------------------------------------------------===//
88

99
#pragma once
10+
1011
#include <detail/config.hpp>
11-
#include <memory>
12-
#include <mutex>
1312
#include <sycl/backend_types.hpp>
1413
#include <sycl/detail/common.hpp>
14+
#include <sycl/detail/iostream_proxy.hpp>
1515
#include <sycl/detail/type_traits.hpp>
1616
#include <sycl/detail/ur.hpp>
17-
1817
#include <ur_api.h>
19-
2018
#ifdef XPTI_ENABLE_INSTRUMENTATION
2119
// Include the headers necessary for emitting traces using the trace framework
2220
#include "xpti/xpti_trace_framework.h"
2321
#endif
2422

25-
#include <sycl/detail/iostream_proxy.hpp>
23+
#include <memory>
24+
#include <mutex>
2625

27-
#define __SYCL_REPORT_UR_ERR_TO_STREAM(expr) \
26+
#define __SYCL_CHECK_UR_CODE_NO_EXC(expr) \
2827
{ \
2928
auto code = expr; \
3029
if (code != UR_RESULT_SUCCESS) { \
@@ -33,8 +32,6 @@
3332
} \
3433
}
3534

36-
#define __SYCL_CHECK_OCL_CODE_NO_EXC(X) __SYCL_REPORT_UR_ERR_TO_STREAM(X)
37-
3835
namespace sycl {
3936
inline namespace _V1 {
4037
namespace detail {

sycl/source/detail/ur.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ std::vector<PluginPtr> &initializeUr(ur_loader_config_handle_t LoaderConfig) {
105105

106106
static void initializePlugins(std::vector<PluginPtr> &Plugins,
107107
ur_loader_config_handle_t LoaderConfig) {
108-
#define CHECK_UR_SUCCESS(Call) \
109-
__SYCL_CHECK_OCL_CODE_NO_EXC(Call)
108+
#define CHECK_UR_SUCCESS(Call) __SYCL_CHECK_UR_CODE_NO_EXC(Call)
110109

111110
bool OwnLoaderConfig = false;
112111
// If we weren't provided with a custom config handle create our own.

0 commit comments

Comments
 (0)