From 43057121be0cb9003a7cce07028bdc5773567321 Mon Sep 17 00:00:00 2001 From: etotmeni Date: Thu, 8 Apr 2021 06:29:01 -0500 Subject: [PATCH 1/3] Fixes names --- .../include/dpctl_sycl_device_interface.h | 6 ++-- .../source/dpctl_sycl_device_interface.cpp | 6 ++-- .../tests/test_sycl_context_interface.cpp | 3 +- .../tests/test_sycl_device_interface.cpp | 6 ++-- dpctl/_backend.pxd | 6 ++-- dpctl/_sycl_device.pxd | 4 +-- dpctl/_sycl_device.pyx | 34 +++++++++---------- examples/cython/sycl_buffer/bench.py | 4 +-- examples/cython/sycl_buffer/run.py | 4 +-- examples/cython/usm_memory/run.py | 12 ++----- 10 files changed, 39 insertions(+), 46 deletions(-) diff --git a/dpctl-capi/include/dpctl_sycl_device_interface.h b/dpctl-capi/include/dpctl_sycl_device_interface.h index 98496e4794..3bbf700265 100644 --- a/dpctl-capi/include/dpctl_sycl_device_interface.h +++ b/dpctl-capi/include/dpctl_sycl_device_interface.h @@ -126,7 +126,7 @@ bool DPCTLDevice_IsHost(__dpctl_keep const DPCTLSyclDeviceRef DRef); */ DPCTL_API DPCTLSyclBackendType -DPCTLDevice_GetBackend(__dpctl_keep const DPCTLSyclDeviceRef DRef); +DPCTLDevice_GetBackendVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef); /*! * @brief Returns the DPCTLSyclDeviceType enum value for the DPCTLSyclDeviceRef @@ -148,7 +148,7 @@ DPCTLDevice_GetDeviceType(__dpctl_keep const DPCTLSyclDeviceRef DRef); */ DPCTL_API __dpctl_give const char * -DPCTLDevice_GetDriverInfo(__dpctl_keep const DPCTLSyclDeviceRef DRef); +DPCTLDevice_GetDriverVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef); /*! * @brief Wrapper over device.get_info(). @@ -229,7 +229,7 @@ DPCTLDevice_GetName(__dpctl_keep const DPCTLSyclDeviceRef DRef); */ DPCTL_API __dpctl_give const char * -DPCTLDevice_GetVendorName(__dpctl_keep const DPCTLSyclDeviceRef DRef); +DPCTLDevice_GetVendor(__dpctl_keep const DPCTLSyclDeviceRef DRef); /*! * @brief Returns True if the device and the host share a unified memory diff --git a/dpctl-capi/source/dpctl_sycl_device_interface.cpp b/dpctl-capi/source/dpctl_sycl_device_interface.cpp index f56266b02b..ee78a23f6b 100644 --- a/dpctl-capi/source/dpctl_sycl_device_interface.cpp +++ b/dpctl-capi/source/dpctl_sycl_device_interface.cpp @@ -158,7 +158,7 @@ bool DPCTLDevice_IsHost(__dpctl_keep const DPCTLSyclDeviceRef DRef) } DPCTLSyclBackendType -DPCTLDevice_GetBackend(__dpctl_keep const DPCTLSyclDeviceRef DRef) +DPCTLDevice_GetBackendVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef) { DPCTLSyclBackendType BTy = DPCTLSyclBackendType::DPCTL_UNKNOWN_BACKEND; auto D = unwrap(DRef); @@ -299,7 +299,7 @@ DPCTLDevice_GetName(__dpctl_keep const DPCTLSyclDeviceRef DRef) } __dpctl_give const char * -DPCTLDevice_GetVendorName(__dpctl_keep const DPCTLSyclDeviceRef DRef) +DPCTLDevice_GetVendor(__dpctl_keep const DPCTLSyclDeviceRef DRef) { char *cstr_vendor = nullptr; auto D = unwrap(DRef); @@ -325,7 +325,7 @@ DPCTLDevice_GetVendorName(__dpctl_keep const DPCTLSyclDeviceRef DRef) } __dpctl_give const char * -DPCTLDevice_GetDriverInfo(__dpctl_keep const DPCTLSyclDeviceRef DRef) +DPCTLDevice_GetDriverVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef) { char *cstr_driver = nullptr; auto D = unwrap(DRef); diff --git a/dpctl-capi/tests/test_sycl_context_interface.cpp b/dpctl-capi/tests/test_sycl_context_interface.cpp index 8f647130da..dbfd159ba6 100644 --- a/dpctl-capi/tests/test_sycl_context_interface.cpp +++ b/dpctl-capi/tests/test_sycl_context_interface.cpp @@ -207,7 +207,8 @@ TEST_P(TestDPCTLContextInterface, Chk_GetBackend) EXPECT_NO_FATAL_FAILURE(CRef = DPCTLContext_Create(DRef, nullptr, 0)); ASSERT_TRUE(CRef); - EXPECT_NO_FATAL_FAILURE(device_backend = DPCTLDevice_GetBackend(DRef)); + EXPECT_NO_FATAL_FAILURE(device_backend = + DPCTLDevice_GetBackendVersion(DRef)); EXPECT_NO_FATAL_FAILURE(context_backend = DPCTLContext_GetBackend(CRef)); EXPECT_TRUE(device_backend == context_backend); diff --git a/dpctl-capi/tests/test_sycl_device_interface.cpp b/dpctl-capi/tests/test_sycl_device_interface.cpp index 6a2c3f6842..f94f603134 100644 --- a/dpctl-capi/tests/test_sycl_device_interface.cpp +++ b/dpctl-capi/tests/test_sycl_device_interface.cpp @@ -74,7 +74,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, Chk_Copy) TEST_P(TestDPCTLSyclDeviceInterface, Chk_GetBackend) { DPCTLSyclBackendType BTy = DPCTLSyclBackendType::DPCTL_UNKNOWN_BACKEND; - EXPECT_NO_FATAL_FAILURE(BTy = DPCTLDevice_GetBackend(DRef)); + EXPECT_NO_FATAL_FAILURE(BTy = DPCTLDevice_GetBackendVersion(DRef)); EXPECT_TRUE([BTy] { switch (BTy) { case DPCTLSyclBackendType::DPCTL_CUDA: @@ -102,7 +102,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, Chk_GetDeviceType) TEST_P(TestDPCTLSyclDeviceInterface, Chk_GetDriverInfo) { const char *DriverInfo = nullptr; - EXPECT_NO_FATAL_FAILURE(DriverInfo = DPCTLDevice_GetDriverInfo(DRef)); + EXPECT_NO_FATAL_FAILURE(DriverInfo = DPCTLDevice_GetDriverVersion(DRef)); EXPECT_TRUE(DriverInfo != nullptr); EXPECT_NO_FATAL_FAILURE(DPCTLCString_Delete(DriverInfo)); } @@ -118,7 +118,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, Chk_GetName) TEST_P(TestDPCTLSyclDeviceInterface, Chk_GetVendorName) { const char *VendorName = nullptr; - EXPECT_NO_FATAL_FAILURE(VendorName = DPCTLDevice_GetVendorName(DRef)); + EXPECT_NO_FATAL_FAILURE(VendorName = DPCTLDevice_GetVendor(DRef)); EXPECT_TRUE(VendorName != nullptr); EXPECT_NO_FATAL_FAILURE(DPCTLCString_Delete(VendorName)); } diff --git a/dpctl/_backend.pxd b/dpctl/_backend.pxd index 7ad51f7a51..b1e1f219b1 100644 --- a/dpctl/_backend.pxd +++ b/dpctl/_backend.pxd @@ -151,11 +151,11 @@ cdef extern from "dpctl_sycl_device_interface.h": cdef DPCTLSyclDeviceRef DPCTLDevice_CreateFromSelector( const DPCTLSyclDeviceSelectorRef DSRef) cdef void DPCTLDevice_Delete(DPCTLSyclDeviceRef DRef) - cdef DPCTLSyclBackendType DPCTLDevice_GetBackend( + cdef DPCTLSyclBackendType DPCTLDevice_GetBackendVersion( const DPCTLSyclDeviceRef DRef) cdef DPCTLSyclDeviceType DPCTLDevice_GetDeviceType( const DPCTLSyclDeviceRef DRef) - cdef const char *DPCTLDevice_GetDriverInfo(const DPCTLSyclDeviceRef DRef) + cdef const char *DPCTLDevice_GetDriverVersion(const DPCTLSyclDeviceRef DRef) cdef uint32_t DPCTLDevice_GetMaxComputeUnits(const DPCTLSyclDeviceRef DRef) cdef uint32_t DPCTLDevice_GetMaxNumSubGroups(const DPCTLSyclDeviceRef DRef) cdef size_t DPCTLDevice_GetMaxWorkGroupSize(const DPCTLSyclDeviceRef DRef) @@ -164,7 +164,7 @@ cdef extern from "dpctl_sycl_device_interface.h": cdef const char *DPCTLDevice_GetName(const DPCTLSyclDeviceRef DRef) cdef DPCTLSyclPlatformRef DPCTLDevice_GetPlatform( const DPCTLSyclDeviceRef DRef) - cdef const char *DPCTLDevice_GetVendorName(const DPCTLSyclDeviceRef DRef) + cdef const char *DPCTLDevice_GetVendor(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_IsAccelerator(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_IsCPU(const DPCTLSyclDeviceRef DRef) cdef bool DPCTLDevice_IsGPU(const DPCTLSyclDeviceRef DRef) diff --git a/dpctl/_sycl_device.pxd b/dpctl/_sycl_device.pxd index a87b5c8196..739b13767e 100644 --- a/dpctl/_sycl_device.pxd +++ b/dpctl/_sycl_device.pxd @@ -31,8 +31,8 @@ cdef class _SyclDevice: ''' Wrapper class for a Sycl Device ''' cdef DPCTLSyclDeviceRef _device_ref - cdef const char *_vendor_name - cdef const char *_device_name + cdef const char *_vendor + cdef const char *_name cdef const char *_driver_version cdef size_t *_max_work_item_sizes diff --git a/dpctl/_sycl_device.pyx b/dpctl/_sycl_device.pyx index f0fcf77bdf..de870989a8 100644 --- a/dpctl/_sycl_device.pyx +++ b/dpctl/_sycl_device.pyx @@ -34,15 +34,15 @@ from ._backend cimport ( DPCTLDeviceVector_Delete, DPCTLDeviceVector_GetAt, DPCTLDeviceVector_Size, - DPCTLDevice_GetBackend, + DPCTLDevice_GetBackendVersion, DPCTLDevice_GetDeviceType, - DPCTLDevice_GetDriverInfo, + DPCTLDevice_GetDriverVersion, DPCTLDevice_GetMaxComputeUnits, DPCTLDevice_GetMaxNumSubGroups, DPCTLDevice_GetMaxWorkGroupSize, DPCTLDevice_GetMaxWorkItemDims, DPCTLDevice_GetMaxWorkItemSizes, - DPCTLDevice_GetVendorName, + DPCTLDevice_GetVendor, DPCTLDevice_GetName, DPCTLDevice_IsAccelerator, DPCTLDevice_IsCPU, @@ -101,8 +101,8 @@ cdef class _SyclDevice: def __dealloc__(self): DPCTLDevice_Delete(self._device_ref) - DPCTLCString_Delete(self._device_name) - DPCTLCString_Delete(self._vendor_name) + DPCTLCString_Delete(self._name) + DPCTLCString_Delete(self._vendor) DPCTLCString_Delete(self._driver_version) DPCTLSize_t_Array_Delete(self._max_work_item_sizes) @@ -166,9 +166,9 @@ cdef class SyclDevice(_SyclDevice): @staticmethod cdef void _init_helper(_SyclDevice device, DPCTLSyclDeviceRef DRef): device._device_ref = DRef - device._device_name = DPCTLDevice_GetName(DRef) - device._driver_version = DPCTLDevice_GetDriverInfo(DRef) - device._vendor_name = DPCTLDevice_GetVendorName(DRef) + device._name = DPCTLDevice_GetName(DRef) + device._driver_version = DPCTLDevice_GetDriverVersion(DRef) + device._vendor = DPCTLDevice_GetVendor(DRef) device._max_work_item_sizes = DPCTLDevice_GetMaxWorkItemSizes(DRef) @staticmethod @@ -189,12 +189,12 @@ cdef class SyclDevice(_SyclDevice): self._device_ref = DPCTLDevice_Copy(other._device_ref) if (self._device_ref is NULL): return -1 - self._device_name = DPCTLDevice_GetName(self._device_ref) - self._driver_version = DPCTLDevice_GetDriverInfo(self._device_ref) + self._name = DPCTLDevice_GetName(self._device_ref) + self._driver_version = DPCTLDevice_GetDriverVersion(self._device_ref) self._max_work_item_sizes = ( DPCTLDevice_GetMaxWorkItemSizes(self._device_ref) ) - self._vendor_name = DPCTLDevice_GetVendorName(self._device_ref) + self._vendor = DPCTLDevice_GetVendor(self._device_ref) return 0 cdef int _init_from_selector(self, DPCTLSyclDeviceSelectorRef DSRef): @@ -278,7 +278,7 @@ cdef class SyclDevice(_SyclDevice): backend_type: The backend for the device. """ cdef DPCTLSyclBackendType BTy = ( - DPCTLDevice_GetBackend(self._device_ref) + DPCTLDevice_GetBackendVersion(self._device_ref) ) if BTy == _backend_type._CUDA: return backend_type.cuda @@ -604,10 +604,10 @@ cdef class SyclDevice(_SyclDevice): return DPCTLDevice_GetPreferredVectorWidthHalf(self._device_ref) @property - def vendor_name(self): + def vendor(self): """ Returns the device vendor name as a string. """ - return self._vendor_name.decode() + return self._vendor.decode() @property def driver_version(self): @@ -616,10 +616,10 @@ cdef class SyclDevice(_SyclDevice): return self._driver_version.decode() @property - def device_name(self): + def name(self): """ Returns the name of the device as a string """ - return self._device_name.decode() + return self._name.decode() @property def __name__(self): @@ -628,7 +628,7 @@ cdef class SyclDevice(_SyclDevice): def __repr__(self): return ("".format(hex(id(self))) ) + " " + self.name + "] at {}>".format(hex(id(self))) ) cdef list create_sub_devices_equally(self, size_t count): """ Returns a vector of sub devices partitioned from this SYCL device diff --git a/examples/cython/sycl_buffer/bench.py b/examples/cython/sycl_buffer/bench.py index e063735ccd..6777a7e26a 100644 --- a/examples/cython/sycl_buffer/bench.py +++ b/examples/cython/sycl_buffer/bench.py @@ -27,7 +27,7 @@ dpctl.set_global_queue("opencl:cpu") print( "SYCL({}) result: {}".format( - dpctl.get_current_queue().get_sycl_device().get_device_name(), + dpctl.get_current_queue().get_sycl_device().name, sb.columnwise_total(X), ) ) @@ -35,7 +35,7 @@ dpctl.set_default_queue("opencl:gpu") print( "SYCL({}) result: {}".format( - dpctl.get_current_queue().get_sycl_device().get_device_name(), + dpctl.get_current_queue().get_sycl_device().name, sb.columnwise_total(X), ) ) diff --git a/examples/cython/sycl_buffer/run.py b/examples/cython/sycl_buffer/run.py index 467fdbc226..4a62278229 100644 --- a/examples/cython/sycl_buffer/run.py +++ b/examples/cython/sycl_buffer/run.py @@ -30,9 +30,9 @@ import dpctl with dpctl.device_context("opencl:gpu"): - print("Running on: ", dpctl.get_current_queue().get_sycl_device().get_device_name()) + print("Running on: ", dpctl.get_current_queue().get_sycl_device().name) print(sb.columnwise_total(X)) with dpctl.device_context("opencl:cpu"): - print("Running on: ", dpctl.get_current_queue().get_sycl_device().get_device_name()) + print("Running on: ", dpctl.get_current_queue().get_sycl_device().name) print(sb.columnwise_total(X)) diff --git a/examples/cython/usm_memory/run.py b/examples/cython/usm_memory/run.py index 16ccdda957..09e4fee36a 100644 --- a/examples/cython/usm_memory/run.py +++ b/examples/cython/usm_memory/run.py @@ -57,11 +57,7 @@ def gen_option_params(n_opts, pl, ph, sl, sh, tl, th, rl, rh, vl, vh, dtype): for _ in range(3): dpctl.set_global_queue("opencl:cpu:0") - print( - "Using : {}".format( - dpctl.get_current_queue().get_sycl_device().get_device_name() - ) - ) + print("Using : {}".format(dpctl.get_current_queue().get_sycl_device().name)) t0 = timeit.default_timer() opts1 = gen_option_params( @@ -74,11 +70,7 @@ def gen_option_params(n_opts, pl, ph, sl, sh, tl, th, rl, rh, vl, vh, dtype): # compute on GPU sycl device dpctl.set_global_queue("level_zero:gpu:0") - print( - "Using : {}".format( - dpctl.get_current_queue().get_sycl_device().get_device_name() - ) - ) + print("Using : {}".format(dpctl.get_current_queue().get_sycl_device().name)) t0 = timeit.default_timer() opts2 = gen_option_params( From f24533dd825055e51c91c589113cc645e0c3acf5 Mon Sep 17 00:00:00 2001 From: etotmeni Date: Mon, 12 Apr 2021 08:49:32 -0500 Subject: [PATCH 2/3] Fix name GetBackend --- dpctl-capi/include/dpctl_sycl_device_interface.h | 2 +- dpctl-capi/source/dpctl_sycl_device_interface.cpp | 2 +- dpctl-capi/tests/test_sycl_context_interface.cpp | 3 +-- dpctl-capi/tests/test_sycl_device_interface.cpp | 2 +- dpctl/_backend.pxd | 2 +- dpctl/_sycl_device.pyx | 6 +++--- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/dpctl-capi/include/dpctl_sycl_device_interface.h b/dpctl-capi/include/dpctl_sycl_device_interface.h index 465a261072..2960b79b68 100644 --- a/dpctl-capi/include/dpctl_sycl_device_interface.h +++ b/dpctl-capi/include/dpctl_sycl_device_interface.h @@ -126,7 +126,7 @@ bool DPCTLDevice_IsHost(__dpctl_keep const DPCTLSyclDeviceRef DRef); */ DPCTL_API DPCTLSyclBackendType -DPCTLDevice_GetBackendVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef); +DPCTLDevice_GetBackend(__dpctl_keep const DPCTLSyclDeviceRef DRef); /*! * @brief Returns the DPCTLSyclDeviceType enum value for the DPCTLSyclDeviceRef diff --git a/dpctl-capi/source/dpctl_sycl_device_interface.cpp b/dpctl-capi/source/dpctl_sycl_device_interface.cpp index 0d79dcf189..6b0724e38d 100644 --- a/dpctl-capi/source/dpctl_sycl_device_interface.cpp +++ b/dpctl-capi/source/dpctl_sycl_device_interface.cpp @@ -158,7 +158,7 @@ bool DPCTLDevice_IsHost(__dpctl_keep const DPCTLSyclDeviceRef DRef) } DPCTLSyclBackendType -DPCTLDevice_GetBackendVersion(__dpctl_keep const DPCTLSyclDeviceRef DRef) +DPCTLDevice_GetBackend(__dpctl_keep const DPCTLSyclDeviceRef DRef) { DPCTLSyclBackendType BTy = DPCTLSyclBackendType::DPCTL_UNKNOWN_BACKEND; auto D = unwrap(DRef); diff --git a/dpctl-capi/tests/test_sycl_context_interface.cpp b/dpctl-capi/tests/test_sycl_context_interface.cpp index dbfd159ba6..8f647130da 100644 --- a/dpctl-capi/tests/test_sycl_context_interface.cpp +++ b/dpctl-capi/tests/test_sycl_context_interface.cpp @@ -207,8 +207,7 @@ TEST_P(TestDPCTLContextInterface, Chk_GetBackend) EXPECT_NO_FATAL_FAILURE(CRef = DPCTLContext_Create(DRef, nullptr, 0)); ASSERT_TRUE(CRef); - EXPECT_NO_FATAL_FAILURE(device_backend = - DPCTLDevice_GetBackendVersion(DRef)); + EXPECT_NO_FATAL_FAILURE(device_backend = DPCTLDevice_GetBackend(DRef)); EXPECT_NO_FATAL_FAILURE(context_backend = DPCTLContext_GetBackend(CRef)); EXPECT_TRUE(device_backend == context_backend); diff --git a/dpctl-capi/tests/test_sycl_device_interface.cpp b/dpctl-capi/tests/test_sycl_device_interface.cpp index 40207f982c..dc49e12424 100644 --- a/dpctl-capi/tests/test_sycl_device_interface.cpp +++ b/dpctl-capi/tests/test_sycl_device_interface.cpp @@ -74,7 +74,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, Chk_Copy) TEST_P(TestDPCTLSyclDeviceInterface, Chk_GetBackend) { DPCTLSyclBackendType BTy = DPCTLSyclBackendType::DPCTL_UNKNOWN_BACKEND; - EXPECT_NO_FATAL_FAILURE(BTy = DPCTLDevice_GetBackendVersion(DRef)); + EXPECT_NO_FATAL_FAILURE(BTy = DPCTLDevice_GetBackend(DRef)); EXPECT_TRUE([BTy] { switch (BTy) { case DPCTLSyclBackendType::DPCTL_CUDA: diff --git a/dpctl/_backend.pxd b/dpctl/_backend.pxd index 2d4eb76215..361ed09391 100644 --- a/dpctl/_backend.pxd +++ b/dpctl/_backend.pxd @@ -151,7 +151,7 @@ cdef extern from "dpctl_sycl_device_interface.h": cdef DPCTLSyclDeviceRef DPCTLDevice_CreateFromSelector( const DPCTLSyclDeviceSelectorRef DSRef) cdef void DPCTLDevice_Delete(DPCTLSyclDeviceRef DRef) - cdef DPCTLSyclBackendType DPCTLDevice_GetBackendVersion( + cdef DPCTLSyclBackendType DPCTLDevice_GetBackend( const DPCTLSyclDeviceRef DRef) cdef DPCTLSyclDeviceType DPCTLDevice_GetDeviceType( const DPCTLSyclDeviceRef DRef) diff --git a/dpctl/_sycl_device.pyx b/dpctl/_sycl_device.pyx index 475857a544..eda0749f48 100644 --- a/dpctl/_sycl_device.pyx +++ b/dpctl/_sycl_device.pyx @@ -34,7 +34,7 @@ from ._backend cimport ( DPCTLDeviceVector_Delete, DPCTLDeviceVector_GetAt, DPCTLDeviceVector_Size, - DPCTLDevice_GetBackendVersion, + DPCTLDevice_GetBackend, DPCTLDevice_AreEq, DPCTLDevice_GetDeviceType, DPCTLDevice_GetDriverVersion, @@ -309,7 +309,7 @@ cdef class SyclDevice(_SyclDevice): backend_type: The backend for the device. """ cdef DPCTLSyclBackendType BTy = ( - DPCTLDevice_GetBackendVersion(self._device_ref) + DPCTLDevice_GetBackend(self._device_ref) ) if BTy == _backend_type._CUDA: return backend_type.cuda @@ -779,7 +779,7 @@ cdef class SyclDevice(_SyclDevice): cdef int64_t relId = -1 pDRef = DPCTLDevice_GetParentDevice(self._device_ref) if (pDRef is NULL): - BTy = DPCTLDevice_GetBackendVersion(self._device_ref) + BTy = DPCTLDevice_GetBackend(self._device_ref) DTy = DPCTLDevice_GetDeviceType(self._device_ref) relId = DPCTLDeviceMgr_GetRelativeId(self._device_ref) if (relId == -1): From 9755e96cf4426b35718a6ef7b560df0e93287c5e Mon Sep 17 00:00:00 2001 From: etotmeni Date: Mon, 12 Apr 2021 11:55:19 -0500 Subject: [PATCH 3/3] Fix sycl_device call in examples --- examples/cython/sycl_buffer/bench.py | 4 ++-- examples/cython/sycl_buffer/run.py | 4 ++-- examples/cython/usm_memory/run.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/examples/cython/sycl_buffer/bench.py b/examples/cython/sycl_buffer/bench.py index 6777a7e26a..ecc74c7e25 100644 --- a/examples/cython/sycl_buffer/bench.py +++ b/examples/cython/sycl_buffer/bench.py @@ -27,7 +27,7 @@ dpctl.set_global_queue("opencl:cpu") print( "SYCL({}) result: {}".format( - dpctl.get_current_queue().get_sycl_device().name, + dpctl.get_current_queue().sycl_device.name, sb.columnwise_total(X), ) ) @@ -35,7 +35,7 @@ dpctl.set_default_queue("opencl:gpu") print( "SYCL({}) result: {}".format( - dpctl.get_current_queue().get_sycl_device().name, + dpctl.get_current_queue().sycl_device.name, sb.columnwise_total(X), ) ) diff --git a/examples/cython/sycl_buffer/run.py b/examples/cython/sycl_buffer/run.py index 4a62278229..3bba707e88 100644 --- a/examples/cython/sycl_buffer/run.py +++ b/examples/cython/sycl_buffer/run.py @@ -30,9 +30,9 @@ import dpctl with dpctl.device_context("opencl:gpu"): - print("Running on: ", dpctl.get_current_queue().get_sycl_device().name) + print("Running on: ", dpctl.get_current_queue().sycl_device.name) print(sb.columnwise_total(X)) with dpctl.device_context("opencl:cpu"): - print("Running on: ", dpctl.get_current_queue().get_sycl_device().name) + print("Running on: ", dpctl.get_current_queue().sycl_device.name) print(sb.columnwise_total(X)) diff --git a/examples/cython/usm_memory/run.py b/examples/cython/usm_memory/run.py index 09e4fee36a..4bf50b0040 100644 --- a/examples/cython/usm_memory/run.py +++ b/examples/cython/usm_memory/run.py @@ -57,7 +57,7 @@ def gen_option_params(n_opts, pl, ph, sl, sh, tl, th, rl, rh, vl, vh, dtype): for _ in range(3): dpctl.set_global_queue("opencl:cpu:0") - print("Using : {}".format(dpctl.get_current_queue().get_sycl_device().name)) + print("Using : {}".format(dpctl.get_current_queue().sycl_device.name)) t0 = timeit.default_timer() opts1 = gen_option_params( @@ -70,7 +70,7 @@ def gen_option_params(n_opts, pl, ph, sl, sh, tl, th, rl, rh, vl, vh, dtype): # compute on GPU sycl device dpctl.set_global_queue("level_zero:gpu:0") - print("Using : {}".format(dpctl.get_current_queue().get_sycl_device().name)) + print("Using : {}".format(dpctl.get_current_queue().sycl_device.name)) t0 = timeit.default_timer() opts2 = gen_option_params(