Intel® oneAPI DPC++/C++ Compiler
Talk to fellow users of Intel® oneAPI DPC++/C++ Compiler and companion tools like Intel® oneAPI DPC++ Library, Intel® DPC++ Compatibility Tool, and Intel® Distribution for GDB*

intel sycl sample fails

jimdempseyatthecove
Honored Contributor III
492 Views

Sample code fails to compile

#include <sycl/sycl.hpp>

int main()
{
    for (auto platform : sycl::platform::get_platforms())
    {
        std::cout << "Platform: "
            << platform.get_info<sycl::info::platform::name>()
            << std::endl;

        for (auto device : platform.get_devices())
        {
            std::cout << "\tDevice: "
                << device.get_info<sycl::info::device::name>()
                << std::endl;
        }
    }
}

jimdempseyatthecove_0-1759679637513.png

Microsoft Visual Studio Community 2022
Version 17.8.2
VisualStudio.17.Release/17.8.2+34322.80
Microsoft .NET Framework
Version 4.8.09032

Installed Version: Community

Visual C++ 2022 00482-90000-00000-AA203
Microsoft Visual C++ 2022

ASP.NET and Web Tools 17.8.358.6298
ASP.NET and Web Tools

Azure App Service Tools v3.0.0 17.8.358.6298
Azure App Service Tools v3.0.0

C# Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools 1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

Cookiecutter 17.0.23262.1
Provides tools for finding, instantiating and customizing templates in cookiecutter format.

Intel® C++ Compiler 2025.2
Intel® C++ Compiler 2025.2, Copyright © 2002-2025 Intel Corporation. All rights reserved.

Intel® DPC++ Compatibility Tool 2025.2
Intel® DPC++ Compatibility Tool 2025.2, Copyright © 2019-2025 Intel Corporation. All rights reserved.

Intel® Fortran Compiler 2025.2
Intel® Fortran Compiler 2025.2, Copyright © 2002-2025 Intel Corporation. All rights reserved.

Intel® oneAPI DPC++ Compiler 2025.2
Intel® oneAPI DPC++ Compiler 2025.2, Copyright © 2019-2025 Intel Corporation. All rights reserved.

Intel® oneAPI Menu & Samples 10.10.392.9731
Intel® oneAPI Visual Studio Menu & Samples Extension

Intel® Performance Libraries 2025.2
Intel® Performance Libraries 2025.2, Copyright © 2019-2025 Intel Corporation. All rights reserved.

Intel® VTune™ Profiler 2025 1.3.39
Intel® VTune™ Profiler 2025, (Plugin Version 1.3.39), Copyright © 2009-2025 Intel Corporation. All rights reserved.

Microsoft JVM Debugger 1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

NuGet Package Manager 6.8.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit https://docs.nuget.org/

Python - Django support 17.0.23262.1
Provides templates and integration for the Django web framework.

Python - Profiling support 17.0.23262.1
Profiling support for Python projects.

Python with Pylance 17.0.23262.1
Provides IntelliSense, projects, templates, debugging, interactive windows, and other support for Python developers.

Test Adapter for Boost.Test 1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test. The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test 1.0
Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools 17.0.20920.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools 4.8.0-7.23572.1+7b75981cf3bd520b86ec4ed00ec156c8bc48e4eb
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 17.8.0-beta.23475.2+10f956e631a1efc0f7f5e49c626c494cd32b1f50
Microsoft Visual F# Tools

Visual Studio IntelliCode 2.2
AI-assisted development for Visual Studio.

Visual Studio Tools for Unity 17.8.2.0
Visual Studio Tools for Unity

 

jimdempseyatthecove_1-1759679898691.png

 

0 Kudos
1 Reply
Vladimir_P_1234567890
441 Views

Hello,

have you added -fsycl to compilation and OpenCL/sycl libraries to the link args?

Vladimir

0 Kudos
Reply