[SYCL 2020] Add check for FP64 support using device aspects.
This will resolve #98 in the future SYCL 2020 version.
This commit is contained in:
parent
f7dc20b875
commit
9f38177e1b
@ -34,6 +34,15 @@ SYCLStream<T>::SYCLStream(const int ARRAY_SIZE, const int device_index)
|
||||
std::cout << "Using SYCL device " << getDeviceName(device_index) << std::endl;
|
||||
std::cout << "Driver: " << getDeviceDriver(device_index) << std::endl;
|
||||
|
||||
// Check device can support FP64 if needed
|
||||
if (sizeof(T) == sizeof(double))
|
||||
{
|
||||
if (!dev.has(sycl::aspect::fp64))
|
||||
{
|
||||
throw std::runtime_error("Device does not support double precision, please use --float");
|
||||
}
|
||||
}
|
||||
|
||||
queue = std::make_unique<sycl::queue>(dev, sycl::async_handler{[&](sycl::exception_list l)
|
||||
{
|
||||
bool error = false;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user