Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dpctl-capi/include/dpctl_sycl_device_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,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<info::device::max_compute_units>().
Expand Down Expand Up @@ -253,7 +253,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
Expand Down
4 changes: 2 additions & 2 deletions dpctl-capi/source/dpctl_sycl_device_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions dpctl-capi/tests/test_sycl_device_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetDeviceType)
TEST_P(TestDPCTLSyclDeviceInterface, ChkGetDriverInfo)
{
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));
}
Expand All @@ -118,7 +118,7 @@ TEST_P(TestDPCTLSyclDeviceInterface, ChkGetName)
TEST_P(TestDPCTLSyclDeviceInterface, ChkGetVendorName)
{
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));
}
Expand Down
4 changes: 2 additions & 2 deletions dpctl/_backend.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ cdef extern from "dpctl_sycl_device_interface.h":
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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dpctl/_sycl_device.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ cdef class _SyclDevice:
''' Wrapper data owner 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

Expand Down
32 changes: 16 additions & 16 deletions dpctl/_sycl_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,16 @@ from ._backend cimport (
DPCTLDeviceVector_Delete,
DPCTLDeviceVector_GetAt,
DPCTLDeviceVector_Size,
DPCTLDevice_AreEq,
DPCTLDevice_GetBackend,
DPCTLDevice_AreEq,
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,
Expand Down Expand Up @@ -106,8 +106,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)

Expand Down Expand Up @@ -199,9 +199,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
Expand All @@ -222,12 +222,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):
Expand Down Expand Up @@ -653,10 +653,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):
Expand All @@ -665,10 +665,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):
Expand All @@ -677,7 +677,7 @@ cdef class SyclDevice(_SyclDevice):
def __repr__(self):
return ("<dpctl." + self.__name__ + " [" +
str(self.backend) + ", " + str(self.device_type) +", " +
" " + self.device_name + "] at {}>".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
Expand Down
4 changes: 2 additions & 2 deletions examples/cython/sycl_buffer/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
dpctl.set_global_queue("opencl:cpu")
print(
"SYCL({}) result: {}".format(
dpctl.get_current_queue().get_sycl_device().get_device_name(),
dpctl.get_current_queue().sycl_device.name,
sb.columnwise_total(X),
)
)

dpctl.set_default_queue("opencl:gpu")
print(
"SYCL({}) result: {}".format(
dpctl.get_current_queue().get_sycl_device().get_device_name(),
dpctl.get_current_queue().sycl_device.name,
sb.columnwise_total(X),
)
)
Expand Down
4 changes: 2 additions & 2 deletions examples/cython/sycl_buffer/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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().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().sycl_device.name)
print(sb.columnwise_total(X))
12 changes: 2 additions & 10 deletions examples/cython/usm_memory/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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().sycl_device.name))

t0 = timeit.default_timer()
opts1 = gen_option_params(
Expand All @@ -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().sycl_device.name))

t0 = timeit.default_timer()
opts2 = gen_option_params(
Expand Down