Skip to content

Commit c3def58

Browse files
committed
remove device_ordinal
1 parent 0337847 commit c3def58

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

python/kvikio/kvikio/zarr.py

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved.
1+
# Copyright (c) 2021-2025, NVIDIA CORPORATION. All rights reserved.
22
# See file LICENSE for terms.
33
from __future__ import annotations
44

@@ -180,25 +180,11 @@ class NVCompCompressor(CudaCodec):
180180
181181
The derived classes must set `codec_id` and implement
182182
`get_nvcomp_manager`
183-
184-
Parameters
185-
----------
186-
device_ordinal
187-
The device that should do the compression/decompression
188183
"""
189184

190-
def __init__(self, device_ordinal: int = 0):
191-
self.device_ordinal = device_ordinal
192-
193185
@abstractmethod
194186
def get_nvcomp_manager(self) -> kvikio.nvcomp.nvCompManager:
195-
"""Abstract method that should return the nvCOMP compressor manager
196-
197-
Returns
198-
-------
199-
nvCompManager
200-
The nvCOMP compressor manager to use
201-
"""
187+
"""Abstract method that should return the nvCOMP compressor manager"""
202188
pass # TODO: cache Manager
203189

204190
def encode(self, buf: BufferLike) -> cupy.typing.NDArray:
@@ -229,42 +215,42 @@ class ANS(NVCompCompressor):
229215
codec_id = "nvcomp_ANS"
230216

231217
def get_nvcomp_manager(self):
232-
return kvikio.nvcomp.ANSManager(device_id=self.device_ordinal)
218+
return kvikio.nvcomp.ANSManager()
233219

234220

235221
class Bitcomp(NVCompCompressor):
236222
codec_id = "nvcomp_Bitcomp"
237223

238224
def get_nvcomp_manager(self):
239-
return kvikio.nvcomp.BitcompManager(device_id=self.device_ordinal)
225+
return kvikio.nvcomp.BitcompManager()
240226

241227

242228
class Cascaded(NVCompCompressor):
243229
codec_id = "nvcomp_Cascaded"
244230

245231
def get_nvcomp_manager(self):
246-
return kvikio.nvcomp.CascadedManager(device_id=self.device_ordinal)
232+
return kvikio.nvcomp.CascadedManager()
247233

248234

249235
class Gdeflate(NVCompCompressor):
250236
codec_id = "nvcomp_Gdeflate"
251237

252238
def get_nvcomp_manager(self):
253-
return kvikio.nvcomp.GdeflateManager(device_id=self.device_ordinal)
239+
return kvikio.nvcomp.GdeflateManager()
254240

255241

256242
class LZ4(NVCompCompressor):
257243
codec_id = "nvcomp_LZ4"
258244

259245
def get_nvcomp_manager(self):
260-
return kvikio.nvcomp.LZ4Manager(device_id=self.device_ordinal)
246+
return kvikio.nvcomp.LZ4Manager()
261247

262248

263249
class Snappy(NVCompCompressor):
264250
codec_id = "nvcomp_Snappy"
265251

266252
def get_nvcomp_manager(self):
267-
return kvikio.nvcomp.SnappyManager(device_id=self.device_ordinal)
253+
return kvikio.nvcomp.SnappyManager()
268254

269255

270256
# Expose a list of available nvCOMP compressors and register them as Zarr condecs
@@ -304,7 +290,7 @@ def lz4(cls) -> CompatCompressor:
304290
def open_cupy_array(
305291
store: Union[os.PathLike, str],
306292
mode: Literal["r", "r+", "a", "w", "w-"] = "a",
307-
compressor: Codec | CompatCompressor = Snappy(device_ordinal=0),
293+
compressor: Codec | CompatCompressor = Snappy(),
308294
meta_array=cupy.empty(()),
309295
**kwargs,
310296
) -> zarr.Array:

0 commit comments

Comments
 (0)