Skip to content

Commit

Permalink
Merge pull request #1924 from IntelPython/backport-gh-1922
Browse files Browse the repository at this point in the history
Backport gh-1922
  • Loading branch information
oleksandr-pavlyk authored Dec 7, 2024
2 parents 7bac769 + 2b08941 commit 69be39d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.18.2] - Nov. XX, 2024
## [0.18.3] - Dec. XX, 2024

### Fixed

* Enabled `dpctl` in virtual environment on Windows platform (issue [gh-1745](https://github.com/IntelPython/dpctl/issues/1745)) [gh-1924](https://github.com/IntelPython/dpctl/pull/1924)

## [0.18.2] - Nov. 21, 2024

### Maintenance

Expand Down
2 changes: 2 additions & 0 deletions dpctl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import os
import os.path

from . import _init_helper
from ._device_selection import select_device_with_aspects
from ._sycl_context import SyclContext, SyclContextCreationError
from ._sycl_device import (
Expand Down Expand Up @@ -137,3 +138,4 @@ def get_include():

__version__ = get_versions()["version"]
del get_versions
del _init_helper
34 changes: 34 additions & 0 deletions dpctl/_init_helper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Data Parallel Control (dpctl)
#
# Copyright 2020-2024 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import os.path
import sys

is_venv_win32 = (
sys.platform == "win32"
and sys.base_exec_prefix != sys.exec_prefix
and os.path.isfile(os.path.join(sys.exec_prefix, "pyvenv.cfg"))
)

if is_venv_win32:
# For virtual environments on Windows, add folder
# with DPC++ libraries to the DLL search path gh-1745
dll_dir = os.path.join(sys.exec_prefix, "Library", "bin")
if os.path.isdir(dll_dir):
os.add_dll_directory(dll_dir)

del is_venv_win32

0 comments on commit 69be39d

Please sign in to comment.