Skip to content

Commit 054ed1c

Browse files
authored
[SYCL][CUDA] Fix post merge errors from #9512 (#9872)
Resolves the warnings as errors reported in [post merge](https://github.com/intel/llvm/actions/runs/5266121277/jobs/9519634360) as a result of merging #9512. Additionally move pre-processor guards to resolve unused global variables which would also fail in this build configuration (clang & SYCL_ENABLE_WERROR=ON).
1 parent 447f598 commit 054ed1c

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

sycl/plugins/unified_runtime/ur/adapters/cuda/tracing.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,20 @@
1919
#include <exception>
2020
#include <iostream>
2121

22+
#ifdef XPTI_ENABLE_INSTRUMENTATION
2223
constexpr auto CUDA_CALL_STREAM_NAME = "sycl.experimental.cuda.call";
2324
constexpr auto CUDA_DEBUG_STREAM_NAME = "sycl.experimental.cuda.debug";
2425

2526
thread_local uint64_t CallCorrelationID = 0;
2627
thread_local uint64_t DebugCorrelationID = 0;
2728

28-
#ifdef XPTI_ENABLE_INSTRUMENTATION
2929
static xpti_td *GCallEvent = nullptr;
3030
static xpti_td *GDebugEvent = nullptr;
31-
#endif // XPTI_ENABLE_INSTRUMENTATION
3231

3332
constexpr auto GVerStr = "0.1";
3433
constexpr int GMajVer = 0;
3534
constexpr int GMinVer = 1;
3635

37-
#ifdef XPTI_ENABLE_INSTRUMENTATION
3836
static void cuptiCallback(void *, CUpti_CallbackDomain, CUpti_CallbackId CBID,
3937
const void *CBData) {
4038
if (xptiTraceEnabled()) {

sycl/plugins/unified_runtime/ur/adapters/cuda/usm.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919

2020
/// USM: Implements USM Host allocations using CUDA Pinned Memory
2121
/// https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#page-locked-host-memory
22-
UR_APIEXPORT ur_result_t UR_APICALL
23-
urUSMHostAlloc(ur_context_handle_t hContext, const ur_usm_desc_t *pUSMDesc,
24-
ur_usm_pool_handle_t pool, size_t size, void **ppMem) {
22+
UR_APIEXPORT ur_result_t UR_APICALL urUSMHostAlloc(
23+
ur_context_handle_t hContext, const ur_usm_desc_t *pUSMDesc,
24+
[[maybe_unused]] ur_usm_pool_handle_t pool, size_t size, void **ppMem) {
2525
UR_ASSERT(ppMem, UR_RESULT_ERROR_INVALID_NULL_POINTER);
2626
UR_ASSERT(hContext, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
2727

@@ -55,10 +55,10 @@ urUSMHostAlloc(ur_context_handle_t hContext, const ur_usm_desc_t *pUSMDesc,
5555

5656
/// USM: Implements USM device allocations using a normal CUDA device pointer
5757
///
58-
UR_APIEXPORT ur_result_t UR_APICALL
59-
urUSMDeviceAlloc(ur_context_handle_t hContext, ur_device_handle_t hDevice,
60-
const ur_usm_desc_t *pUSMDesc, ur_usm_pool_handle_t pool,
61-
size_t size, void **ppMem) {
58+
UR_APIEXPORT ur_result_t UR_APICALL urUSMDeviceAlloc(
59+
ur_context_handle_t hContext, ur_device_handle_t hDevice,
60+
const ur_usm_desc_t *pUSMDesc, [[maybe_unused]] ur_usm_pool_handle_t pool,
61+
size_t size, void **ppMem) {
6262
UR_ASSERT(ppMem, UR_RESULT_ERROR_INVALID_NULL_POINTER);
6363
UR_ASSERT(hContext, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
6464
UR_ASSERT(hDevice, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
@@ -92,10 +92,10 @@ urUSMDeviceAlloc(ur_context_handle_t hContext, ur_device_handle_t hDevice,
9292

9393
/// USM: Implements USM Shared allocations using CUDA Managed Memory
9494
///
95-
UR_APIEXPORT ur_result_t UR_APICALL
96-
urUSMSharedAlloc(ur_context_handle_t hContext, ur_device_handle_t hDevice,
97-
const ur_usm_desc_t *pUSMDesc, ur_usm_pool_handle_t pool,
98-
size_t size, void **ppMem) {
95+
UR_APIEXPORT ur_result_t UR_APICALL urUSMSharedAlloc(
96+
ur_context_handle_t hContext, ur_device_handle_t hDevice,
97+
const ur_usm_desc_t *pUSMDesc, [[maybe_unused]] ur_usm_pool_handle_t pool,
98+
size_t size, void **ppMem) {
9999
UR_ASSERT(ppMem, UR_RESULT_ERROR_INVALID_NULL_POINTER);
100100
UR_ASSERT(hContext, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
101101
UR_ASSERT(hDevice, UR_RESULT_ERROR_INVALID_NULL_HANDLE);

0 commit comments

Comments
 (0)