Skip to content

Commit c39e794

Browse files
committed
Fix various build warnings
1 parent 2a50972 commit c39e794

File tree

9 files changed

+38
-23
lines changed

9 files changed

+38
-23
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ UR_APIEXPORT ur_result_t UR_APICALL
2222
urContextCreate(uint32_t DeviceCount, const ur_device_handle_t *phDevices,
2323
const ur_context_properties_t *pProperties,
2424
ur_context_handle_t *phContext) {
25+
std::ignore = DeviceCount;
26+
std::ignore = pProperties;
2527
UR_ASSERT(phDevices, UR_RESULT_ERROR_INVALID_NULL_POINTER);
2628
UR_ASSERT(phContext, UR_RESULT_ERROR_INVALID_NULL_POINTER);
2729

@@ -132,8 +134,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextCreateWithNativeHandle(
132134
const ur_device_handle_t *phDevices,
133135
const ur_context_native_properties_t *pProperties,
134136
ur_context_handle_t *phContext) {
135-
(void)hNativeContext;
136-
(void)phContext;
137+
std::ignore = hNativeContext;
138+
std::ignore = numDevices;
139+
std::ignore = phDevices;
140+
std::ignore = pProperties;
141+
std::ignore = phContext;
137142

138143
return UR_RESULT_ERROR_INVALID_OPERATION;
139144
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1098,6 +1098,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceCreateWithNativeHandle(
10981098
ur_native_handle_t hNativeDevice, ur_platform_handle_t hPlatform,
10991099
const ur_device_native_properties_t *pProperties,
11001100
ur_device_handle_t *phDevice) {
1101+
std::ignore = pProperties;
11011102
UR_ASSERT(phDevice, UR_RESULT_ERROR_INVALID_NULL_POINTER);
11021103

11031104
// We can't cast between ur_native_handle_t and CUdevice, so memcpy the bits

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

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemBufferReadRect(
561561
Result = commonEnqueueMemBufferCopyRect(
562562
CuStream, region, &DevPtr, CU_MEMORYTYPE_DEVICE, bufferOrigin,
563563
bufferRowPitch, bufferSlicePitch, pDst, CU_MEMORYTYPE_HOST, hostOrigin,
564-
hostRowPitch, bufferSlicePitch);
564+
hostRowPitch, hostSlicePitch);
565565

566566
if (phEvent) {
567567
Result = RetImplEvent->record();
@@ -905,8 +905,11 @@ static ur_result_t commonEnqueueMemImageNDCopy(
905905
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead(
906906
ur_queue_handle_t hQueue, ur_mem_handle_t hImage, bool blockingRead,
907907
ur_rect_offset_t origin, ur_rect_region_t region, size_t rowPitch,
908-
size_t phEventWaitListslicePitch, void *pDst, uint32_t numEventsInWaitList,
908+
size_t slicePitch, void *pDst, uint32_t numEventsInWaitList,
909909
const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) {
910+
std::ignore = rowPitch;
911+
std::ignore = slicePitch;
912+
910913
UR_ASSERT(hQueue, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
911914
UR_ASSERT(hImage, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
912915
UR_ASSERT(hImage->MemType == ur_mem_handle_t_::Type::Surface,
@@ -972,6 +975,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageWrite(
972975
ur_rect_offset_t origin, ur_rect_region_t region, size_t rowPitch,
973976
size_t slicePitch, void *pSrc, uint32_t numEventsInWaitList,
974977
const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) {
978+
std::ignore = blockingWrite;
979+
std::ignore = rowPitch;
980+
std::ignore = slicePitch;
981+
975982
UR_ASSERT(hQueue, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
976983
UR_ASSERT(hImage, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
977984
UR_ASSERT(hImage->MemType == ur_mem_handle_t_::Type::Surface,
@@ -1456,10 +1463,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size,
14561463
// TODO: Implement this. Remember to return true for
14571464
// PI_EXT_ONEAPI_CONTEXT_INFO_USM_FILL2D_SUPPORT when it is implemented.
14581465
UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFill2D(
1459-
ur_queue_handle_t hQueue, void *pMem, size_t pitch, size_t patternSize,
1460-
const void *pPattern, size_t width, size_t height,
1461-
uint32_t numEventsInWaitList, const ur_event_handle_t *phEventWaitList,
1462-
ur_event_handle_t *phEvent) {
1466+
ur_queue_handle_t, void *, size_t, size_t, const void *, size_t, size_t,
1467+
uint32_t, const ur_event_handle_t *, ur_event_handle_t *) {
14631468
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
14641469
}
14651470

@@ -1484,7 +1489,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMMemcpy2D(
14841489

14851490
// Determine the direction of copy using cuPointerGetAttribute
14861491
// for both the SrcPtr and DstPtr
1487-
CUDA_MEMCPY2D CpyDesc = {0};
1492+
CUDA_MEMCPY2D CpyDesc = {};
1493+
memset(&CpyDesc, 0, sizeof(CpyDesc));
14881494

14891495
getUSMHostOrDevicePtr(pSrc, &CpyDesc.srcMemoryType, &CpyDesc.srcDevice,
14901496
&CpyDesc.srcHost);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urKernelSetArgMemObj(
338338
UR_APIEXPORT ur_result_t UR_APICALL
339339
urKernelSetExecInfo(ur_kernel_handle_t hKernel, ur_kernel_exec_info_t propName,
340340
size_t propSize, const void *pPropValue) {
341+
std::ignore = propSize;
341342
UR_ASSERT(hKernel, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
342343
UR_ASSERT(pPropValue, UR_RESULT_ERROR_INVALID_NULL_POINTER);
343344
switch (propName) {

sycl/plugins/unified_runtime/ur/adapters/cuda/kernel.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,12 @@ struct ur_kernel_handle_t_ {
137137
urProgramRetain(Program);
138138
urContextRetain(Context);
139139
/// Note: this code assumes that there is only one device per context
140-
ur_result_t retError = urKernelGetGroupInfo(
140+
ur_result_t RetError = urKernelGetGroupInfo(
141141
this, Context->getDevice(),
142142
UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE,
143143
sizeof(ReqdThreadsPerBlock), ReqdThreadsPerBlock, nullptr);
144-
assert(retError == UR_RESULT_SUCCESS);
144+
(void)RetError;
145+
assert(RetError == UR_RESULT_SUCCESS);
145146
}
146147

147148
~ur_kernel_handle_t_() {

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -221,15 +221,15 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemGetInfo(ur_mem_handle_t hMemory,
221221
}
222222

223223
UR_APIEXPORT ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle(
224-
ur_native_handle_t hNativeMem, ur_context_handle_t hContext,
225-
const ur_mem_native_properties_t *pProperties, ur_mem_handle_t *phMem) {
224+
ur_native_handle_t, ur_context_handle_t, const ur_mem_native_properties_t *,
225+
ur_mem_handle_t *) {
226226
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
227227
}
228228

229229
UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreateWithNativeHandle(
230-
ur_native_handle_t hNativeMem, ur_context_handle_t hContext,
231-
const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc,
232-
const ur_mem_native_properties_t *pProperties, ur_mem_handle_t *phMem) {
230+
ur_native_handle_t, ur_context_handle_t, const ur_image_format_t *,
231+
const ur_image_desc_t *, const ur_mem_native_properties_t *,
232+
ur_mem_handle_t *) {
233233
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
234234
}
235235

@@ -425,9 +425,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate(
425425
}
426426

427427
/// \TODO Not implemented
428-
UR_APIEXPORT ur_result_t UR_APICALL
429-
urMemImageGetInfo(ur_mem_handle_t hMemory, ur_image_info_t ImgInfoType,
430-
size_t propSize, void *pImgInfo, size_t *pPropSizeRet) {
428+
UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t,
429+
ur_image_info_t, size_t,
430+
void *, size_t *) {
431431
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
432432
}
433433

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ urProgramCompile(ur_context_handle_t hContext, ur_program_handle_t hProgram,
197197
UR_APIEXPORT ur_result_t UR_APICALL urProgramBuild(ur_context_handle_t hContext,
198198
ur_program_handle_t hProgram,
199199
const char *pOptions) {
200+
std::ignore = hContext;
200201
UR_ASSERT(hProgram, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
201202

202203
ur_result_t Result = UR_RESULT_SUCCESS;
@@ -274,9 +275,8 @@ urProgramLink(ur_context_handle_t hContext, uint32_t count,
274275
///
275276
/// \return TBD
276277
UR_APIEXPORT ur_result_t UR_APICALL urProgramCreateWithNativeHandle(
277-
ur_native_handle_t hNativeProgram, ur_context_handle_t hContext,
278-
const ur_program_native_properties_t *pProperties,
279-
ur_program_handle_t *phProgram) {
278+
ur_native_handle_t, ur_context_handle_t,
279+
const ur_program_native_properties_t *, ur_program_handle_t *) {
280280
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
281281
}
282282

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urQueueFlush(ur_queue_handle_t hQueue) {
237237
UR_APIEXPORT ur_result_t UR_APICALL
238238
urQueueGetNativeHandle(ur_queue_handle_t hQueue, ur_queue_native_desc_t *pDesc,
239239
ur_native_handle_t *phNativeQueue) {
240+
std::ignore = pDesc;
240241
UR_ASSERT(hQueue, UR_RESULT_ERROR_INVALID_NULL_HANDLE);
241242
UR_ASSERT(phNativeQueue, UR_RESULT_ERROR_INVALID_NULL_POINTER);
242243

sycl/plugins/unified_runtime/ur/adapters/cuda/queue.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ struct ur_queue_handle_t_ {
180180
};
181181
{
182182
unsigned int Size = static_cast<unsigned int>(ComputeStreams.size());
183-
std::lock_guard ComputeSyncGuard(ComputeStreamSyncMutex);
183+
std::lock_guard<std::mutex> ComputeSyncGuard(ComputeStreamSyncMutex);
184184
std::lock_guard<std::mutex> ComputeGuard(ComputeStreamMutex);
185185
unsigned int Start = LastSyncComputeStreams;
186186
unsigned int End = NumComputeStreams < Size ? NumComputeStreams

0 commit comments

Comments
 (0)