Skip to content

Use os.add_dll_directory on Windows #918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 27, 2022
Merged
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
26 changes: 15 additions & 11 deletions dpctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,17 @@
"""
__author__ = "Intel Corp."

from dpctl._sycl_context import SyclContext, SyclContextCreationError
from dpctl._sycl_device import (
import os
import os.path

from ._device_selection import select_device_with_aspects
from ._sycl_context import SyclContext, SyclContextCreationError
from ._sycl_device import (
SyclDevice,
SyclDeviceCreationError,
SyclSubDeviceCreationError,
)
from dpctl._sycl_device_factory import (
from ._sycl_device_factory import (
get_devices,
get_num_devices,
has_accelerator_devices,
Expand All @@ -51,15 +55,15 @@
select_gpu_device,
select_host_device,
)
from dpctl._sycl_event import SyclEvent
from dpctl._sycl_platform import SyclPlatform, get_platforms, lsplatform
from dpctl._sycl_queue import (
from ._sycl_event import SyclEvent
from ._sycl_platform import SyclPlatform, get_platforms, lsplatform
from ._sycl_queue import (
SyclKernelInvalidRangeError,
SyclKernelSubmitError,
SyclQueue,
SyclQueueCreationError,
)
from dpctl._sycl_queue_manager import (
from ._sycl_queue_manager import (
device_context,
get_current_backend,
get_current_device_type,
Expand All @@ -69,8 +73,6 @@
nested_context_factories,
set_global_queue,
)

from ._device_selection import select_device_with_aspects
from ._sycl_timer import SyclTimer
from ._version import get_versions
from .enum_types import (
Expand Down Expand Up @@ -145,6 +147,10 @@
"utils",
]

if hasattr(os, "add_dll_directory"):
# Include folder containing DPCTLSyclInterface.dll to search path
os.add_dll_directory(os.path.dirname(__file__))


def get_include():
r"""
Expand All @@ -153,8 +159,6 @@ def get_include():
Extension modules that need to be compiled against dpctl should use
this function to locate the appropriate include directory.
"""
import os.path

return os.path.join(os.path.dirname(__file__), "include")


Expand Down