Category : sycl

What is the correct way to create a 2D std::vector buffer in SYCL? I have a template function which receives arguments as shown below: template <typename T> void MatrixMulParallelNaive(queue& q, std::vector<std::vector<T>>& a, std::vector<std::vector<T>>& b, std::vector<std::vector<T>>& c){ // Is this a correct way? buffer<T, 2> a_buf(a.data(), range<2>{a.size(), a[0].size()}) buffer<T, 2> b_buf(b.data(), range<2>{b.size(), b[0].size()}) buffer<T, 2> c_buf(c.data(), ..

Read more

I’m new to SYCL and C++. This is my kernel for simple matrix multiplication using 2D std::vector. void MatrixMulParallel(queue& q, const std::vector<std::vector<double>>& a_host, const std::vector<std::vector<double>>& b_host, std::vector<std::vector<double>>& c_gpu) { /* To Multiply: C[M][P] = A[M][N] * B[N][P] */ PROFILE_FUNCTION(); try { size_t M = a_host.size(); size_t N = a_host[0].size(); size_t P = b_host[0].size(); // Create ..

Read more

I am trying to run a hello-world DPC++ sample of oneAPI which adds two 1-D Arrays on both CPU and GPU, and verifies the results. Code is shown below: /* DataParallel Addition of two Vectors */ #include <CL/sycl.hpp> #include <array> #include <iostream> using namespace sycl; constexpr size_t array_size = 100000; typedef std::array<int, array_size> IntArray; // ..

Read more