Skip to content

Commit 54baa67

Browse files
Replace use of deprecated sycl::runtime_error with std::runtime_error in helper functions
1 parent f8089d5 commit 54baa67

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

libsyclinterface/helper/source/dpctl_utils_helper.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ backend DPCTL_DPCTLBackendTypeToSyclBackend(DPCTLSyclBackendType BeTy)
9797
case DPCTLSyclBackendType::DPCTL_OPENCL:
9898
return backend::opencl;
9999
default:
100-
throw runtime_error("Unsupported backend type", -1);
100+
throw std::runtime_error("Unsupported backend type");
101101
}
102102
}
103103

@@ -135,7 +135,7 @@ info::device_type DPCTL_DPCTLDeviceTypeToSyclDeviceType(DPCTLSyclDeviceType DTy)
135135
case DPCTLSyclDeviceType::DPCTL_HOST_DEVICE:
136136
return info::device_type::host;
137137
default:
138-
throw runtime_error("Unsupported device type", -1);
138+
throw std::runtime_error("Unsupported device type");
139139
}
140140
}
141141

@@ -223,7 +223,7 @@ std::string DPCTL_AspectToStr(aspect aspectTy)
223223
ss << "usm_system_allocator";
224224
break;
225225
default:
226-
throw runtime_error("Unsupported aspect type", -1);
226+
throw std::runtime_error("Unsupported aspect type");
227227
}
228228
return ss.str();
229229
}
@@ -290,7 +290,7 @@ aspect DPCTL_StrToAspectType(const std::string &aspectTyStr)
290290
}
291291
else {
292292
// \todo handle the error
293-
throw runtime_error("Unsupported aspect type", -1);
293+
throw std::runtime_error("Unsupported aspect type");
294294
}
295295
return aspectTy;
296296
}
@@ -335,7 +335,7 @@ aspect DPCTL_DPCTLAspectTypeToSyclAspect(DPCTLSyclAspectType AspectTy)
335335
case DPCTLSyclAspectType::usm_system_allocator:
336336
return aspect::usm_system_allocator;
337337
default:
338-
throw runtime_error("Unsupported aspect type", -1);
338+
throw std::runtime_error("Unsupported aspect type");
339339
}
340340
}
341341

@@ -379,7 +379,7 @@ DPCTLSyclAspectType DPCTL_SyclAspectToDPCTLAspectType(aspect Aspect)
379379
case aspect::usm_system_allocator:
380380
return DPCTLSyclAspectType::usm_system_allocator;
381381
default:
382-
throw runtime_error("Unsupported aspect type", -1);
382+
throw std::runtime_error("Unsupported aspect type");
383383
}
384384
}
385385

@@ -402,7 +402,7 @@ info::partition_affinity_domain DPCTL_DPCTLPartitionAffinityDomainTypeToSycl(
402402
case DPCTLPartitionAffinityDomainType::next_partitionable:
403403
return info::partition_affinity_domain::next_partitionable;
404404
default:
405-
throw runtime_error("Unsupported partition_affinity_domain type", -1);
405+
throw std::runtime_error("Unsupported partition_affinity_domain type");
406406
}
407407
}
408408

@@ -425,7 +425,7 @@ DPCTLPartitionAffinityDomainType DPCTL_SyclPartitionAffinityDomainToDPCTLType(
425425
case info::partition_affinity_domain::next_partitionable:
426426
return DPCTLPartitionAffinityDomainType::next_partitionable;
427427
default:
428-
throw runtime_error("Unsupported partition_affinity_domain type", -1);
428+
throw std::runtime_error("Unsupported partition_affinity_domain type");
429429
}
430430
}
431431

0 commit comments

Comments
 (0)