Skip to content

Commit 7cc25c4

Browse files
committed
Clarifications in comments and some formatting changes.
Signed-off-by: Garima Gupta <[email protected]>
1 parent 600096c commit 7cc25c4

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

sycl/include/CL/sycl/detail/pi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ struct _pi_plugin {
926926
// Some choices are:
927927
// - Use of integers to keep major and minor version.
928928
// - Keeping char* Versions.
929-
const char PiVersion[4] = _PI_H_VERSION_STRING;
929+
const char PiVersion[4] = _PI_H_VERSION_STRING;
930930
// Plugin edits this.
931931
char PluginVersion[4] = _PI_H_VERSION_STRING;
932932
char *Targets;

sycl/include/CL/sycl/detail/pi.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ inline void checkPiResult(PiResult pi_result) {
129129
// Template Arguments:
130130
// FnType - Type of Function pointer to the PI API.
131131
// FnOffset- Offset to the Function Pointer in the piPlugin::FunctionPointers
132-
// structure.Used to differentiate between APIs with same pointer type, Eg:
132+
// structure. Used to differentiate between APIs with same pointer type, Eg:
133133
// piDeviceRelease and piDeviceRetain. Differentiation needed to avoid
134-
// duplicate instantiation of class in pi.cpp.
134+
// redefinition error during explicit specialization of class in pi.cpp.
135135
// Members: Initialiaed in default constructor in Class Template Specialization.
136136
// Usage:
137137
// Operator() - Call, Trace and Get result
@@ -203,7 +203,8 @@ namespace RT = cl::sycl::detail::pi;
203203
// runtime_error exception.
204204
// Usage: PI_CALL(pi)(Args);
205205
#define PI_CALL(pi) \
206-
RT::CallPiAndCheck<decltype(&::pi), (offsetof(pi_plugin::FunctionPointers, pi))>()
206+
RT::CallPiAndCheck<decltype(&::pi), \
207+
(offsetof(pi_plugin::FunctionPointers, pi))>()
207208

208209
// Use this macro to call the API, trace the call and return the result.
209210
// To check the result use checkPiResult.
@@ -218,8 +219,8 @@ namespace RT = cl::sycl::detail::pi;
218219
// Exception as given in the MACRO.
219220
// Usage: PI_CALL_THROW(pi, compile_program_error)(args);
220221
#define PI_CALL_THROW(pi, Exception) \
221-
RT::CallPiAndCheck<decltype(&::pi), (offsetof(pi_plugin::FunctionPointers, pi)), \
222-
Exception>()
222+
RT::CallPiAndCheck<decltype(&::pi), \
223+
(offsetof(pi_plugin::FunctionPointers, pi)), Exception>()
223224

224225
#define PI_ASSERT(cond, msg) RT::assertion((cond), "assert: " msg);
225226

sycl/source/detail/pi.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,10 @@ void assertion(bool Condition, const char *Message) {
140140
// implemented yet.
141141

142142
#define _PI_API(api) \
143-
template <> \
144-
CallPi<decltype(&::api), \
145-
(offsetof(pi_plugin::FunctionPointers, api))>::CallPi() { \
143+
template <> CallPi<decltype(&::api)>::CallPi() { \
146144
initialize(); \
147-
MFnPtr = (RT::PluginInformation.PiFunctionTable.api); \
148-
MFnName = #api; \
145+
MFnPtr = (RT::PluginInformation.PiFunctionTable.api); \
146+
MFnName = #api; \
149147
}
150148
#include <CL/sycl/detail/pi.def>
151149

sycl/unittests/pi/PlatformTest.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,10 @@ TEST_F(PlatformTest, piPlatformGetInfo) {
6969

7070
// Create a larger result string to catch overwrites.
7171
std::vector<char> param_value(reported_string_length * 2u, '\0');
72-
EXPECT_EQ((PI_CALL_NOCHECK(piPlatformGetInfo)(
73-
platform, info, param_value.size(), param_value.data(), nullptr)),
74-
PI_SUCCESS)
72+
EXPECT_EQ(
73+
(PI_CALL_NOCHECK(piPlatformGetInfo)(platform, info, param_value.size(),
74+
param_value.data(), nullptr)),
75+
PI_SUCCESS)
7576
<< "piPlatformGetInfo for " << RT::platformInfoToString(info)
7677
<< " failed.\n";
7778

0 commit comments

Comments
 (0)