Commit 0d420400 authored by mjg226's avatar mjg226
Browse files

updated CL.hpp file, as previous version caused problems fetching device and platform details

Grid will now set default settings if the confile file is lacking, instead of bailing out.
parent 9e71f485
......@@ -528,10 +528,11 @@ namespace CA {
manageOptions(options);
// Read the configuration file with extra configuration parameters.
if(!_config_filename.empty() && readConfigCSV(_config_filename)!=0)
{
throw std::runtime_error(std::string("Error opening the Config file: ")+_config_filename);
}
readConfigCSV(_config_filename);
//if(!_config_filename.empty() && readConfigCSV(_config_filename)!=0)
//{
// throw std::runtime_error(std::string("Error opening the Config file: ")+_config_filename);
//}
//! And initialise the OpenCl
initOpenCL();
......@@ -1617,8 +1618,44 @@ namespace CA {
// Read config file.
std::ifstream ifile(filename.c_str());
if(!ifile)
return 1;
if (!ifile) {
std::cout << "No config file found [" << filename << "], using default settings..." << std::endl;
//NOTE might be better to use the automatic seach
// Add the function with range default settings
_hash_ranges["outflowWCA2Dv1"] = cl::NDRange(32, 4);
_hash_ranges["outflowWCA2Dv2"] = cl::NDRange(32, 4);
_hash_ranges["waterdepthWCA2Dv1"] = cl::NDRange(32, 4);
_hash_ranges["waterdepthWCA2Dv2"] = cl::NDRange(32, 4);
_hash_ranges["velocityWCA2Dv1"] = cl::NDRange(32, 4);
_hash_ranges["velocityWCA2Dv2"] = cl::NDRange(32, 4);
_hash_ranges["updatePEAKC"] = cl::NDRange(32, 4);
_hash_ranges["updatePEAKE"] = cl::NDRange(32, 4);
_hash_ranges["addRain"] = cl::NDRange(32, 4);
_hash_ranges["outflowWCA2Dv3"] = cl::NDRange(32, 4);
_hash_ranges["velocityWCA2Dv3"] = cl::NDRange(32, 4);
_hash_ranges["outflowDiffusive"] = cl::NDRange(32, 4);
_hash_ranges["outflowInertial"] = cl::NDRange(32, 4);
_hash_ranges["waterdepth"] = cl::NDRange(32, 4);
_hash_ranges["velocityDiffusive"] = cl::NDRange(32, 4);
_hash_ranges["velocityInertial"] = cl::NDRange(32, 4);
_hash_ranges["infiltration"] = cl::NDRange(32, 4);
_hash_ranges["outflowWCA2Dv1GEO"] = cl::NDRange(32, 4);
_hash_ranges["waterdepthWCA2Dv1GEO"] = cl::NDRange(32, 4);
_hash_ranges["velocityWCA2Dv1GEO"] = cl::NDRange(32, 4);
_hash_ranges["infiltrationGEO"] = cl::NDRange(32, 4);
_hash_ranges["setBoundaryEle"] = cl::NDRange(32, 4);
_device_type = CL_DEVICE_TYPE_GPU;
_warp = 32;
_devices_num = 0;
return 1;
}
// Parse the file line by line until the end of file
// and retrieve the tokens of each line.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment