Skip to content

Commit

Permalink
[SYCL][NFC] Trivial documentation and test edits
Browse files Browse the repository at this point in the history
* Fixed documentation and tests to use new fsycl-targets
* Added RUN: true to the top of new test so that it passes by default 
with check-all
* Removed some old todo's from XOCC.h
  • Loading branch information
agozillon committed May 3, 2019
1 parent 209f423 commit b4380a4
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 27 deletions.
5 changes: 0 additions & 5 deletions clang/lib/Driver/ToolChains/XOCC.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
#include "clang/Driver/ToolChain.h"
#include "clang/Driver/Tool.h"

// \todo Link XOCC/SYCL toolchain driver to OpenMP style
// \todo Remove old flag -fsycl-xocc-device
// \todo Combine XOCC Assembler and Linker
// \todo Move more commands into script if possible, stop partial split between
// drivers and scripts
namespace clang {
namespace driver {

Expand Down
5 changes: 3 additions & 2 deletions sycl/doc/Tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ be-aware that some tests still use hard-coded selectors for now):
### Xilinx Compile Command:

```bash
$SYCL_BIN_DIR/clang++ -std=c++2a -fsycl -fsycl-xocc-device test-case.cpp -o \
test-case -lOpenCL
$SYCL_BIN_DIR/clang++ -std=c++2a -fsycl \
-fsycl-targets=fpga64-xilinx-unknown-sycldevice test-case.cpp \
-o test-case -lOpenCL
```

### Regular Compile Command:
Expand Down
19 changes: 10 additions & 9 deletions sycl/doc/XilinxFPGACompilation.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,21 +148,22 @@ The compiler invocation for the `single_task_vector_add.cpp` example inside
the [simple_tests](../test/xocc_tests/simple_tests) folder looks like this:

```bash
$SYCL_BIN_DIR/clang++ -std=c++2a -fsycl -fsycl-xocc-device \
single_task_vector_add.cpp -o single_task_vector_add -lOpenCL
$SYCL_BIN_DIR/clang++ -std=c++2a -fsycl \
-fsycl-targets=fpga64-xilinx-unknown-sycldevice single_task_vector_add.cpp \
-o single_task_vector_add -lOpenCL
```

Be aware that compiling for FPGA is rather slow.

## Compiler invocation differences

The `-fsycl-xocc-device` compiler directive is a flag we use to force certain
things in the compiler at the moment, like picking our device ToolChain's
Assembler and Linker over the regular SYCL ToolChain's Linker and defining some
environment variables that are used by the runtime. It also forces the assembler
stage of the Clang compiler to emit LLVM-IR for the moment. In the future we
hope to remove this and have this sort of thing defined by the device target
instead, to be more inline with the main Intel SYCL implementation.
By setting the `fsycl-targets` to `fpga64-xilinx-unknown-sycldevice` you're
telling the compiler to use our XOCC Tools and compile the device side code
for Xilinx FPGA.

This hasn't been tested with mutliple `fsycl-targets` yet (e.g. offloading to
both a Xilinx and Intel FPGA) and is unlikely to work, so I would advise
sticking to compiling for a single target at the moment.

## Tested with
* Ubuntu 18.10
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
But started as an executable variation of integration_header.cpp from the
CodeGenSYCL tests.
Intel command:
$ISYCL_BIN_DIR/clang++ -std=c++2a -fsycl integration_header_check.cpp -o \
integration_header_check -lOpenCL
Xilinx command:
$ISYCL_BIN_DIR/clang++ -std=c++2a -fsycl -fsycl-xocc-device \
integration_header_check.cpp -o integration_header_check -lOpenCL
*/

#include <CL/sycl.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
edge_detection -lOpenCL `pkg-config --libs opencv`
XOCC compile command:
$ISYCL_BIN_DIR/clang++ -std=c++2a -fsycl -fsycl-xocc-device \
edge_detection.cpp -o edge_detection -lOpenCL `pkg-config --libs opencv`
$ISYCL_BIN_DIR/clang++ -std=c++2a -fsycl \
-fsycl-targets=fpga64-xilinx-unknown-sycldevice edge_detection.cpp \
-o edge_detection -lOpenCL `pkg-config --libs opencv`
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
median_filter -lOpenCL `pkg-config --libs opencv`
Xilinx:
$ISYCL_BIN_DIR/clang++ -std=c++2a -fsycl fsycl-xocc-device \
-median_filter.cpp -o median_filter -lOpenCL `pkg-config --libs opencv`
$ISYCL_BIN_DIR/clang++ -std=c++2a -fsycl \
-fsycl-targets=fpga64-xilinx-unknown-sycldevice median_filter.cpp \
-o median_filter -lOpenCL `pkg-config --libs opencv`
*/

#include <CL/sycl.hpp>
Expand Down
2 changes: 2 additions & 0 deletions sycl/test/xocc_tests/simple_tests/internal_defines.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// RUN: true

/*
This test is checking if the implementation defined defines created by the
Expand Down

0 comments on commit b4380a4

Please sign in to comment.