Merge branch 'master' of github.com:UoB-HPC/GPU-STREAM
This commit is contained in:
commit
4e3ba0639e
@ -42,7 +42,7 @@ CUDAStream<T>::CUDAStream(const unsigned int ARRAY_SIZE, const int device_index)
|
|||||||
check_error();
|
check_error();
|
||||||
|
|
||||||
// Print out device information
|
// 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;
|
std::cout << "Driver: " << getDeviceDriver(device_index) << std::endl;
|
||||||
|
|
||||||
array_size = ARRAY_SIZE;
|
array_size = ARRAY_SIZE;
|
||||||
|
|||||||
@ -78,8 +78,19 @@ OCLStream<T>::OCLStream(const unsigned int ARRAY_SIZE, const int device_index)
|
|||||||
// Check device can do double
|
// Check device can do double
|
||||||
if (!device.getInfo<CL_DEVICE_DOUBLE_FP_CONFIG>())
|
if (!device.getInfo<CL_DEVICE_DOUBLE_FP_CONFIG>())
|
||||||
throw std::runtime_error("Device does not support double precision, please use --float");
|
throw std::runtime_error("Device does not support double precision, please use --float");
|
||||||
|
try
|
||||||
|
{
|
||||||
program.build("-DTYPE=double");
|
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))
|
else if (sizeof(T) == sizeof(float))
|
||||||
program.build("-DTYPE=float");
|
program.build("-DTYPE=float");
|
||||||
|
|
||||||
|
|||||||
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
using namespace cl::sycl;
|
using namespace cl::sycl;
|
||||||
|
|
||||||
#define WGSIZE 64
|
#define WGSIZE 256
|
||||||
|
|
||||||
// Cache list of devices
|
// Cache list of devices
|
||||||
bool cached = false;
|
bool cached = false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user