Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
nvcompManager.hpp661 linesDownload Raw Back to nvcomp
1/*
2 * SPDX-FileCopyrightText: Copyright (c) 2020-2025 NVIDIA CORPORATION & AFFILIATES.
3 * All rights reserved. SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4 *
5 * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6 * property and proprietary rights in and to this material, related
7 * documentation and any modifications thereto. Any use, reproduction,
8 * disclosure or distribution of this material and related documentation
9 * without an express license agreement from NVIDIA CORPORATION or
10 * its affiliates is strictly prohibited.
11*/
12
13#pragma once
14
15#include <memory>
16#include <vector>
17#include <functional>
18
19#include "nvcomp.hpp"
20
21namespace nvcomp {
22
23/**
24 * @brief Custom allocator function type that receives a size in bytes to allocate
25 * in device-accessible memory.
26 */
27using AllocFn_t = std::function<void*(size_t)>;
28
29/**
30 * @brief Custom deallocation function type that receives a memory pointer and size
31 * in bytes to deallocate.
32 */
33using DeAllocFn_t = std::function<void(void*, size_t)>;
34
35/**
36 * @brief Enumeration that defines how a buffer gets compressed by an nvCOMP manager.
37 */
38enum class BitstreamKind {
39  /// Each input buffer is chunked according to manager setting and compressed in parallel.
40  /// Allows computation of checksums.
41  /// Adds custom header with nvCOMP metadata at the beginning of the compressed data.
42  NVCOMP_NATIVE = 0,
43  /// Compresses input data as is, just using underlying compression algorithm.
44  /// Does not add header with nvCOMP metadata.
45  RAW = 1,
46  /// Similar to RAW, but adds custom header with just uncompressed size at the beginning of the compressed data.
47  WITH_UNCOMPRESSED_SIZE = 2,
48};
49
50/**
51 * @brief Enumeration that defines the checksum policy used by an nvCOMP manager.
52 */
53enum ChecksumPolicy {
54  /// During compression, do not compute checksums.
55  /// During decompression, do not verify checksums.
56  NoComputeNoVerify = 0,
57
58  /// During compression, compute checksums.
59  /// During decompression, do not attempt to verify checksums.
60  ComputeAndNoVerify = 1,
61
62  /// During compression, do not compute checksums.
63  /// During decompression, verify checksums if they were included.
64  NoComputeAndVerifyIfPresent = 2,
65
66  /// During compression, compute checksums.
67  /// During decompression, verify checksums if they were included.
68  ComputeAndVerifyIfPresent = 3,
69
70  /// During compression, compute checksums.
71  /// During decompression, verify checksums.
72  /// A runtime error will be thrown upon configure_decompression if
73  /// checksums were not included in the compressed buffer.
74  ComputeAndVerify = 4
75};
76
77/**
78 * @brief Configuration used to aggregate information about the compression of a particular buffer.
79 */
80struct CompressionConfig {
81
82  // pimpl
83  struct CompressionConfigImpl;
84  std::shared_ptr<CompressionConfigImpl> impl;
85
86  // API
87  size_t uncompressed_buffer_size;
88  size_t max_compressed_buffer_size;
89  size_t num_chunks;
90  bool compute_checksums;
91
92  /**
93   * @brief Default constructor that initializes members with default values.
94   *
95   * @note CompressionConfig should be retrieved via the \ref configure_compression
96   * member function, and shouldn't be constructed directly.
97   */
98  NVCOMP_EXPORT
99  CompressionConfig();
100
101  /**
102   * @brief Construct the CompressionConfig using the uncompressed buffer size.
103   *
104   * @note CompressionConfig should be retrieved via the \ref configure_compression
105   * member function, and shouldn't be constructed directly.
106   */
107  NVCOMP_EXPORT
108  CompressionConfig(size_t uncompressed_buffer_size);
109
110  /**
111   * @brief Get the status of the overall compression.
112   *
113   * @note The data resides in host memory.
114   */
115  NVCOMP_EXPORT
116  nvcompStatus_t* get_status() const;
117
118  NVCOMP_EXPORT
119  CompressionConfig(CompressionConfig&& other);
120  NVCOMP_EXPORT
121  CompressionConfig(const CompressionConfig& other);
122  NVCOMP_EXPORT
123  CompressionConfig& operator=(CompressionConfig&& other);
124  NVCOMP_EXPORT
125  CompressionConfig& operator=(const CompressionConfig& other);
126
127  NVCOMP_EXPORT
128  ~CompressionConfig() noexcept;
129};
130
131/**
132 * @brief Configuration used to aggregate information about a particular decompression.
133 */
134struct DecompressionConfig {
135
136  // pimpl
137  struct DecompressionConfigImpl;
138  std::shared_ptr<DecompressionConfigImpl> impl;
139
140  // API
141  size_t decomp_data_size;
142  size_t num_chunks;
143  bool checksums_present;
144
145  /**
146   * @brief Default constructor that initializes members with default values.
147   *
148   * @note DecompressionConfig should be retrieved via the \ref configure_decompression
149   * member function, and shouldn't be constructed directly.
150   */
151  NVCOMP_EXPORT
152  DecompressionConfig();
153
154  /**
155   * @brief Get the status of the overall decompression.
156   *
157   * @note The data resides in host memory.
158   */
159  NVCOMP_EXPORT
160  nvcompStatus_t* get_status() const;
161
162  NVCOMP_EXPORT
163  DecompressionConfig(DecompressionConfig&& other);
164  NVCOMP_EXPORT
165  DecompressionConfig(const DecompressionConfig& other);
166  NVCOMP_EXPORT
167  DecompressionConfig& operator=(DecompressionConfig&& other);
168  NVCOMP_EXPORT
169  DecompressionConfig& operator=(const DecompressionConfig& other);
170
171  NVCOMP_EXPORT
172  ~DecompressionConfig() noexcept;
173};
174
175/**
176 * @brief Abstract base class that defines the nvCOMP high-level interface
177 *
178 * @note This base class should not be directly constructed. One should rely on the
179 * explicit manager constructors (e.g., \ref ANSManager), or the \ref create_manager factory function.
180 */
181struct nvcompManagerBase {
182  /**
183   * @brief Configure the compression of a single buffer.
184   *
185   * This routine computes the size of the required result buffer. The result config also
186   * contains the nvcompStatus_t* that allows error checking.
187   *
188   * @param[in] uncomp_buffer_size The uncompressed input data size (in bytes).
189   *
190   * @return CompressionConfig for the size provided.
191   */
192  virtual CompressionConfig configure_compression(
193    const size_t uncomp_buffer_size) = 0;
194
195  /**
196   * @brief Configure the compression of a batch of buffers.
197   *
198   * This routine computes the size of the required result buffer for each element of the batch.
199   * The result config also contains the nvcompStatus_t* that allows error checking.
200   *
201   * @param[in] uncomp_buffer_sizes The vector of uncompressed input data sizes (in bytes) for each element of the batch.
202   *
203   * @return A vector with CompressionConfig for each of the size provided.
204   */
205  virtual std::vector<CompressionConfig> configure_compression(
206    const std::vector<size_t>& uncomp_buffer_sizes) = 0;
207
208  /**
209   * @brief Perform compression asynchronously for a single buffer.
210   *
211   * @param[in] uncomp_buffer The uncompressed input data.
212   * (a pointer to device continuous memory for GPU-based compression and
213   * host-accessible memory for CPU-based compression)
214   *
215   * @param[out] comp_buffer The location to output the compressed data to.
216   * (a pointer to device continuous memory for GPU-based compression and
217   * host-accessible memory for CPU-based compression)
218   * Size requirement is provided in CompressionConfig.
219   *
220   * @param[in] comp_config Generated for the current uncomp_buffer with configure_compression.
221   *
222   * @param[out] comp_size The location to output size in bytes after compression.
223   * (a pointer to a single size_t variable on device for GPU-based compression and
224   * host variable for CPU-based (de)compression)
225   * Optional when bitstream kind is NVCOMP_NATIVE.
226   */
227  virtual void compress(
228    const uint8_t* uncomp_buffer,
229    uint8_t* comp_buffer,
230    const CompressionConfig& comp_config,
231    size_t* comp_size = nullptr) = 0;
232
233  /**
234   * @brief Perform compression asynchronously for a batch of buffers.
235   * Batch size is inferred from comp_configs size.
236   *
237   * @param[in] uncomp_buffers The uncompressed input data.
238   * (a pointer to a host array of pointers to device continuous memory for GPU-based compression and
239   * host array of pointers to host-accessible memory for CPU-based compression)
240   *
241   * @param[out] comp_buffers The location to output the compressed data to.
242   * (a pointer to a host array of pointers to device continuous memory for GPU-based compression and
243   * host array of pointers to host-accessible memory for CPU-based compression)
244   * Size requirement is provided in CompressionConfig.
245   *
246   * @param[in] comp_configs Generated for the current uncomp_buffers with configure_compression.
247   *
248   * @param[out] comp_sizes The location to output size in bytes after compression.
249   * (a pointer to a device array (or host array for CPU-based compression),
250   * with size enough to contain batch_size elements of type size_t)
251   * Optional when bitstream kind is NVCOMP_NATIVE.
252   */
253  virtual void compress(
254    const uint8_t * const * uncomp_buffers,
255    uint8_t * const * comp_buffers,
256    const std::vector<CompressionConfig>& comp_configs,
257    size_t* comp_sizes = nullptr) = 0;
258
259  /**
260   * @brief Configure the decompression for a single buffer using a compressed buffer.
261   *
262   * Synchronizes the user stream.
263   * - If bitstream kind is NVCOMP_NATIVE, it will parse the header in comp_buffer.
264   * - If bitstream kind is RAW, it may be required (e.g for LZ4) to parse the whole comp_buffer,
265   *   which could be significantly slower that other options.
266   * - If bitstream kind is WITH_UNCOMPRESSED_SIZE, it will read the size from the beginning of the comp_buffer.
267   *
268   * @param[in] comp_buffer The compressed input data.
269   * (a pointer to device continuous memory for GPU-based (de)compression and
270   * host-accessible memory for CPU-based (de)compression)
271   *
272   * @param[in] comp_size Size of the compressed input data. This is required only for RAW format.
273   * (a pointer to device variable with compressed size for GPU-based decompression and
274   * host variable for CPU-based decompression)
275   *
276   * @return DecompressionConfig for the comp_buffer provided.
277   */
278  virtual DecompressionConfig configure_decompression(
279    const uint8_t* comp_buffer,
280    const size_t* comp_size = nullptr) = 0;
281
282  /**
283   * @brief Configure the decompression for a batch of buffers using a compressed buffer.
284   *
285   * Synchronizes the user stream.
286   * - If bitstream kind is NVCOMP_NATIVE, it will parse the header in comp_buffers.
287   * - If bitstream kind is RAW, it may be required (e.g for LZ4) to parse the whole comp_buffers,
288   *   which could be significantly slower that other options.
289   * - If bitstream kind is WITH_UNCOMPRESSED_SIZE, it will read the size from the beginning of the comp_buffers.
290   *
291   * @param[in] comp_buffers The compressed input data.
292   * (a pointer to host array of pointers to device continuous memory for GPU-based decompression and
293   * host array of pointers to host-accessible memory for CPU-based decompression)
294   *
295   * @param[in] batch_size The size of the batch.
296   *
297   * @param[in] comp_sizes Size of the compressed input data.
298   * (a pointer to device array (or host array for CPU-based (de)compression))
299   * This is required only for RAW format.
300   *
301   * @return A vector of DecompressionConfig for each of the comp_buffer provided.
302   */
303  virtual std::vector<DecompressionConfig> configure_decompression(
304    const uint8_t* const * comp_buffers,
305    size_t batch_size,
306    const size_t* comp_sizes = nullptr) = 0;
307
308  /**
309   * @brief Configure the decompression for a single buffer using a CompressionConfig object.
310   *
311   * Does not synchronize the user stream.
312   *
313   * @param[in] comp_config The config used to compress a buffer.
314   *
315   * @return DecompressionConfig based on compression config provided.
316   */
317  virtual DecompressionConfig configure_decompression(
318    const CompressionConfig& comp_config) = 0;
319
320  /**
321   * @brief Configure the decompression for a batch of buffers using a CompressionConfig objects.
322   *
323   * Does not synchronize the user stream.
324   *
325   * @param[in] comp_configs A vector of configs used to compress a batch of buffers.
326   *
327   * @return A vector of DecompressionConfig based on compression configs provided.
328   */
329  virtual std::vector<DecompressionConfig> configure_decompression(
330    const std::vector<CompressionConfig>& comp_configs) = 0;
331
332  /**
333   * @brief Perform decompression asynchronously of a single buffer.
334   *
335   * @param[out] decomp_buffer The location to output the decompressed data to.
336   * (a pointer to device continuous memory for GPU-based decompression and
337   * host-accessible memory for CPU-based decompression)
338   * Size requirement is provided in DecompressionConfig.
339   *
340   * @param[in] comp_buffer The compressed input data.
341   * (a pointer to device continuous memory for GPU-based decompression and
342   * host-accessible memory for CPU-based decompression)
343   *
344   * @param[in] decomp_config Resulted from configure_decompression given this comp_buffer.
345   * Contains nvcompStatus_t* in host/device-accessible memory to allow error checking in a synchronous manner.
346   * Must not be freed by the user until the decompression is complete.
347   *
348   * @param[in] comp_size The size of compressed input data passed.
349   * (a pointer to a single size_t variable on device (or on host for CPU-based decompression))
350   * Optional when bitstream kind is NVCOMP_NATIVE.
351   */
352  virtual void decompress(
353    uint8_t* decomp_buffer,
354    const uint8_t* comp_buffer,
355    const DecompressionConfig& decomp_config,
356    size_t* comp_size = nullptr) = 0;
357
358  /**
359   * @brief Perform decompression asynchronously of a batch of buffers.
360   *
361   * @param[out] decomp_buffers The location to output the decompressed data to.
362   * (a pointer to a host array of pointers to device continuous memory for GPU-based decompression and
363   * host array of pointers to host-accessible memory for CPU-based decompression)
364   * Size requirement is provided in DecompressionConfig.
365   *
366   * @param[in] comp_buffers The compressed input data.
367   * (a pointer to a host array of pointers to device continuous memory with compressed
368   * data for GPU-based decompression or host array of pointers to host-accessible memory with compressed
369   * data for CPU-based decompression)
370   *
371   * @param[in] decomp_configs Resulted from configure_decompression given this comp_buffers.
372   * Contains nvcompStatus_t* in host/device-accessible memory to allow error checking in a synchronous manner.
373   * Must not be freed by the user until the decompression is complete.
374   *
375   * @param[in] comp_sizes The size of compressed input data passed.
376   * (a pointer to a device array (or host array for CPU-based decompression), with size enough to contain batch_size elements of type size_t)
377   * Optional when bitstream kind is NVCOMP_NATIVE.
378   */
379  virtual void decompress(
380    uint8_t * const * decomp_buffers,
381    const uint8_t * const * comp_buffers,
382    const std::vector<DecompressionConfig>& decomp_configs,
383    const size_t* comp_sizes = nullptr) = 0;
384
385  /**
386   * @brief Allows the user to provide a function for allocating / deallocating memory
387   *
388   * The manager requires scratch memory to perform its operations.
389   * By default, it will use internal allocators which make use of
390   * cudaMallocAsync / cudaFreeAsync
391   * The user can override the allocation functions with this API.
392   * The required signatures are
393   *   void* alloc_fn(size_t alloc_size)
394   * and
395   *   void dealloc_fn(void* buffer, size_t alloc_size)
396   *
397   * This API copies the allocation functions. The copied functions must be valid until
398   * either
399   *  1) deallocate_gpu_mem() is called or
400   *  2) the nvcompManager instance is destroyed
401   *
402   * If a scratch buffer was previously allocated, it is first deallocated using the prior
403   * dealloc_fn (or cudaFreeAsync if one wasn't previously provided)
404   *
405   * @param[in] alloc_fn The host function to use to alloc a new scratch result buffer.
406   * @param[in] dealloc_fn The host function to use to dealloc a scratch result buffer.
407   *
408   * @note This API is not supported for CPU (de)compression and will throw an exception if called.
409   */
410  virtual void set_scratch_allocators(
411    const AllocFn_t& alloc_fn,
412    const DeAllocFn_t& dealloc_fn) = 0;
413
414  /**
415   * @brief Computes the compressed output size (in bytes) of a given buffer that was compressed using nvcomp.
416   * The buffer can be in device or host memory.
417   *
418   * Synchronously copies the size of the compressed buffer to a host variable for return.
419   *
420   * Can only be used with NVCOMP_NATIVE bitstream kind.
421   *
422   * To obtain compressed sizes one can also cudaMemcpy sizes from comp_sizes passed to compress function.
423   *
424   * @param[in] comp_buffer A pointer to the compressed input data.
425   * (a pointer to device continuous memory for GPU and 
426   * host-accessible memory for CPU)
427   *
428   * @return Size of the compressed buffer.
429   */
430  virtual size_t get_compressed_output_size(
431    const uint8_t* comp_buffer) = 0;
432
433  /**
434   * @brief Computes the compressed output size (in bytes) of a given batch of buffers that were compressed using nvcomp.
435   * The buffers can be in device or host memory.
436   *
437   * Synchronously copies the sizes of the compressed buffers to host variables for return.
438   *
439   * Can only be used with NVCOMP_NATIVE bitstream kind.
440   *
441   * To obtain compressed sizes one can also cudaMemcpy sizes from comp_sizes passed to compress function.
442   *
443   * @param[in] comp_buffers An array of pointers to the input compressed buffers.
444   * (a pointer to a host array of pointers to device continuous memory for GPU compression and
445   * host array of pointers to host-accessible memory for CPU compression)
446   *
447   * @return A vector with sizes of each compressed buffer in the batch.
448   */
449  virtual std::vector<size_t> get_compressed_output_size(
450    const uint8_t * const * comp_buffers,
451    size_t batch_size) = 0;
452
453  /**
454   * @brief Frees any internal GPU memory used by the nvCOMP HLIF
455   *
456   * Returns this memory back through the deallocator if one was specified through set_scratch_allocators()
457  */
458  virtual void deallocate_gpu_mem() = 0;
459
460  /**
461   * @brief Destructor of the base class.
462   */
463  virtual ~nvcompManagerBase() noexcept = default;
464
465  /**
466   * @brief Perform decompression synchronously of a batch of buffers with host setup.
467   * For asynchronous decompression, use the API that does not take host_comp_buffers.
468   *
469   * @param[out] decomp_buffers The location to output the decompressed data to.
470   * (a pointer to a host array of pointers to device continuous memory)
471   * Size requirement is provided in DecompressionConfig.
472   *
473   * @param[in] comp_buffers The compressed input data.
474   * (a pointer to a host array of pointers to device continuous memory with uncompressed data)
475   *
476   * @param[in] decomp_configs Resulted from configure_decompression given this comp_buffers. (Optional)
477   * Contains nvcompStatus_t* in host/device-accessible memory to allow error checking in a synchronous manner.
478   * When using this API with host_comp_buffers, and host setup, decomp_configs is optional and can be an empty vector.
479   * It cannot be nullptr. If provided, decomp_configs must not be freed until the decompression is complete.
480   *
481   * @param[in] batch_count The number of buffers in the batch
482   *
483   * @param[in] comp_sizes The size of compressed input data passed.
484   * (a pointer to a device array, with size enough to contain batch_size elements of type size_t)
485   * Optional when bitstream kind is NVCOMP_NATIVE.
486   *
487   * @param[in] host_comp_buffers Compressed buffers residing in host accessible memory.
488   * A pointer to a host array of pointers to device continuous memory with compressed data.
489   * The compressed buffers must reside in host-accessible memory. If not, it would lead to undefined behavior.
490   */
491  virtual void decompress(
492    uint8_t * const * decomp_buffers,
493    const uint8_t * const * comp_buffers,
494    const std::vector<DecompressionConfig>& decomp_configs,
495    const size_t* comp_sizes,
496    const size_t batch_count,
497    const uint8_t* const * host_comp_buffers) = 0;
498
499  /**
500   * @brief Computes the decompressed output size (in bytes) of a given buffer that was compressed using nvcomp.
501   * The buffer can be in device or host memory.
502   *
503   * Synchronously copies the sizes of the decompressed buffers to host variables for return.
504   *
505   * Can only be used with NVCOMP_NATIVE bitstream kind.
506   *
507   * @param[in] comp_buffer The compressed input data (a pointer to the compressed buffer).
508   *
509   * @return Size of the decompressed buffer.
510   */
511  virtual size_t get_decompressed_output_size(
512    const uint8_t* comp_buffer) = 0;
513
514  /**
515   * @brief Computes the decompressed output size (in bytes) of a given batch of buffers that were compressed using nvcomp.
516   * The buffers can be in device or host memory.
517   *
518   * Synchronously copies the sizes of the decompressed buffers to host variables for return.
519   *
520   * Can only be used with NVCOMP_NATIVE bitstream kind.
521   *
522   * @param[in] comp_buffers The compressed input data (an array of pointers to the compressed buffers).
523   *
524   * @return A vector with the decompressed sizes of each buffer in the batch.
525   */
526  virtual std::vector<size_t> get_decompressed_output_size(
527    const uint8_t * const * comp_buffers,
528    size_t batch_size) = 0;
529};
530
531#ifndef DOXYGEN_SHOULD_SKIP_THIS
532
533namespace detail {
534
535/**
536 * @brief Internal nvcompManager base class for the high-level interface.
537 */
538struct nvcompManagerInternalBase;
539
540/**
541 * @brief Interface class between nvcompManagerBase and the algorithm-specific implementation class.
542 *
543 * @note This base class should not be directly constructed.
544 */
545struct
546#if !defined(_WIN32)
547NVCOMP_EXPORT
548#endif
549PimplManager : nvcompManagerBase {
550
551  // pimpl
552  std::unique_ptr<nvcompManagerInternalBase> impl;
553
554  PimplManager() noexcept = default;
555
556  NVCOMP_EXPORT
557  explicit PimplManager(std::unique_ptr<nvcompManagerInternalBase> p) noexcept;
558
559  PimplManager(const PimplManager&) = delete;
560
561  virtual ~PimplManager() noexcept = default;
562
563  PimplManager& operator=(const PimplManager&) = delete;
564
565  NVCOMP_EXPORT
566  CompressionConfig configure_compression(
567    const size_t uncomp_buffer_size) override;
568
569  NVCOMP_EXPORT
570  std::vector<CompressionConfig> configure_compression(
571    const std::vector<size_t>& uncomp_buffer_sizes) override;
572
573  NVCOMP_EXPORT
574  void compress(
575    const uint8_t* uncomp_buffer,
576    uint8_t* comp_buffer,
577    const CompressionConfig& comp_config,
578    size_t* comp_size = nullptr) override;
579
580  NVCOMP_EXPORT
581  void compress(
582    const uint8_t * const * uncomp_buffers,
583    uint8_t * const * comp_buffers,
584    const std::vector<CompressionConfig>& comp_configs,
585    size_t* comp_sizes = nullptr) override;
586
587  NVCOMP_EXPORT
588  DecompressionConfig configure_decompression(
589    const uint8_t* comp_buffer,
590    const size_t* comp_size = nullptr) override;
591
592  NVCOMP_EXPORT
593  std::vector<DecompressionConfig> configure_decompression(
594    const uint8_t* const * comp_buffers,
595    size_t batch_size,
596    const size_t* comp_sizes = nullptr) override;
597
598  NVCOMP_EXPORT
599  DecompressionConfig configure_decompression(
600    const CompressionConfig& comp_config) override;
601
602  NVCOMP_EXPORT
603  std::vector<DecompressionConfig> configure_decompression(
604    const std::vector<CompressionConfig>& comp_configs) override;
605
606  NVCOMP_EXPORT
607  void decompress(
608    uint8_t* decomp_buffer,
609    const uint8_t* comp_buffer,
610    const DecompressionConfig& decomp_config,
611    size_t* comp_size = nullptr) override;
612
613  NVCOMP_EXPORT
614  void decompress(
615    uint8_t * const * decomp_buffers,
616    const uint8_t * const * comp_buffers,
617    const std::vector<DecompressionConfig>& decomp_configs,
618    const size_t* comp_sizes = nullptr) override;
619
620  NVCOMP_EXPORT
621  void set_scratch_allocators(
622    const AllocFn_t& alloc_fn,
623    const DeAllocFn_t& dealloc_fn) override;
624
625  NVCOMP_EXPORT
626  size_t get_compressed_output_size(
627    const uint8_t* comp_buffer) override;
628
629  NVCOMP_EXPORT
630  std::vector<size_t> get_compressed_output_size(
631    const uint8_t * const * comp_buffers,
632    size_t batch_size) override;
633
634  NVCOMP_EXPORT
635  void deallocate_gpu_mem() override;
636
637  NVCOMP_EXPORT
638  void decompress(
639    uint8_t * const * decomp_buffers,
640    const uint8_t * const * comp_buffers,
641    const std::vector<DecompressionConfig>& decomp_configs,
642    const size_t* comp_sizes,
643    const size_t batch_count,
644    const uint8_t * const * host_comp_buffers) override;
645
646  NVCOMP_EXPORT
647  size_t get_decompressed_output_size(
648    const uint8_t* comp_buffer) override;
649
650  NVCOMP_EXPORT
651  std::vector<size_t> get_decompressed_output_size(
652    const uint8_t * const * comp_buffers,
653    size_t batch_size) override;
654};
655
656} // namespace detail
657
658#endif // DOXYGEN_SHOULD_SKIP_THIS
659
660} // namespace nvcomp
661