|
1 | | -# Copyright (c) 2021-2023, NVIDIA CORPORATION. All rights reserved. |
| 1 | +# Copyright (c) 2021-2025, NVIDIA CORPORATION. All rights reserved. |
2 | 2 | # See file LICENSE for terms. |
3 | 3 | from __future__ import annotations |
4 | 4 |
|
@@ -180,25 +180,11 @@ class NVCompCompressor(CudaCodec): |
180 | 180 |
|
181 | 181 | The derived classes must set `codec_id` and implement |
182 | 182 | `get_nvcomp_manager` |
183 | | -
|
184 | | - Parameters |
185 | | - ---------- |
186 | | - device_ordinal |
187 | | - The device that should do the compression/decompression |
188 | 183 | """ |
189 | 184 |
|
190 | | - def __init__(self, device_ordinal: int = 0): |
191 | | - self.device_ordinal = device_ordinal |
192 | | - |
193 | 185 | @abstractmethod |
194 | 186 | 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""" |
202 | 188 | pass # TODO: cache Manager |
203 | 189 |
|
204 | 190 | def encode(self, buf: BufferLike) -> cupy.typing.NDArray: |
@@ -229,42 +215,42 @@ class ANS(NVCompCompressor): |
229 | 215 | codec_id = "nvcomp_ANS" |
230 | 216 |
|
231 | 217 | def get_nvcomp_manager(self): |
232 | | - return kvikio.nvcomp.ANSManager(device_id=self.device_ordinal) |
| 218 | + return kvikio.nvcomp.ANSManager() |
233 | 219 |
|
234 | 220 |
|
235 | 221 | class Bitcomp(NVCompCompressor): |
236 | 222 | codec_id = "nvcomp_Bitcomp" |
237 | 223 |
|
238 | 224 | def get_nvcomp_manager(self): |
239 | | - return kvikio.nvcomp.BitcompManager(device_id=self.device_ordinal) |
| 225 | + return kvikio.nvcomp.BitcompManager() |
240 | 226 |
|
241 | 227 |
|
242 | 228 | class Cascaded(NVCompCompressor): |
243 | 229 | codec_id = "nvcomp_Cascaded" |
244 | 230 |
|
245 | 231 | def get_nvcomp_manager(self): |
246 | | - return kvikio.nvcomp.CascadedManager(device_id=self.device_ordinal) |
| 232 | + return kvikio.nvcomp.CascadedManager() |
247 | 233 |
|
248 | 234 |
|
249 | 235 | class Gdeflate(NVCompCompressor): |
250 | 236 | codec_id = "nvcomp_Gdeflate" |
251 | 237 |
|
252 | 238 | def get_nvcomp_manager(self): |
253 | | - return kvikio.nvcomp.GdeflateManager(device_id=self.device_ordinal) |
| 239 | + return kvikio.nvcomp.GdeflateManager() |
254 | 240 |
|
255 | 241 |
|
256 | 242 | class LZ4(NVCompCompressor): |
257 | 243 | codec_id = "nvcomp_LZ4" |
258 | 244 |
|
259 | 245 | def get_nvcomp_manager(self): |
260 | | - return kvikio.nvcomp.LZ4Manager(device_id=self.device_ordinal) |
| 246 | + return kvikio.nvcomp.LZ4Manager() |
261 | 247 |
|
262 | 248 |
|
263 | 249 | class Snappy(NVCompCompressor): |
264 | 250 | codec_id = "nvcomp_Snappy" |
265 | 251 |
|
266 | 252 | def get_nvcomp_manager(self): |
267 | | - return kvikio.nvcomp.SnappyManager(device_id=self.device_ordinal) |
| 253 | + return kvikio.nvcomp.SnappyManager() |
268 | 254 |
|
269 | 255 |
|
270 | 256 | # Expose a list of available nvCOMP compressors and register them as Zarr condecs |
@@ -304,7 +290,7 @@ def lz4(cls) -> CompatCompressor: |
304 | 290 | def open_cupy_array( |
305 | 291 | store: Union[os.PathLike, str], |
306 | 292 | mode: Literal["r", "r+", "a", "w", "w-"] = "a", |
307 | | - compressor: Codec | CompatCompressor = Snappy(device_ordinal=0), |
| 293 | + compressor: Codec | CompatCompressor = Snappy(), |
308 | 294 | meta_array=cupy.empty(()), |
309 | 295 | **kwargs, |
310 | 296 | ) -> zarr.Array: |
|
0 commit comments