[GPU] Friendly exception msg for alloc failure (#10953)
This commit is contained in:
parent
a9ff10b365
commit
0a8f97f429
@ -87,7 +87,11 @@ const cl::UsmHelper& ocl_engine::get_usm_helper() const {
|
||||
|
||||
memory::ptr ocl_engine::allocate_memory(const layout& layout, allocation_type type, bool reset) {
|
||||
if (layout.bytes_count() > get_device_info().max_alloc_mem_size) {
|
||||
throw std::runtime_error("exceeded max size of memory object allocation");
|
||||
std::stringstream ss;
|
||||
ss << "Exceeded max size of memory object allocation: "
|
||||
<< "Requested " << layout.bytes_count() << " bytes "
|
||||
<< "but max alloc size is " << get_device_info().max_alloc_mem_size << " bytes";
|
||||
throw std::runtime_error(ss.str());
|
||||
}
|
||||
|
||||
if (type != allocation_type::cl_mem && !supports_allocation(type)) {
|
||||
|
Loading…
Reference in New Issue
Block a user