Skip to content

Commit db0da3b

Browse files
[SYCL][NFC] Suppress only SYCL deprecation warnings when building (#17904)
Currently, we suppress all deprecation warnings when building the runtime. This patch limits it to just those coming from the SYCL API.
1 parent a827836 commit db0da3b

19 files changed

+5
-48
lines changed

sycl/CMakeLists.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,12 @@ define_property(GLOBAL PROPERTY SYCL_TOOLCHAIN_INSTALL_COMPONENTS
108108
if (MSVC)
109109
set(CMAKE_CXX_FLAGS "/W4 ${CMAKE_CXX_FLAGS}")
110110
else ()
111-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-deprecated-declarations")
111+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
112112
endif()
113113

114114
if(SYCL_ENABLE_WERROR)
115115
if(MSVC)
116116
set(CMAKE_CXX_FLAGS "/WX ${CMAKE_CXX_FLAGS}")
117-
add_definitions(
118-
-wd4996 # Suppress 'function': was declared deprecated'
119-
)
120117
else()
121118
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
122119
endif()

sycl/tools/sycl-ls/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ if (WIN32 AND "${build_type_lower}" MATCHES "debug")
88
set(sycl_lib sycld)
99
endif()
1010

11-
# Disable aspect::image warning.
12-
target_compile_definitions(sycl-ls PRIVATE SYCL_DISABLE_IMAGE_ASPECT_WARNING)
11+
# Disable aspect::image & deprecation warnings.
12+
target_compile_definitions(sycl-ls PRIVATE SYCL_DISABLE_IMAGE_ASPECT_WARNING SYCL2020_DISABLE_DEPRECATION_WARNINGS)
1313

1414
target_link_libraries(sycl-ls
1515
PRIVATE

sycl/unittests/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ foreach(flag_var
88
string(REGEX REPLACE "/MT" "/MD" ${flag_var} "${${flag_var}}")
99
endforeach()
1010

11+
add_compile_definitions(SYCL2020_DISABLE_DEPRECATION_WARNINGS)
12+
1113
# suppress warnings which came from Google Test sources
1214
if (CXX_SUPPORTS_SUGGEST_OVERRIDE_FLAG)
1315
add_compile_options("-Wno-suggest-override")

sycl/unittests/SYCL2020/GetNativeOpenCL.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88

9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
109
#define __SYCL_INTERNAL_API
1110

1211
#include <detail/context_impl.hpp>

sycl/unittests/SYCL2020/SpecializationConstant.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include <detail/device_image_impl.hpp>
129
#include <sycl/sycl.hpp>
1310

sycl/unittests/buffer/BufferLocation.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
9-
108
#include <helpers/TestKernel.hpp>
119
#include <helpers/UrMock.hpp>
1210

sycl/unittests/buffer/Image.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
9-
108
#include <sycl/sycl.hpp>
119

1210
#include <gtest/gtest.h>

sycl/unittests/context_device/DeviceRefCounter.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include <gtest/gtest.h>
129
#include <helpers/UrMock.hpp>
1310
#include <sycl/sycl.hpp>

sycl/unittests/kernel-and-program/Cache.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
// All these tests are temporarily disabled, since they need to be rewrited
1010
// after the sycl::program class removal to use the kernel_bundle instead.
11-
12-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
13-
1411
#include "detail/context_impl.hpp"
1512
#include "detail/kernel_program_cache.hpp"
1613
#include "sycl/detail/ur.hpp"

sycl/unittests/kernel-and-program/InMemCacheEviction.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66
//
77
//===----------------------------------------------------------------------===//
88
// This file contains tests covering eviction in in-memory program cache.
9-
10-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
11-
129
#include "../thread_safety/ThreadUtils.h"
1310
#include "detail/context_impl.hpp"
1411
#include "detail/kernel_program_cache.hpp"

sycl/unittests/kernel-and-program/KernelBuildOptions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===---------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
108
#ifndef __SYCL_INTERNAL_API
119
#define __SYCL_INTERNAL_API
1210
#endif

sycl/unittests/kernel-and-program/KernelInfo.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include <detail/context_impl.hpp>
129
#include <gtest/gtest.h>
1310
#include <helpers/UrMock.hpp>

sycl/unittests/kernel-and-program/KernelRelease.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include <detail/context_impl.hpp>
129
#include <gtest/gtest.h>
1310
#include <helpers/UrMock.hpp>

sycl/unittests/kernel-and-program/MultipleDevsCache.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include "detail/context_impl.hpp"
129
#include "detail/kernel_bundle_impl.hpp"
1310
#include "detail/kernel_program_cache.hpp"

sycl/unittests/kernel-and-program/OutOfResources.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include "detail/context_impl.hpp"
129
#include "detail/kernel_bundle_impl.hpp"
1310
#include "detail/kernel_program_cache.hpp"

sycl/unittests/program_manager/BuildLog.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
98
#include "gtest/internal/gtest-internal.h"
10-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
119

1210
#include <detail/config.hpp>
1311
#include <detail/context_impl.hpp>

sycl/unittests/program_manager/CompileTarget.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include <helpers/MockDeviceImage.hpp>
129
#include <helpers/MockKernelInfo.hpp>
1310
#include <helpers/UrMock.hpp>

sycl/unittests/program_manager/itt_annotations.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include <detail/config.hpp>
129
#include <detail/program_manager/program_manager.hpp>
1310
#include <helpers/UrMock.hpp>

sycl/unittests/scheduler/RequiredWGSize.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66
//
77
//===----------------------------------------------------------------------===//
8-
9-
#define SYCL2020_DISABLE_DEPRECATION_WARNINGS
10-
118
#include <detail/config.hpp>
129
#include <detail/program_manager/program_manager.hpp>
1310
#include <helpers/UrMock.hpp>

0 commit comments

Comments
 (0)