replaced operator[] by .at method to trigger an exception in case of out-of-range errors

This commit is contained in:
Peter Steinbach 2017-04-18 15:00:29 +02:00
parent f6d6874c04
commit a971591cc9

View File

@ -60,7 +60,7 @@ HCStream<T>::HCStream(const unsigned int ARRAY_SIZE, const int device_index):
// Set device // Set device
std::vector<hc::accelerator> accs = hc::accelerator::get_all(); std::vector<hc::accelerator> accs = hc::accelerator::get_all();
auto current = accs[device_index]; auto current = accs.at(device_index);
hc::accelerator::set_default(current.get_device_path()); hc::accelerator::set_default(current.get_device_path());