Skip to content

Commit

Permalink
Merge pull request #1615 from IntelPython/backport-gh-1614
Browse files Browse the repository at this point in the history
Backport gh-1614 to 0.16.x maintenance branch
  • Loading branch information
oleksandr-pavlyk authored Mar 28, 2024
2 parents 894fb90 + d6a2b66 commit e9a528b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions dpctl/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ def _dpctl_dir() -> str:


def get_include_dir() -> str:
"Prints include flags for dpctl and SyclInterface library"
"Prints include flags for dpctl and DPCTLSyclInterface library"
return os.path.join(_dpctl_dir(), "include")


def print_include_flags() -> None:
"Prints include flags for dpctl and SyclInterface library"
"Prints include flags for dpctl and DPCTLSyclInterface library"
print("-I " + get_include_dir())


Expand All @@ -46,13 +46,13 @@ def get_tensor_include_dir() -> str:


def print_tensor_include_flags() -> None:
"Prints include flags for dpctl and SyclInterface library"
"Prints include flags for dpctl and DPCTLSyclInterface library"
libtensor_dir = get_tensor_include_dir()
print("-I " + libtensor_dir)


def print_cmake_dir() -> None:
"Prints directory with FindDpctl.cmake"
"Prints directory with dpctl-config.cmake"
dpctl_dir = _dpctl_dir()
cmake_dir = os.path.join(dpctl_dir, "resources", "cmake")
print(cmake_dir)
Expand All @@ -64,13 +64,13 @@ def get_library_dir() -> str:


def print_library() -> None:
"Prints linker flags for SyclInterface library"
"Prints linker flags for DPCTLSyclInterface library"
dpctl_dir = get_library_dir()
plt = platform.platform()
ld_flags = "-L " + dpctl_dir
if plt != "Windows":
ld_flags = ld_flags + " -Wl,-rpath," + dpctl_dir
print(ld_flags + " -lSyclInterface")
print(ld_flags + " -lDPCTLSyclInterface")


def _warn_if_any_set(args, li) -> None:
Expand Down
4 changes: 3 additions & 1 deletion dpctl/tests/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,9 @@ def test_main_library():
)
assert res.returncode == 0
assert res.stdout
assert res.stdout.decode("utf-8").startswith("-L")
output = res.stdout.decode("utf-8")
assert output.startswith("-L")
assert "DPCTLSyclInterface" in output


def test_tensor_includes():
Expand Down

0 comments on commit e9a528b

Please sign in to comment.