Check device support float
This commit is contained in:
parent
d7c17d72d5
commit
3462e61c16
@ -70,7 +70,12 @@ OCLStream<T>::OCLStream(const unsigned int ARRAY_SIZE, const int device_index)
|
||||
// Create program
|
||||
cl::Program program(context, kernels);
|
||||
if (sizeof(T) == sizeof(double))
|
||||
{
|
||||
// Check device can do double
|
||||
if (!device.getInfo<CL_DEVICE_DOUBLE_FP_CONFIG>())
|
||||
throw std::runtime_error("Device does not support double precision, please use --float");
|
||||
program.build("-DTYPE=double");
|
||||
}
|
||||
else if (sizeof(T) == sizeof(float))
|
||||
program.build("-DTYPE=float");
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user