From c0e985fce802ada063661a7a249df7aeb873cabd Mon Sep 17 00:00:00 2001 From: Ronan Keryell Date: Wed, 16 May 2018 22:51:08 -0700 Subject: [PATCH] Modernize implementation of Xilinx extension decorations with generic lambdas --- .../CL/sycl/vendor/Xilinx/opt_decorate_func.hpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/include/CL/sycl/vendor/Xilinx/opt_decorate_func.hpp b/include/CL/sycl/vendor/Xilinx/opt_decorate_func.hpp index 07c5087a6..ce0744522 100644 --- a/include/CL/sycl/vendor/Xilinx/opt_decorate_func.hpp +++ b/include/CL/sycl/vendor/Xilinx/opt_decorate_func.hpp @@ -28,13 +28,12 @@ namespace cl::sycl::vendor::xilinx { \param[in] f is a function that functions or loops in f will be executed in a dataflow manner. */ -template -void dataflow(Functor f) noexcept { +auto dataflow = [] (auto functor) noexcept { /* SSDM instruction is inserted before the argument functor to guide xocc to do dataflow. */ _ssdm_op_SpecDataflowPipeline(-1, ""); - f(); -} + functor(); +}; /** Execute loops in a pipelined manner @@ -46,13 +45,12 @@ void dataflow(Functor f) noexcept { \param[in] f is a function with an innermost loop to be executed in a pipeline way. */ -template -void pipeline(Functor f) noexcept { +auto pipeline = [] (auto functor) noexcept { /* SSDM instruction is inserted before the argument functor to guide xocc to do pipeline. */ _ssdm_op_SpecPipeline(1, 1, 0, 0, ""); - f(); -} + functor(); +}; }