@@ -24,25 +24,15 @@ namespace detail {
2424device_impl::device_impl (ur_device_handle_t Device, platform_impl &Platform,
2525 device_impl::private_tag)
2626 : MDevice(Device), MPlatform(Platform.shared_from_this()),
27- MDeviceHostBaseTime (std::make_pair(0 , 0 )) {
28- const AdapterPtr &Adapter = Platform.getAdapter ();
29-
30- // TODO catch an exception and put it to list of asynchronous exceptions
31- MType = get_info_impl<UR_DEVICE_INFO_TYPE>();
32-
33- // No need to set MRootDevice when MAlwaysRootDevice is true
34- // TODO: Is get_info aligned with this?
35- if (!Platform.MAlwaysRootDevice ) {
36- // TODO catch an exception and put it to list of asynchronous exceptions
37- MRootDevice = get_info_impl<UR_DEVICE_INFO_PARENT_DEVICE>();
38- }
39-
40- // TODO catch an exception and put it to list of asynchronous exceptions
27+ // No need to set MRootDevice when MAlwaysRootDevice is true
28+ MRootDevice (Platform.MAlwaysRootDevice
29+ ? nullptr
30+ : get_info_impl<UR_DEVICE_INFO_PARENT_DEVICE>()),
31+ // TODO catch an exception and put it to list of asynchronous exceptions:
32+ MCache{*this } {
4133 // Interoperability Constructor already calls DeviceRetain in
4234 // urDeviceCreateWithNativeHandle.
43- Adapter->call <UrApiKind::urDeviceRetain>(MDevice);
44-
45- MUseNativeAssert = get_info_impl<UR_DEVICE_INFO_USE_NATIVE_ASSERT>();
35+ getAdapter ()->call <UrApiKind::urDeviceRetain>(MDevice);
4636}
4737
4838device_impl::~device_impl () {
@@ -415,7 +405,7 @@ bool device_impl::has(aspect Aspect) const {
415405 case aspect::ext_oneapi_srgb:
416406 return get_info<info::device::ext_oneapi_srgb>();
417407 case aspect::ext_oneapi_native_assert:
418- return useNativeAssert ();
408+ return get_info_impl<UR_DEVICE_INFO_USE_NATIVE_ASSERT> ();
419409 case aspect::ext_oneapi_cuda_async_barrier: {
420410 return get_info_impl_nocheck<UR_DEVICE_INFO_ASYNC_BARRIER>().value_or (0 );
421411 }
@@ -649,24 +639,6 @@ bool device_impl::has(aspect Aspect) const {
649639 return false ; // This device aspect has not been implemented yet.
650640}
651641
652- bool device_impl::useNativeAssert () const { return MUseNativeAssert; }
653-
654- std::string device_impl::getDeviceName () const {
655- std::call_once (MDeviceNameFlag,
656- [this ]() { MDeviceName = get_info<info::device::name>(); });
657-
658- return MDeviceName;
659- }
660-
661- ext::oneapi::experimental::architecture device_impl::getDeviceArch () const {
662- std::call_once (MDeviceArchFlag, [this ]() {
663- MDeviceArch =
664- get_info<ext::oneapi::experimental::info::device::architecture>();
665- });
666-
667- return MDeviceArch;
668- }
669-
670642// On the first call this function queries for device timestamp
671643// along with host synchronized timestamp and stores it in member variable
672644// MDeviceHostBaseTime. Subsequent calls to this function would just retrieve
0 commit comments