Skip to content
Wei, Jimmy T edited this page Mar 10, 2023 · 1 revision

Buffers constructors from vector

  • Prefer using class template argument deduction​
  • Verbose SYCL style:​
vector<int> v;​
buffer<int> b(v.data(), v.size());​
  • Simplified DPC++ style (-std=c++11):​
vector<int> v;​
buffer<int> b(v);​
  • Simplified DPC++ style (-std=c++17):​
vector<int> v;​
buffer b(v);

Buffers (CTAD)

  • Prefer using class template argument deduction​
  • Verbose SYCL style:​
    • buffer<int, 2> b(ptr, range<2>(5, 5));​
  • Simplified DPC++ style (-std=c++17):​
    • buffer b(ptr, range(5, 5));
Clone this wiki locally