Skip to content

Commit 88c7f8f

Browse files
author
Petr Vesely
committed
[UR] Remove parameter names
1 parent 747613b commit 88c7f8f

File tree

8 files changed

+22
-36
lines changed

8 files changed

+22
-36
lines changed

examples/collector/collector.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,9 @@ static std::unordered_map<
8282
* On begin, it prints the function declaration with the call arguments specified,
8383
* and on end it prints the function name with the result of the call.
8484
*/
85-
XPTI_CALLBACK_API void
86-
trace_cb(uint16_t trace_type, [[maybe_unused]] xpti::trace_event_data_t *parent,
87-
[[maybe_unused]] xpti::trace_event_data_t *event, uint64_t instance,
88-
const void *user_data) {
85+
XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *,
86+
xpti::trace_event_data_t *, uint64_t instance,
87+
const void *user_data) {
8988
auto *args = static_cast<const xpti::function_with_args_t *>(user_data);
9089
std::ostringstream out;
9190
if (trace_type == TRACE_FN_BEGIN) {
@@ -119,8 +118,7 @@ trace_cb(uint16_t trace_type, [[maybe_unused]] xpti::trace_event_data_t *parent,
119118
* selected trace types.
120119
*/
121120
XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
122-
unsigned int minor_version,
123-
[[maybe_unused]] const char *version_str,
121+
unsigned int minor_version, const char *,
124122
const char *stream_name) {
125123
if (stream_name == nullptr) {
126124
std::cout << "Stream name not provided. Aborting." << std::endl;
@@ -158,6 +156,5 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
158156
*
159157
* Can be used to cleanup state or resources.
160158
*/
161-
XPTI_CALLBACK_API void
162-
xptiTraceFinish([[maybe_unused]] const char *stream_name) { /* noop */
159+
XPTI_CALLBACK_API void xptiTraceFinish(const char *) { /* noop */
163160
}

examples/hello_world/hello_world.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "ur_api.h"
1616

1717
//////////////////////////////////////////////////////////////////////////
18-
int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) {
18+
int main(int, char *[]) {
1919
ur_result_t status;
2020

2121
// Initialize the platform

source/adapters/null/ur_null.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ context_t::context_t() {
3939
};
4040
//////////////////////////////////////////////////////////////////////////
4141
urDdiTable.Platform.pfnGet =
42-
[]([[maybe_unused]] ur_adapter_handle_t *phAdapters,
43-
[[maybe_unused]] uint32_t NumAdapters, uint32_t NumEntries,
42+
[](ur_adapter_handle_t *, uint32_t, uint32_t NumEntries,
4443
ur_platform_handle_t *phPlatforms, uint32_t *pNumPlatforms) {
4544
if (phPlatforms != nullptr && NumEntries != 1) {
4645
return UR_RESULT_ERROR_INVALID_SIZE;
@@ -122,9 +121,8 @@ context_t::context_t() {
122121

123122
//////////////////////////////////////////////////////////////////////////
124123
urDdiTable.Device.pfnGetInfo =
125-
[]([[maybe_unused]] ur_device_handle_t hDevice,
126-
ur_device_info_t infoType, size_t propSize, void *pDeviceInfo,
127-
size_t *pPropSizeRet) {
124+
[](ur_device_handle_t, ur_device_info_t infoType, size_t propSize,
125+
void *pDeviceInfo, size_t *pPropSizeRet) {
128126
switch (infoType) {
129127
case UR_DEVICE_INFO_TYPE:
130128
if (pDeviceInfo && propSize != sizeof(ur_device_type_t)) {

source/common/unified_malloc_framework/src/memory_tracker_windows.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@
1212
#include "memory_tracker.h"
1313

1414
#include <windows.h>
15-
1615
#if defined(UMF_SHARED_LIBRARY)
1716
critnib *TRACKER = NULL;
18-
BOOL APIENTRY DllMain([[maybe_unused]] HINSTANCE hinstDLL, DWORD fdwReason,
19-
LPVOID lpvReserved) {
17+
BOOL APIENTRY DllMain(HINSTANCE, DWORD fdwReason, LPVOID lpvReserved) {
2018
if (fdwReason == DLL_PROCESS_DETACH) {
2119
critnib_delete(TRACKER);
2220
} else if (fdwReason == DLL_PROCESS_ATTACH) {

source/loader/ur_lib.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,8 @@ void context_t::tearDownLayers() const {
6969
}
7070

7171
//////////////////////////////////////////////////////////////////////////
72-
__urdlllocal ur_result_t
73-
context_t::Init([[maybe_unused]] ur_device_init_flags_t device_flags,
74-
ur_loader_config_handle_t hLoaderConfig) {
72+
__urdlllocal ur_result_t context_t::Init(
73+
ur_device_init_flags_t, ur_loader_config_handle_t hLoaderConfig) {
7574
ur_result_t result;
7675
const char *logger_name = "loader";
7776
logger::init(logger_name);

test/conformance/event/urEventSetCallback.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ UUR_INSTANTIATE_DEVICE_TEST_SUITE_P(urEventSetCallbackTest);
167167
/* Negative tests */
168168
using urEventSetCallbackNegativeTest = uur::event::urEventTest;
169169

170-
void emptyCallback([[maybe_unused]] ur_event_handle_t hEvent,
171-
[[maybe_unused]] ur_execution_info_t execStatus,
172-
[[maybe_unused]] void *pUserData) {}
170+
void emptyCallback(ur_event_handle_t, ur_execution_info_t, void *) {}
173171

174172
TEST_P(urEventSetCallbackNegativeTest, InvalidNullHandleEvent) {
175173
ASSERT_EQ_RESULT(

test/unified_malloc_framework/memoryPoolAPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ TEST_F(test, getLastFailedMemoryProvider) {
233233
return allocResult;
234234
}
235235

236-
enum umf_result_t free(void *ptr, size_t size) noexcept {
237-
(void)size;
236+
enum umf_result_t free(void *ptr,
237+
[[maybe_unused]] size_t size) noexcept {
238238
::free(ptr);
239239
return UMF_RESULT_SUCCESS;
240240
}

tools/urtrace/collector.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,10 @@ class JsonWriter : public TraceWriter {
245245
"\"tid\": \"\", \"ts\": \"\"}}");
246246
out.info("]\n}}");
247247
}
248-
void begin([[maybe_unused]] uint64_t id, [[maybe_unused]] const char *fname,
249-
[[maybe_unused]] std::string args) override {}
248+
void begin(uint64_t, const char *, std::string) override {}
250249

251-
void end([[maybe_unused]] uint64_t id, const char *fname, std::string args,
252-
Timepoint tp, Timepoint start_tp,
253-
[[maybe_unused]] const ur_result_t *resultp) override {
250+
void end(uint64_t, const char *fname, std::string args, Timepoint tp,
251+
Timepoint start_tp, const ur_result_t *) override {
254252
auto dur = tp - start_tp;
255253
auto ts_us = std::chrono::duration_cast<std::chrono::microseconds>(
256254
tp.time_since_epoch())
@@ -316,10 +314,9 @@ std::optional<fn_context> pop_instance_data(uint64_t instance) {
316314
return data;
317315
}
318316

319-
XPTI_CALLBACK_API void
320-
trace_cb(uint16_t trace_type, [[maybe_unused]] xpti::trace_event_data_t *parent,
321-
[[maybe_unused]] xpti::trace_event_data_t *event, uint64_t instance,
322-
const void *user_data) {
317+
XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *,
318+
xpti::trace_event_data_t *, uint64_t instance,
319+
const void *user_data) {
323320
// stop the the clock as the very first thing, only used for TRACE_FN_END
324321
auto time_for_end = Clock::now();
325322
auto *args = static_cast<const xpti::function_with_args_t *>(user_data);
@@ -368,8 +365,7 @@ trace_cb(uint16_t trace_type, [[maybe_unused]] xpti::trace_event_data_t *parent,
368365
* Called for every stream.
369366
*/
370367
XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version,
371-
unsigned int minor_version,
372-
[[maybe_unused]] const char *version_str,
368+
unsigned int minor_version, const char *,
373369
const char *stream_name) {
374370
if (stream_name == nullptr) {
375371
out.debug("Found stream with null name. Skipping...");

0 commit comments

Comments
 (0)