Skip to content

Compilation warning when UMF is built as part of LLVM compiler #1252

@vinser52

Description

@vinser52

When UMF is built as part of intel/llvm compiler, there are several UMF-related warnings.

Environment Information

Please provide a reproduction of the bug:

git clone https://github.com/intel/llvm
cd llvm
mkdir build
cd build
python3 ../buildbot/configure.py --disable-jit --level_zero_adapter_version V2  -t RelWithDebInfo
python3 ../buildbot/compile.py

How often a bug is revealed:

always

Actual behavior:

There are following UMF-related warning:

[436/3740] Building C object _deps/unified-memory-framework-build/src/CMakeFiles/umf.dir/provider/provider_tracking.c.o
In file included from /user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:28:
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c: In function ‘umfMemoryTrackerRemove’:
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:261:15: warning: format ‘%p’ expects argument of type ‘void *’, but argument 6 has type ‘umf_memory_pool_handle_t’ {aka ‘struct umf_memory_pool_t *’} [-Wformat=
]
  261 |     LOG_DEBUG("memory region removed: tracker=%p, level=%i, pool=%p, ptr=%p, "
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  262 |               "size=%zu",
  263 |               (void *)hTracker, level, value->pool, ptr, value->size);
      |                                        ~~~~~~~~~~~
      |                                             |
      |                                             umf_memory_pool_handle_t {aka struct umf_memory_pool_t *}
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/utils/utils_log.h:25:55: note: in definition of macro ‘LOG_DEBUG’
   25 | #define LOG_DEBUG(...) utils_log(LOG_DEBUG, __func__, __VA_ARGS__);
      |                                                       ^~~~~~~~~~~
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:261:67: note: format string is defined here
  261 |     LOG_DEBUG("memory region removed: tracker=%p, level=%i, pool=%p, ptr=%p, "
      |                                                                  ~^
      |                                                                   |
      |                                                                   void *
In file included from /user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:28:
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c: In function ‘umfMemoryTrackerAddIpcSegment’:
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:303:19: warning: format ‘%p’ expects argument of type ‘void *’, but argument 7 has type ‘umf_memory_provider_handle_t’ {aka ‘struct umf_memory_provider_t *’} [-
Wformat=]
  303 |         LOG_DEBUG("IPC memory region is added, tracker=%p, ptr=%p, size=%zu, "
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  304 |                   "provider=%p, cache_entry=%p",
  305 |                   (void *)hTracker, ptr, size, provider, cache_entry);
      |                                                ~~~~~~~~
      |                                                |
      |                                                umf_memory_provider_handle_t {aka struct umf_memory_provider_t *}
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/utils/utils_log.h:25:55: note: in definition of macro ‘LOG_DEBUG’
   25 | #define LOG_DEBUG(...) utils_log(LOG_DEBUG, __func__, __VA_ARGS__);
      |                                                       ^~~~~~~~~~~
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:303:19: warning: format ‘%p’ expects argument of type ‘void *’, but argument 8 has type ‘ipc_opened_cache_value_t *’ [-Wformat=]
  303 |         LOG_DEBUG("IPC memory region is added, tracker=%p, ptr=%p, size=%zu, "
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  304 |                   "provider=%p, cache_entry=%p",                                                                                                                                                                                                        305 |                   (void *)hTracker, ptr, size, provider, cache_entry);
      |                                                          ~~~~~~~~~~~
      |                                                          |
      |                                                          ipc_opened_cache_value_t *
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/utils/utils_log.h:25:55: note: in definition of macro ‘LOG_DEBUG’
   25 | #define LOG_DEBUG(...) utils_log(LOG_DEBUG, __func__, __VA_ARGS__);                                                                                                                                                                                         |                                                       ^~~~~~~~~~~
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:309:13: warning: format ‘%p’ expects argument of type ‘void *’, but argument 7 has type ‘umf_memory_provider_handle_t’ {aka ‘struct umf_memory_provider_t *’} [-
Wformat=]
  309 |     LOG_ERR("failed to insert tracker_ipc_info_t, ret=%d, ptr=%p, size=%zu, "
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  310 |             "provider=%p, cache_entry=%p",
  311 |             ret, ptr, size, provider, cache_entry);
      |                             ~~~~~~~~
      |                             |
      |                             umf_memory_provider_handle_t {aka struct umf_memory_provider_t *}
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/utils/utils_log.h:28:53: note: in definition of macro ‘LOG_ERR’
   28 | #define LOG_ERR(...) utils_log(LOG_ERROR, __func__, __VA_ARGS__);
      |                                                     ^~~~~~~~~~~
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:309:13: warning: format ‘%p’ expects argument of type ‘void *’, but argument 8 has type ‘ipc_opened_cache_value_t *’ [-Wformat=]
  309 |     LOG_ERR("failed to insert tracker_ipc_info_t, ret=%d, ptr=%p, size=%zu, "
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  310 |             "provider=%p, cache_entry=%p",
  311 |             ret, ptr, size, provider, cache_entry);
      |                                       ~~~~~~~~~~~
      |                                       |
      |                                       ipc_opened_cache_value_t *
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/utils/utils_log.h:28:53: note: in definition of macro ‘LOG_ERR’
   28 | #define LOG_ERR(...) utils_log(LOG_ERROR, __func__, __VA_ARGS__);
      |                                                     ^~~~~~~~~~~
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c: In function ‘umfMemoryTrackerRemoveIpcSegment’:
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:336:15: warning: format ‘%p’ expects argument of type ‘void *’, but argument 7 has type ‘umf_memory_provider_handle_t’ {aka ‘struct umf_memory_provider_t *’} [-
Wformat=]
  336 |     LOG_DEBUG("IPC memory region removed: tracker=%p, ptr=%p, size=%zu, "
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  337 |               "provider=%p, cache_entry=%p",
  338 |               (void *)hTracker, ptr, v->size, v->provider, v->ipc_cache_value);
      |                                               ~~~~~~~~~~~
      |                                                |
      |                                                umf_memory_provider_handle_t {aka struct umf_memory_provider_t *}
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/utils/utils_log.h:25:55: note: in definition of macro ‘LOG_DEBUG’
   25 | #define LOG_DEBUG(...) utils_log(LOG_DEBUG, __func__, __VA_ARGS__);
      |                                                       ^~~~~~~~~~~
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/provider/provider_tracking.c:336:15: warning: format ‘%p’ expects argument of type ‘void *’, but argument 8 has type ‘ipc_opened_cache_value_t *’ [-Wformat=]
  336 |     LOG_DEBUG("IPC memory region removed: tracker=%p, ptr=%p, size=%zu, "
      |               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  337 |               "provider=%p, cache_entry=%p",
  338 |               (void *)hTracker, ptr, v->size, v->provider, v->ipc_cache_value);
      |                                                            ~~~~~~~~~~~~~~~~~~
      |                                                             |
      |                                                             ipc_opened_cache_value_t *
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/utils/utils_log.h:25:55: note: in definition of macro ‘LOG_DEBUG’
   25 | #define LOG_DEBUG(...) utils_log(LOG_DEBUG, __func__, __VA_ARGS__);
      |                                                       ^~~~~~~~~~~
[442/3740] Building C object _deps/unified-memory-framework-build/src/CMakeFiles/umf.dir/pool/pool_disjoint.c.o
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/pool/pool_disjoint.c: In function ‘umfDisjointPoolParamsCreate’:
/user/svinogra/llvm/build/_deps/unified-memory-framework-src/src/pool/pool_disjoint.c:968:33: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  968 |     static char *DEFAULT_NAME = "disjoint_pool";
      |                                 ^~~~~~~~~~~~~~~
[777/3740] Deploying component ur_adapter_opencl
-- Install configuration: "Debug"

Expected behavior:

No UMF warnings

Additional information about Priority and Help Requested:

Are you willing to submit a pull request with a proposed change? No

Requested priority: Low

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions