triSYCL / sycl

SYCL for Vitis: Experimental fusion of triSYCL with Intel SYCL oneAPI DPC++ up-streaming effort into Clang/LLVM
Other
107 stars 19 forks source link

Option `-fsycl-unnamed-lambda` is no longer working #145

Open keryell opened 2 years ago

keryell commented 2 years ago

Describe the bug

Option -fsycl-unnamed-lambda is no longer working. Perhaps a merge-from-upstream problem?

To Reproduce In branch https://github.com/keryell/sycl/tree/linux-kernel-5.11

cd $SYCL_HOME/llvm/sycl/test/on-device/xocc/simple_tests
$SYCL_BIN_DIR/clang++ -std=c++20 -fsycl -fsycl-unnamed-lambda -fsycl-targets=fpga64_hls_hw_emu -o answer_42_unnamed answer_42_unnamed.cpp 
In file included from answer_42_unnamed.cpp:3:
In file included from /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/bin/../include/sycl/sycl.hpp:11:
In file included from /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/bin/../include/sycl/CL/sycl.hpp:15:
In file included from /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/bin/../include/sycl/CL/sycl/backend.hpp:23:
In file included from /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/bin/../include/sycl/CL/sycl/kernel_bundle.hpp:17:
/home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/bin/../include/sycl/CL/sycl/kernel.hpp:45:3: error: static_assert failed due to requirement '!std::is_same<sycl::detail::auto_name, sycl::detail::auto_name>::value' "No kernel name provided without -fsycl-unnamed-lambda enabled!"
  static_assert(
  ^
/home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/build/bin/../include/sycl/CL/sycl/handler.hpp:1213:26: note: in instantiation of template class 'sycl::detail::get_kernel_name_t<sycl::detail::auto_name, (lambda at answer_42_unnamed.cpp:25:23)>' requested here
        typename detail::get_kernel_name_t<KernelName, KernelType>::name;
                         ^
answer_42_unnamed.cpp:25:11: note: in instantiation of function template specialization 'sycl::handler::single_task<sycl::detail::auto_name, (lambda at answer_42_unnamed.cpp:25:23)>' requested here
      cgh.single_task([=] { a[0] = 42; });
          ^
1 error generated.

Environment (please complete the following information):

keryell commented 2 years ago

I have pushed another example for this https://github.com/triSYCL/sycl/pull/147

keryell commented 2 years ago

Making progress but XRT cannot find the kernel

-<%>- $SYCL_BIN_DIR/clang++ -std=c++20 -fsycl -fsycl-unnamed-lambda -fsycl-targets=fpga64_hls_hw_emu -o generic_executor_emu  generic_executor.cpp
-<%>- ./generic_executor_emu                                                                                                                      
INFO: [HW-EMU 01] Hardware emulation runs simulation underneath. Using a large data set will result in long simulation times. It is recommended that a small dataset is used for faster execution. The flow uses approximate models for Global memories and interconnect and hence the performance data generated is approximate.
configuring dataflow mode with ert polling
scheduler config ert(1), dataflow(1), slots(16), cudma(0), cuisr(0), cdma(1), cus(3)
XRT build version: 2.13.0
Build hash: 0ee051f3fa87ce0bda88a701870d7c41b4f4deb8
Build date: 2021-10-19 14:27:50
Git branch: master
PID: 284247
UID: 1000
[Sat Oct 23 01:52:15 2021 GMT]
HOST: rk-xsj
EXE: /home/rkeryell/Xilinx/Projects/LLVM/worktrees/xilinx/llvm/sycl/test/on-device/xocc/simple_tests/generic_executor_emu
[XRT] ERROR: kernel '' not found
terminate called after throwing an instance of 'cl::sycl::runtime_error'
  what():  Native API failed. Native API returns: -46 (CL_INVALID_KERNEL_NAME) -46 (CL_INVALID_KERNEL_NAME)
[1]    284247 segmentation fault (core dumped)  ./generic_executor_emu
lforg37 commented 2 years ago

Should be fixed by last update to #146