File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ set "CC=icx"
2020set " CXX = icx"
2121
2222set " CMAKE_GENERATOR = Ninja"
23+ :: Set by the VS activation, but not supported by Ninja
24+ set " CMAKE_GENERATOR_PLATFORM = "
25+ set " CMAKE_GENERATOR_TOOLSET = "
2326:: Make CMake verbose
2427set " VERBOSE = 1"
2528
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ set "CC=icx"
1818set " CXX = icx"
1919
2020set " CMAKE_GENERATOR = Ninja"
21+ :: Set by the VS activation, but not supported by Ninja
22+ set " CMAKE_GENERATOR_PLATFORM = "
23+ set " CMAKE_GENERATOR_TOOLSET = "
2124:: Make CMake verbose
2225set " VERBOSE = 1"
2326
Original file line number Diff line number Diff line change @@ -148,7 +148,10 @@ def get_include():
148148 Extension modules that need to be compiled against dpctl should use
149149 this function to locate the appropriate include directory.
150150 """
151- return os .path .join (os .path .dirname (__file__ ), "include" )
151+ # Not __file__: editable installs keep Python files in the source tree
152+ from . import _sycl_context
153+
154+ return os .path .join (os .path .dirname (_sycl_context .__file__ ), "include" )
152155
153156
154157del _init_helper
Original file line number Diff line number Diff line change 2424
2525
2626def _dpctl_dir () -> str :
27- dpctl_dir = importlib .util .find_spec ("dpctl" ).submodule_search_locations [0 ]
27+ # Compiled modules are next to the installed data, also in editable mode
28+ origin = importlib .util .find_spec ("dpctl._sycl_context" ).origin
29+ dpctl_dir = os .path .dirname (origin )
2830 abs_dpctl_dir = os .path .abspath (dpctl_dir )
2931 return abs_dpctl_dir
3032
Original file line number Diff line number Diff line change 1414# See the License for the specific language governing permissions and
1515# limitations under the License.
1616
17+ import importlib .util
1718import os
1819import os .path
1920import sys
2425
2526if sys .platform == "win32" : # pragma: no cover
2627 # Include folder containing DPCTLSyclInterface.dll to search path
27- os .add_dll_directory (os .path .dirname (__file__ ))
28+ # Not __file__: editable installs keep Python files in the source tree
29+ _origin = importlib .util .find_spec ("dpctl._sycl_context" ).origin
30+ os .add_dll_directory (os .path .dirname (_origin ))
2831 if is_venv :
2932 # For virtual environments on Windows, add folder
3033 # with DPC++ libraries to the DLL search path gh-1745
Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ def should_skip_syclinterface(request):
156156
157157
158158def test_syclinterface (should_skip_syclinterface ):
159- install_dir = os .path .dirname (os . path . abspath ( dpctl .__file__ ))
159+ install_dir = os .path .dirname (dpctl .get_include ( ))
160160 paths = glob .glob (os .path .join (install_dir , "*DPCTLSyclInterface*" ))
161161 if "linux" in sys .platform :
162162 if should_skip_syclinterface :
You can’t perform that action at this time.
0 commit comments