.. _debugging-an-opencl-application: *Tutorial: Debugging with Intel® Distribution for GDB\** Debugging an OpenCL™ Application ================================ To debug OpenCL™ applications with Intel® Distribution for GDB*, make sure you use the following flags when calling the ``clBuildProgram`` function: - ``-g -cl-opt-disable`` to enable the debug information and disable optimizations inside the kernel - ``-s `` to point to the kernel source file. This allows you to set a breakpoint in the following format: ``breakpoint kernel.cl:``. Launch the debugger as follows: .. code-block:: gdb-oneapi To start debugging, you must set a pending breakpoint because the kernel source file is not known to the debugger yet: .. code-block:: set breakpoint pending on .. code-block:: break kernel.cl: .. code-block:: run At runtime, the kernel sources are loaded to the debugger and the breakpoint is hit, both for CPU and GPU offloads.