diff --git a/sycl/CMakeLists.txt b/sycl/CMakeLists.txt index 53bec90a35bb6..63ed5aa1582cd 100644 --- a/sycl/CMakeLists.txt +++ b/sycl/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.14) project(sycl-solution) # Requirements -set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) option(SYCL_ENABLE_WERROR "Treat all warnings as errors in SYCL project" OFF) diff --git a/sycl/cmake/modules/AddSYCLUnitTest.cmake b/sycl/cmake/modules/AddSYCLUnitTest.cmake index 37989d16f0ab3..2d50567d2ee0b 100644 --- a/sycl/cmake/modules/AddSYCLUnitTest.cmake +++ b/sycl/cmake/modules/AddSYCLUnitTest.cmake @@ -45,13 +45,6 @@ macro(add_sycl_unittest test_dirname link_variant) -Wno-inconsistent-missing-override ) endif() - # LLVM gtest uses LLVM utilities that require C++-14 - # CXX_STANDARD_REQUIRED makes CXX_STANDARD a hard requirement. - set_target_properties(${test_dirname} - PROPERTIES - CXX_STANDARD 14 - CXX_STANDARD_REQUIRED ON - ) endmacro() macro(add_sycl_unittest_with_device test_dirname link_variant) diff --git a/sycl/doc/GetStartedGuide.md b/sycl/doc/GetStartedGuide.md index a16dba0690415..23af0f743c969 100644 --- a/sycl/doc/GetStartedGuide.md +++ b/sycl/doc/GetStartedGuide.md @@ -639,7 +639,7 @@ which contains all the symbols required. ## C++ standard -* DPC++ runtime and headers require C++14 at least. +* DPC++ runtime and headers require C++17 at least. * DPC++ compiler builds apps as C++17 apps by default. Higher versions of standard are supported as well. diff --git a/sycl/include/CL/sycl/ONEAPI/accessor_property_list.hpp b/sycl/include/CL/sycl/ONEAPI/accessor_property_list.hpp index b83e4ed43d316..4688cb47f1d38 100644 --- a/sycl/include/CL/sycl/ONEAPI/accessor_property_list.hpp +++ b/sycl/include/CL/sycl/ONEAPI/accessor_property_list.hpp @@ -193,17 +193,18 @@ class accessor_property_list : protected sycl::detail::PropertyListBase { #if __cplusplus >= 201703L template - static constexpr - typename detail::enable_if_t::value, bool> - has_property() { + constexpr std::enable_if_t::value, bool> + has_property() const { return ContainsPropertyInstance, T::template instance>::value; } template ::value && has_property()>> - static constexpr auto get_property() { + typename = std::enable_if_t< + is_compile_time_property::value && + ContainsPropertyInstance, + T::template instance>::value>> + constexpr auto get_property() const { return typename GetCompileTimePropertyHelper, T::template instance>::type{}; } diff --git a/sycl/include/CL/sycl/properties/accessor_properties.hpp b/sycl/include/CL/sycl/properties/accessor_properties.hpp index 45e5075b45ae4..d43ee0b621c9f 100644 --- a/sycl/include/CL/sycl/properties/accessor_properties.hpp +++ b/sycl/include/CL/sycl/properties/accessor_properties.hpp @@ -52,7 +52,7 @@ struct buffer_location { } // namespace property #if __cplusplus > 201402L template -inline constexpr property::buffer_location::instance buffer_location; +inline constexpr property::buffer_location::instance buffer_location{}; #endif } // namespace INTEL namespace ONEAPI { diff --git a/sycl/unittests/scheduler/NoHostUnifiedMemory.cpp b/sycl/unittests/scheduler/NoHostUnifiedMemory.cpp index 418d6ca6bf5e1..9dc561295eb86 100644 --- a/sycl/unittests/scheduler/NoHostUnifiedMemory.cpp +++ b/sycl/unittests/scheduler/NoHostUnifiedMemory.cpp @@ -170,7 +170,7 @@ TEST_F(SchedulerTest, NoHostUnifiedMemory) { // Memory movement operations should be omitted for discard access modes. detail::Command *MemoryMove = MS.insertMemoryMove(Record, &DiscardReq, DefaultHostQueue); - EXPECT_EQ(MemoryMove, nullptr); + EXPECT_TRUE(MemoryMove == nullptr); // The current context for the record should still be modified. EXPECT_EQ(Record->MCurContext, DefaultHostQueue->getContextImplPtr()); } diff --git a/sycl/unittests/scheduler/WaitAfterCleanup.cpp b/sycl/unittests/scheduler/WaitAfterCleanup.cpp index 009be9b66258e..1f21dae6ff597 100644 --- a/sycl/unittests/scheduler/WaitAfterCleanup.cpp +++ b/sycl/unittests/scheduler/WaitAfterCleanup.cpp @@ -14,14 +14,14 @@ using namespace cl::sycl; TEST_F(SchedulerTest, WaitAfterCleanup) { auto Cmd = new MockCommand(detail::getSyclObjImpl(MQueue)); auto Event = Cmd->getEvent(); - ASSERT_NE(Event, nullptr) << "Command must have an event\n"; + ASSERT_FALSE(Event == nullptr) << "Command must have an event\n"; detail::Scheduler::getInstance().waitForEvent(Event); ASSERT_EQ(Event->getCommand(), Cmd) << "Command should not have been cleaned up yet\n"; detail::Scheduler::getInstance().cleanupFinishedCommands(Event); - ASSERT_EQ(Event->getCommand(), nullptr) + ASSERT_TRUE(Event->getCommand() == nullptr) << "Command should have been cleaned up\n"; detail::Scheduler::getInstance().waitForEvent(Event);