|
| 1 | += sycl_ext_intel_fpga_device_selector |
| 2 | + |
| 3 | +:source-highlighter: coderay |
| 4 | +:coderay-linenums-mode: table |
| 5 | + |
| 6 | +// This section needs to be after the document title. |
| 7 | +:doctype: book |
| 8 | +:toc2: |
| 9 | +:toc: left |
| 10 | +:encoding: utf-8 |
| 11 | +:lang: en |
| 12 | +:dpcpp: pass:[DPC++] |
| 13 | + |
| 14 | +// Set the default source code type in this document to C++, |
| 15 | +// for syntax highlighting purposes. This is needed because |
| 16 | +// docbook uses c++ and html5 uses cpp. |
| 17 | +:language: {basebackend@docbook:c++:cpp} |
| 18 | + |
| 19 | + |
| 20 | +== Notice |
| 21 | + |
| 22 | +[%hardbreaks] |
| 23 | +Copyright (C) 2022-2022 Intel Corporation. All rights reserved. |
| 24 | + |
| 25 | +Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks |
| 26 | +of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by |
| 27 | +permission by Khronos. |
| 28 | + |
| 29 | + |
| 30 | +== Contact |
| 31 | + |
| 32 | +To report problems with this extension, please open a new issue at: |
| 33 | + |
| 34 | +https://github.com/intel/llvm/issues |
| 35 | + |
| 36 | + |
| 37 | +== Dependencies |
| 38 | + |
| 39 | +This extension is written against the SYCL 2020 revision 5 specification. All |
| 40 | +references below to the "core SYCL specification" or to section numbers in the |
| 41 | +SYCL specification refer to that revision. |
| 42 | + |
| 43 | +== Status |
| 44 | + |
| 45 | +This extension is implemented and fully supported by {dpcpp}. |
| 46 | + |
| 47 | +[NOTE] |
| 48 | +==== |
| 49 | +This extension is currently implemented in {dpcpp} only for FPGA devices. |
| 50 | +In the {dpcpp} implementation, the application must be built with |
| 51 | +"-Xshardware" in order to use an FPGA hardware device. |
| 52 | +In the {dpcpp} implementation, the application must be built with |
| 53 | +"-Xssimulation" in order to use an FPGA simulator device. |
| 54 | +==== |
| 55 | + |
| 56 | + |
| 57 | +== Overview |
| 58 | + |
| 59 | +This extension provides selectors to choose between FPGA hardware devices, FPGA |
| 60 | +simulator devices, and FPGA emulator devices. The current implementation is |
| 61 | +based on the platform name. This is useful in the most common case when the |
| 62 | +user has one FPGA board installed in their system (one device per platform). |
| 63 | + |
| 64 | +To use these selectors, add |
| 65 | +.... |
| 66 | +#include <sycl/ext/intel/fpga_device_selector.hpp> |
| 67 | +.... |
| 68 | +to your source code. |
| 69 | + |
| 70 | + |
| 71 | +== Specification |
| 72 | + |
| 73 | +=== Feature test macro |
| 74 | + |
| 75 | +This extension provides a feature-test macro as described in the core SYCL |
| 76 | +specification. An implementation supporting this extension must predefine the |
| 77 | +macro `SYCL_EXT_INTEL_FPGA_DEVICE_SELECTOR` to one of the values defined in the table |
| 78 | +below. Applications can test for the existence of this macro to determine if |
| 79 | +the implementation supports this feature, or applications can test the macro's |
| 80 | +value to determine which of the extension's features the implementation |
| 81 | +supports. |
| 82 | + |
| 83 | +[%header,cols="1,5"] |
| 84 | +|=== |
| 85 | +|Value |
| 86 | +|Description |
| 87 | + |
| 88 | +|1 |
| 89 | +|Initial version of this extension. Base features are supported. |
| 90 | + |
| 91 | +|2 |
| 92 | +|fpga_simulator_selector added. |
| 93 | +|=== |
| 94 | + |
| 95 | +=== Select FPGA hardware device |
| 96 | +.... |
| 97 | +// select FPGA hardware device |
| 98 | +sycl::queue deviceQueue{sycl::ext::intel::fpga_selector{}}; |
| 99 | +.... |
| 100 | + |
| 101 | +=== Select FPGA simulator device |
| 102 | +.... |
| 103 | +// select FPGA simulator device |
| 104 | +sycl::queue deviceQueue{sycl::ext::intel::fpga_simulator_selector{}}; |
| 105 | +.... |
| 106 | + |
| 107 | +[NOTE] |
| 108 | +==== |
| 109 | +Added in version 2 of this extension. |
| 110 | +==== |
| 111 | + |
| 112 | +=== Select FPGA emulator device |
| 113 | +.... |
| 114 | +// select FPGA emulator device |
| 115 | +sycl::queue deviceQueue{sycl::ext::intel::fpga_emulator_selector{}}; |
| 116 | +.... |
| 117 | + |
| 118 | +== Implementation notes |
| 119 | + |
| 120 | +The current implementation has a restriction on the use of |
| 121 | +`fpga_simulator_selector`. If an object of `fpga_simulator_selector` is |
| 122 | +defined in the application, FPGA hardware devices selected using |
| 123 | +`fpga_selector` will select a simulator device. This behaviour is expected to |
| 124 | +be eliminated in the future. |
| 125 | + |
0 commit comments