Merge branch 'master' of github.com:UoB-HPC/GPU-STREAM

This commit is contained in:
Tom Deakin 2016-07-19 15:46:17 +01:00
commit 4e3ba0639e
3 changed files with 14 additions and 3 deletions

View File

@ -42,7 +42,7 @@ CUDAStream<T>::CUDAStream(const unsigned int ARRAY_SIZE, const int device_index)
check_error();
// Print out device information
std::cout << "Using OpenCL device " << getDeviceName(device_index) << std::endl;
std::cout << "Using CUDA device " << getDeviceName(device_index) << std::endl;
std::cout << "Driver: " << getDeviceDriver(device_index) << std::endl;
array_size = ARRAY_SIZE;

View File

@ -78,8 +78,19 @@ OCLStream<T>::OCLStream(const unsigned int ARRAY_SIZE, const int device_index)
// 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");
try
{
program.build("-DTYPE=double");
}
catch (cl::Error& err)
{
if (err.err() == CL_BUILD_PROGRAM_FAILURE)
{
std::cout << program.getBuildInfo<CL_PROGRAM_BUILD_LOG>()[0].second << std::endl;
throw err;
}
}
}
else if (sizeof(T) == sizeof(float))
program.build("-DTYPE=float");

View File

@ -11,7 +11,7 @@
using namespace cl::sycl;
#define WGSIZE 64
#define WGSIZE 256
// Cache list of devices
bool cached = false;