Skip to content

Commit

Permalink
use updated ptxcompiler api
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-b-miller committed Oct 26, 2022
1 parent 4ba3124 commit 63992b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion conda/recipes/strings_udf/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ requirements:
- cudf ={{ version }}
- {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}
- cachetools
- ptxcompiler # [linux64] # CUDA enhanced compatibility. See https://github.com/rapidsai/ptxcompiler
- ptxcompiler >=0.7.0 # [linux64] # CUDA enhanced compatibility. See https://github.com/rapidsai/ptxcompiler
test: # [linux64]
requires: # [linux64]
- cudatoolkit {{ cuda_version }}.* # [linux64]
Expand Down
11 changes: 4 additions & 7 deletions python/strings_udf/strings_udf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from cubinlinker.patch import _numba_version_ok, get_logger, new_patched_linker
from numba import cuda
from numba.cuda.cudadrv.driver import Linker
from ptxcompiler.patch import CMD
from ptxcompiler.patch import NO_DRIVER, safe_get_versions

from . import _version

Expand Down Expand Up @@ -84,11 +84,8 @@ def get_ptx_file():
return regular_result[1]


# adapted from PTXCompiler
cp = subprocess.run([sys.executable, "-c", CMD], capture_output=True)
# must have a driver to proceed
if cp.returncode == 0:
versions = [int(s) for s in cp.stdout.strip().split()]
driver_version = tuple(versions[:2])
versions = safe_get_versions()
if not versions == NO_DRIVER:
driver_version, runtime_version = versions
maybe_patch_numba_linker(driver_version)
ptxpath = get_ptx_file()

0 comments on commit 63992b1

Please sign in to comment.