Skip to content

Commit fc91016

Browse files
authored
Merge pull request #2183 from RossBrunton/ross/wextra2
Enable Wextra on Linux
2 parents b5fce99 + cd5bc8e commit fc91016

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

cmake/helpers.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function(add_ur_target_compile_options name)
9090
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-fcolor-diagnostics>
9191
)
9292
if (UR_DEVELOPER_MODE)
93-
target_compile_options(${name} PRIVATE -Werror)
93+
target_compile_options(${name} PRIVATE -Werror -Wextra)
9494
endif()
9595
if (CMAKE_BUILD_TYPE STREQUAL "Release")
9696
target_compile_options(${name} PRIVATE -fvisibility=hidden)
@@ -120,7 +120,7 @@ function(add_ur_target_link_options name)
120120
if (NOT APPLE)
121121
target_link_options(${name} PRIVATE "LINKER:-z,relro,-z,now,-z,noexecstack")
122122
if (UR_DEVELOPER_MODE)
123-
target_link_options(${name} PRIVATE -Werror)
123+
target_link_options(${name} PRIVATE -Werror -Wextra)
124124
endif()
125125
if (CMAKE_BUILD_TYPE STREQUAL "Release")
126126
target_link_options(${name} PRIVATE

source/adapters/level_zero/v2/kernel.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -395,16 +395,14 @@ ur_result_t urKernelGetGroupInfo(
395395
kernelProperties.pNext = &workGroupProperties;
396396

397397
auto zeDevice = hKernel->getZeHandle(hDevice);
398-
if (zeDevice) {
399-
auto zeResult =
400-
ZE_CALL_NOCHECK(zeKernelGetProperties, (zeDevice, &kernelProperties));
401-
if (zeResult == ZE_RESULT_SUCCESS &&
402-
workGroupProperties.maxGroupSize != 0) {
403-
return returnValue(workGroupProperties.maxGroupSize);
404-
}
405-
return returnValue(
406-
uint64_t{hDevice->ZeDeviceComputeProperties->maxTotalGroupSize});
398+
auto zeResult =
399+
ZE_CALL_NOCHECK(zeKernelGetProperties, (zeDevice, &kernelProperties));
400+
if (zeResult == ZE_RESULT_SUCCESS &&
401+
workGroupProperties.maxGroupSize != 0) {
402+
return returnValue(workGroupProperties.maxGroupSize);
407403
}
404+
return returnValue(
405+
uint64_t{hDevice->ZeDeviceComputeProperties->maxTotalGroupSize});
408406
}
409407
case UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE: {
410408
auto props = hKernel->getProperties(hDevice);

test/conformance/exp_command_buffer/fixtures.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,8 @@ struct urCommandEventSyncUpdateTest : urCommandEventSyncTest {
403403

404404
// Create a command-buffer with update enabled.
405405
ur_exp_command_buffer_desc_t desc{
406-
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC, nullptr, true};
406+
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC, nullptr, true, false,
407+
false};
407408

408409
ASSERT_SUCCESS(urCommandBufferCreateExp(context, device, &desc,
409410
&updatable_cmd_buf_handle));

0 commit comments

Comments
 (0)