Skip to content
Open
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
5 changes: 3 additions & 2 deletions devito/arch/archinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import re
import sys
from contextlib import suppress
from ctypes import util as ctypesutil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
from ctypes import util as ctypesutil
import ctypes.util

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and then you can drop the other changes)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh interesting. I was doing it this way so there wasn't a nondescript util floating around, although I guess you are a fan of those

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There isn't, it still needs to be referenced as ctypes.util. I see your point, but there's not much I can do about a Python internal library 🤷

from functools import cached_property
from pathlib import Path
from subprocess import DEVNULL, PIPE, CalledProcessError, Popen, run
Expand Down Expand Up @@ -647,7 +648,7 @@ def get_m1_llvm_path(language):

@memoized_func
def check_cuda_runtime():
libname = ctypes.util.find_library("cudart")
libname = ctypesutil.find_library("cudart")
if not libname:
warning("Unable to check compatibility of NVidia driver and runtime")
return
Expand Down Expand Up @@ -1109,7 +1110,7 @@ def max_shm_per_block(self):
Get the maximum amount of shared memory per thread block
"""
# Load libcudart
libname = ctypes.util.find_library("cudart")
libname = ctypesutil.find_library("cudart")
if not libname:
return 64 * 1024 # 64 KB default
lib = ctypes.CDLL(libname)
Expand Down
Loading