Skip to content
Open
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
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ install(DIRECTORY
)

# find Python before enabling pybind11
find_package(Python REQUIRED COMPONENTS Development.Module)
find_package(Python REQUIRED COMPONENTS Interpreter Development.Module)

# Define CMAKE_INSTALL_xxx: LIBDIR, INCLUDEDIR
include(GNUInstallDirs)
Expand Down
18 changes: 18 additions & 0 deletions dpctl/_backend.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ cdef extern from "syclinterface/dpctl_sycl_enum_types.h":
_emulated "emulated",
_is_component "is_component",
_is_composite "is_composite",
_ext_oneapi_ipc_memory "ext_oneapi_ipc_memory",

ctypedef enum _partition_affinity_domain_type \
"DPCTLPartitionAffinityDomainType":
Expand Down Expand Up @@ -595,6 +596,7 @@ cdef extern from "syclinterface/dpctl_sycl_extension_interface.h":
DPCTLSyclWorkGroupMemoryRef Ref)

cdef bint DPCTLWorkGroupMemory_Available()
cdef bint DPCTLIPCMem_Available()

cdef struct DPCTLOpaqueRawKernelArg
ctypedef DPCTLOpaqueRawKernelArg *DPCTLSyclRawKernelArgRef
Expand All @@ -606,3 +608,19 @@ cdef extern from "syclinterface/dpctl_sycl_extension_interface.h":
DPCTLSyclRawKernelArgRef Ref)

cdef bint DPCTLRawKernelArg_Available()

cdef extern from "syclinterface/dpctl_sycl_ipc_memory_interface.h":
cdef int DPCTLIPCMem_GetHandle(
DPCTLSyclUSMRef Ptr,
DPCTLSyclContextRef CRef,
char **DataOut,
size_t *SizeOut)
cdef DPCTLSyclUSMRef DPCTLIPCMem_OpenHandle(
const char *HandleData,
size_t HandleDataSize,
DPCTLSyclContextRef CRef,
DPCTLSyclDeviceRef DRef)
cdef void DPCTLIPCMem_CloseHandle(
DPCTLSyclUSMRef MappedPtr,
DPCTLSyclContextRef CRef)
cdef void DPCTLIPCMem_FreeHandleData(char *Data)
12 changes: 12 additions & 0 deletions dpctl/_sycl_device.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,18 @@ cdef class SyclDevice(_SyclDevice):
cdef _aspect_type AT = _aspect_type._is_composite
return DPCTLDevice_HasAspect(self._device_ref, AT)

@property
def has_aspect_ext_oneapi_ipc_memory(self):
""" Returns ``True`` if this device supports inter-process
communication (IPC) memory handles, ``False`` otherwise.

Returns:
bool:
Indicates if device supports IPC memory.
"""
cdef _aspect_type AT = _aspect_type._ext_oneapi_ipc_memory
return DPCTLDevice_HasAspect(self._device_ref, AT)

@property
def image_2d_max_width(self):
""" Returns the maximum width of a 2D image or 1D image in pixels.
Expand Down
8 changes: 8 additions & 0 deletions dpctl/memory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,25 @@
"""

from ._memory import (
IPCMemoryHandle,
MemoryUSMDevice,
MemoryUSMHost,
MemoryUSMShared,
USMAllocationError,
as_usm_memory,
SyclIpcGetMemHandle,
SyclIpcOpenMemHandle,
SyclIpcCloseMemHandle,
)

__all__ = [
"IPCMemoryHandle",
"MemoryUSMDevice",
"MemoryUSMHost",
"MemoryUSMShared",
"USMAllocationError",
"as_usm_memory",
"SyclIpcGetMemHandle",
"SyclIpcOpenMemHandle",
"SyclIpcCloseMemHandle",
]
Loading