0

I have just started working on SYCL and ran ComputeCpp_info on my system and following data on 3 devices is showed

ComputeCpp Info (CE 1.1.0)

SYCL 1.2.1 revision 3

Device 1 ( GeForce GTX 1050 = NO - Device does not support SPIR)

Device 2 (Intel(R) HD Graphics 630 = UNTESTED - Device not tested on this OS)

Device 3 (Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz = UNTESTED - Device running untested driver)

Now my question is can I work on these devices as 2 are untested and 1 is not possible? or am i missing some drivers?

Also I implemented a simple example but it gives me CL/cl.h not found error

#include <CL/sycl.hpp>
#include <array>
#include <numeric>
#include <iostream>

int main() {

const size_t array_size = 1024 * 512;
std::array<cl::sycl::cl_int, array_size> in, out;
std::iota(begin(in), end(in), 0);

cl::sycl::queue device_queue;

cl::sycl::range<1> n_items{ array_size };

cl::sycl::buffer < cl::sycl::cl_int, 1> in_buffer(in.data(), n_items);
cl::sycl::buffer < cl::sycl::cl_int, 1> out_buffer(out.data(), n_items);

device_queue.submit([&](cl::sycl::handler &cgh) {

    constexpr auto sycl_read = cl::sycl::access::mode::read;
    constexpr auto sycl_write = cl::sycl::access::mode::write;

    auto in_accessor = in_buffer.get_access<sycl_read>(cgh);
    auto out_accessor = out_buffer.get_access<sycl_write>(cgh);

    cgh.parallel_for<class VecScalMul>(n_items,
        [=](cl::sycl::id<1> wiID) {
        out_accessor[wiID] = in_accessor[wiID] * 2;
    });
});

}
ZSA
  • 85
  • 1
  • 13

2 Answers2

2

The computecpp_info tool shows the devices that are or are not supported by ComputeCpp on your system. Here's an explanation of the outputs:

NO - Device does not support SPIR: This means that the device can be seen but it does not support SPIR instructions and so cannot be supported by ComputeCpp

UNTESTED - Device not tested on this OS: This means that the device can be seen and is reporting that it supports SPIR instructions. It should work with ComputeCpp but this specific device has not been tested by the ComputeCpp team

The cl.h header missing error is because you are missing the OpenCL headers. These can be found here and you'll need to point at them when you compile your code. I'd suggest using the Getting Started guide with the sample code and then modifying the hello world example to test out your code. This has an existing CMake file that is designed to search for all the dependencies you need.

Rod Burns
  • 2,104
  • 13
  • 24
0
  1. (This is a ComputeCpp-specific question, rather than SYCL) The UNTESTED platforms will probably work, but Codeplay cannot guarantee it. In my experience, both should work, maybe some OpenCL driver bugs will hit you on Intel GPU depending on your configuration.
  2. You need the OpenCL headers in your system, since SYCL 1.2.1 specification is built on top of OpenCL

Disclaimer: I am a Codeplay employee working in ComputeCpp!

Ruyk
  • 775
  • 5
  • 11
  • Thanks for reply but I have cuda drivers installed as i have recently worked on OpenCL 1.2. Do i have to link CL/cl.h manually in directories and library as i did for OpenCL code even though i created computeCpp project? – ZSA Mar 26 '19 at 15:00
  • The Cuda drivers do not support SPIR or SPIR-V and so cannot be used withe ComputeCpp. You can however compile to the PTX instruction set, there is some information about that here https://developer.codeplay.com/products/computecpp/ce/guides/platform-support/targeting-nvidia-ptx – Rod Burns Mar 28 '19 at 12:17