23 #ifndef VISIONCPP_INCLUDE_FRAMEWORK_DEVICE_SYCL_DEVICE_HPP_
24 #define VISIONCPP_INCLUDE_FRAMEWORK_DEVICE_SYCL_DEVICE_HPP_
33 using QueueType = cl::sycl::queue;
37 mutable QueueType dev;
41 : dev(QueueType(DevType(), [=](cl::
sycl::exception_list l) {
42 for (
const auto &e : l) {
44 std::rethrow_exception(e);
45 }
catch (cl::sycl::exception e) {
46 std::cout << e.what() << std::endl;
50 template <
size_t LC,
size_t LR,
size_t CGT,
size_t RGT,
size_t CLT,
51 size_t RLT,
typename Expr>
57 using placeHolderExprType =
59 TotalLeaves - 1>::Type;
62 dev.submit([&](cl::sycl::handler &cgh) {
67 auto device_only_accessor_tuple =
68 create_local_accessors<LC, LR, Expr>(cgh);
70 constexpr
size_t Output_offset =
74 device_only_accessor_tuple);
77 cgh.parallel_for<Expr>(
78 cl::sycl::nd_range<Expr::Type::Dim>(
79 visioncpp::internal::get_range<Expr::Type::Dim>(RGT, CGT),
80 visioncpp::internal::get_range<Expr::Type::Dim>(RLT, CLT)),
81 [=](cl::sycl::nd_item<Expr::Type::Dim> itemID) {
83 auto cOffset = visioncpp::internal::memLocation<LC, LR>(itemID);
88 eval<Output_offset, LC, LR, placeHolderExprType>(cOffset,
92 dev.throw_asynchronous();
enum class that defines supported backends.
void execute(Expr &expr) const
class used to implement the execution of the expression tree.
auto extract_accessors(cl::sycl::handler &cgh, Expr e) -> decltype(internal::ExtractAccessor< Expr::ND_Category, Expr >::getTuple(cgh, e))
@ sycl
represents sycl backend.
this class is used to define different types of device for sycl
is used to count the total number of leafNode in the expression tree.
it is used to create the PlaceHolder expression.