Skip to content

Commit ac69747

Browse files
committed
import SyclDevice directly in _dldevice_conversions
Full dpctl namespace is unnecessary, as only SyclDevice is used
1 parent f125be4 commit ac69747

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

dpctl/tensor/_dldevice_conversions.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
import dpctl
18-
17+
from ._sycl_device import SyclDevice
1918
from ._usmarray import DLDeviceType
2019

2120

@@ -29,12 +28,12 @@ def dldevice_to_sycldevice(dl_dev: tuple):
2928
)
3029
if dl_dev[0] != DLDeviceType.kDLOneAPI:
3130
raise ValueError("dldevice type must be kDLOneAPI")
32-
return dpctl.SyclDevice(str(dl_dev[1]))
31+
return SyclDevice(str(dl_dev[1]))
3332

3433

35-
def sycldevice_to_dldevice(dev: dpctl.SyclDevice):
36-
if not isinstance(dev, dpctl.SyclDevice):
34+
def sycldevice_to_dldevice(dev: SyclDevice):
35+
if not isinstance(dev, SyclDevice):
3736
raise TypeError(
38-
"dev is expected to be a dpctl.SyclDevice, got " f"{type(dev)}"
37+
"dev is expected to be a SyclDevice, got " f"{type(dev)}"
3938
)
4039
return (DLDeviceType.kDLOneAPI, dev.get_device_id())

0 commit comments

Comments
 (0)