update version and fix bug that cannot run without cupy

This commit is contained in:
unknown
2026-01-20 17:06:28 +08:00
parent 3f92d5161b
commit 8654594ede
6 changed files with 16 additions and 16 deletions
+10 -9
View File
@@ -36,12 +36,13 @@ try:
CUPY_AVAILABLE = True
# Try to import CuPy streams for parallel execution
try:
from cupy.cuda import Stream
STREAMS_AVAILABLE = True
except ImportError:
Stream = None
STREAMS_AVAILABLE = False
if CUPY_AVAILABLE:
try:
from cupy.cuda import Stream
STREAMS_AVAILABLE = True
except ImportError:
Stream = None
STREAMS_AVAILABLE = False
# Create fused elementwise kernel for torque computation
# Computes cross products and combines them in a single kernel pass
@@ -103,9 +104,9 @@ class nHHD(object):
raise ValueError("nHHD Solver works only for 2 and 3 dimensions")
self.psolver.prepare(False)
self.stream1 = cp.cuda.Stream()
self.stream2 = cp.cuda.Stream()
if CUPY_AVAILABLE:
self.stream1 = cp.cuda.Stream()
self.stream2 = cp.cuda.Stream()
# create the 3-component decomposition
def decompose(self, vfield, verbose=0):