Skip to content

Commit

Permalink
Enable Wextra on Linux
Browse files Browse the repository at this point in the history
Also fixed some warnings:
* A small fallthrough bug fix for level zero v2
* Unset initializers in command buffer tests
  • Loading branch information
RossBrunton committed Oct 16, 2024
1 parent b4539da commit 623e885
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
4 changes: 2 additions & 2 deletions cmake/helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function(add_ur_target_compile_options name)
$<$<CXX_COMPILER_ID:Clang,AppleClang>:-fcolor-diagnostics>
)
if (UR_DEVELOPER_MODE)
target_compile_options(${name} PRIVATE -Werror)
target_compile_options(${name} PRIVATE -Werror -Wextra)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_compile_options(${name} PRIVATE -fvisibility=hidden)
Expand Down Expand Up @@ -120,7 +120,7 @@ function(add_ur_target_link_options name)
if (NOT APPLE)
target_link_options(${name} PRIVATE "LINKER:-z,relro,-z,now,-z,noexecstack")
if (UR_DEVELOPER_MODE)
target_link_options(${name} PRIVATE -Werror)
target_link_options(${name} PRIVATE -Werror -Wextra)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Release")
target_link_options(${name} PRIVATE
Expand Down
16 changes: 7 additions & 9 deletions source/adapters/level_zero/v2/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -391,16 +391,14 @@ ur_result_t urKernelGetGroupInfo(
kernelProperties.pNext = &workGroupProperties;

auto zeDevice = hKernel->getZeHandle(hDevice);
if (zeDevice) {
auto zeResult =
ZE_CALL_NOCHECK(zeKernelGetProperties, (zeDevice, &kernelProperties));
if (zeResult == ZE_RESULT_SUCCESS &&
workGroupProperties.maxGroupSize != 0) {
return returnValue(workGroupProperties.maxGroupSize);
}
return returnValue(
uint64_t{hDevice->ZeDeviceComputeProperties->maxTotalGroupSize});
auto zeResult =
ZE_CALL_NOCHECK(zeKernelGetProperties, (zeDevice, &kernelProperties));
if (zeResult == ZE_RESULT_SUCCESS &&
workGroupProperties.maxGroupSize != 0) {
return returnValue(workGroupProperties.maxGroupSize);
}
return returnValue(
uint64_t{hDevice->ZeDeviceComputeProperties->maxTotalGroupSize});
}
case UR_KERNEL_GROUP_INFO_COMPILE_WORK_GROUP_SIZE: {
auto props = hKernel->getProperties(hDevice);
Expand Down
3 changes: 2 additions & 1 deletion test/conformance/exp_command_buffer/fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,8 @@ struct urCommandEventSyncUpdateTest : urCommandEventSyncTest {

// Create a command-buffer with update enabled.
ur_exp_command_buffer_desc_t desc{
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC, nullptr, true};
UR_STRUCTURE_TYPE_EXP_COMMAND_BUFFER_DESC, nullptr, true, false,
false};

ASSERT_SUCCESS(urCommandBufferCreateExp(context, device, &desc,
&updatable_cmd_buf_handle));
Expand Down

0 comments on commit 623e885

Please sign in to comment.