Skip to content

Commit b9816d1

Browse files
committed
fix: fp16 check python version
1 parent f92751e commit b9816d1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

numba_cuda/numba/cuda/fp16.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
# SPDX-License-Identifier: BSD-2-Clause
3-
3+
import sys
44
import numba.core.types as types
55
from numba.cuda._internal.cuda_fp16 import (
66
typing_registry,
@@ -190,9 +190,10 @@ def exp_ol(a):
190190
return _make_unary(a, hexp)
191191

192192

193-
@overload(math.exp2, target="cuda")
194-
def exp2_ol(a):
195-
return _make_unary(a, hexp2)
193+
if sys.version_info >= (3, 11):
194+
@overload(math.exp2, target="cuda")
195+
def exp2_ol(a):
196+
return _make_unary(a, hexp2)
196197

197198

198199
@overload(math.tanh, target="cuda")

0 commit comments

Comments
 (0)