Developer Guide

Intel® oneAPI DPC++/C++ Compiler Handbook for FPGAs

ID 785441
Date 6/24/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Multithreaded Host Application

When there are parallel, independent datapaths and the host must process data between kernel executions, consider using a multithreaded host application.

The following figure illustrates how a single-threaded host application might process parallel, independent datapaths between kernel executions:

Kernel Execution by a Single-Threaded Host Application

The SYCL* runtime is thread safe and supports multithreaded applications. Thus, you can perform tasks on the host in parallel threads while still allowing those threads to access the SYCL APIs in a thread-safe way.

Multithreaded host applications are supported when only device code interacts with pipes (sometimes referred to as "interkernel pipes"). If host code interacts with pipes (sometimes referred to as "host pipes"), the multithreaded host applications is unsupported.

NOTE:

A SYCL system that has FPGAs installed does not support multiprocess execution. Creating a context opens the device associated with the context and locks it for that process. No other process may use that device. Some queries about the device through device.get_info<>() also opens up the device and locks it to that process since the runtime needs to query the actual device to obtain that information. The following are examples of queries that lock the device:

  • is_endian_little
  • global_mem_size
  • local_mem_size
  • max_constant_buffer_size
  • max_mem_alloc_size
  • vendor
  • name
  • is_available

The following figure illustrates how a multithreaded host application processes parallel, independent datapaths between kernel executions:

Kernel Execution by a Multithreaded Host Application in a Thread-Safe Runtime Environment