replaced operator[] by .at method to trigger an exception in case of out-of-range errors
This commit is contained in:
parent
f6d6874c04
commit
a971591cc9
@ -60,7 +60,7 @@ HCStream<T>::HCStream(const unsigned int ARRAY_SIZE, const int device_index):
|
||||
|
||||
// Set device
|
||||
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());
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user