Visible to Intel only — GUID: gdg1521053497021
Ixiasoft
Visible to Intel only — GUID: gdg1521053497021
Ixiasoft
12.1.8. Using an OpenCL Library that Works with External Memory (Example 2)
The example2.tgz tar ball 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 example2.tgz from the OpenCL Design Examples web page.
- Unpack it into a local directory.
- Follow the instructions in the README.html file, which is located in the top-level of the unpacked example.
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