// Copyright (c) 2015-16 Tom Deakin, Simon McIntosh-Smith, // University of Bristol HPC // // For full license terms please see the LICENSE file distributed with this // source code #pragma once #include #include "Stream.h" #include "CL/sycl.hpp" #define IMPLEMENTATION_STRING "SYCL" // allows a use of 'parallel_for' currently known to be supported by ComputeCpp #define COMPUTECPP_CE namespace sycl_kernels { template class init; template class copy; template class mul; template class add; template class triad; template class dot; } template class SYCLStream : public Stream { protected: // Size of arrays unsigned int array_size; // SYCL objects cl::sycl::queue *queue; cl::sycl::buffer *d_a; cl::sycl::buffer *d_b; cl::sycl::buffer *d_c; cl::sycl::buffer *d_sum; // SYCL kernel names typedef sycl_kernels::init init_kernel; typedef sycl_kernels::copy copy_kernel; typedef sycl_kernels::mul mul_kernel; typedef sycl_kernels::add add_kernel; typedef sycl_kernels::triad triad_kernel; typedef sycl_kernels::dot dot_kernel; // NDRange configuration for the dot kernel size_t dot_num_groups; size_t dot_wgsize; public: SYCLStream(const unsigned int, const int); ~SYCLStream(); virtual void copy() override; virtual void add() override; virtual void mul() override; virtual void triad() override; virtual T dot() override; virtual void init_arrays(T initA, T initB, T initC) override; virtual void read_arrays(std::vector& a, std::vector& b, std::vector& c) override; }; // Populate the devices list void getDeviceList(void);