- 3.4. Listing the Intel® FPGA SDK for OpenCL™ Offline Compiler Command Options (no argument, -help, or -h)
- 7.5. Specifying the Name of an Intel® FPGA SDK for OpenCL™ Offline Compiler Output File (-o <filename>)
- 7.6. Compiling a Kernel for a Specific FPGA Board and Custom Platform (-board=<board_name>) and (-board-package=<board_package_path>)
- 7.13. Converting Warning Messages from the Intel® FPGA SDK for OpenCL™ Offline Compiler into Error Messages (-Werror)
- 7.17. Forcing a Single Store Ring to Reduce Area at the Expense of Write Throughput to Global Memory (-force-single-store-ring)
- 7.18. Forcing Fewer Read Data Reorder Units to Reduce Area at the Expense of Read Throughput to Global Memory (-num-reorder)
11.1.9. Using an OpenCL Library that Works with External Memory (Example 2)
The library_example2 includes a library, a kernel, and a host system. In this example, the RTL code that communicates with global memory is Custom Platform- or Reference Platform-dependent. Ensure that the compilation targets the board that corresponds to the Stratix® V Network Reference Platform.
Intel® generated the RTL modules copyElement() and sumOfElements() using the Intel® FPGA SDK for OpenCL™ Offline Compiler, which explains the extra inputs in the code.
The example2.cl kernel source file includes two kernels. The kernel test6 is an NDRange kernel that calls the copyElement() RTL function, which copies data from B to A and then stores global_id+100 in C. The kernel test11 is a single work-item kernel that uses an RTL function. The sumOfElements() RTL function determines the sum of the elements of A in range [i, N] and then adds the rest to C[i].
To compile this design example, perform the following tasks:
- Obtain the library_example2 from the OpenCL design examples in the $INTELFPGAOCLSDKROOT/examples_aoc directory.
- Copy it into a local directory.
- Follow the instructions in the README.html file, which is located in the top-level of the example directory.
When you run the compiled host program, it should produce the following output:
Loading example2.aocx ... Running test6 Launching the kernel test6 with globalsize=128 localSize=16 Loading example2.aocx ... Running test11 Launching the kernel test11 with globalsize=1 localSize=1 PASSED
Did you find the information on this page useful?