Skip to content

Commit

Permalink
fix(library): only compile CUDA extension on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dacorvo committed Jan 6, 2025
1 parent 66dca87 commit 24222c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion optimum/quanto/library/extensions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import platform

import torch

from .cpp import *
from .extension import *


if torch.cuda.is_available():
if torch.cuda.is_available() and platform.system() == "Linux":
if torch.version.cuda:
from .cuda import *
elif torch.version.hip:
Expand Down

0 comments on commit 24222c6

Please sign in to comment.