Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
bitcomp.hpp59 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 "nvcompManager.hpp"
16#include "formatSpec.hpp"
17#include "bitcomp.h"
18
19namespace nvcomp {
20
21/**
22 * @brief High-level interface class for the Bitcomp compressor.
23 *
24 * @warning Any uncompressed data buffer to be compressed MUST be a size that is a
25 * multiple of the data type size, else compression may crash or result in
26 * invalid output.
27 *
28 * @note If user_stream is specified, the lifetime of the BitcompManager instance must not
29 * extend beyond that of the user_stream.
30 */
31struct BitcompManager : detail::PimplManager {
32  /**
33   * @brief Constructor of BitcompManager.
34   *
35   * @param[in] uncomp_chunk_size Internal chunk size used to partition the input data.
36   * @param[in] compress_opts Compression options to use.
37   * @param[in] decompress_opts Decompression options to use.
38   * @param[in] user_stream The CUDA stream to operate on.
39   * @param[in] checksum_policy The checksum policy to use during compression and decompression.
40   * @param[in] bitstream_kind Setting to configure how the manager compresses the input.
41   */
42  NVCOMP_EXPORT
43  BitcompManager(
44    size_t uncomp_chunk_size,
45    const nvcompBatchedBitcompCompressOpts_t& compress_opts = nvcompBatchedBitcompCompressDefaultOpts,
46    const nvcompBatchedBitcompDecompressOpts_t& decompress_opts = nvcompBatchedBitcompDecompressDefaultOpts,
47    cudaStream_t user_stream = 0,
48    ChecksumPolicy checksum_policy = NoComputeNoVerify,
49    BitstreamKind bitstream_kind = BitstreamKind::NVCOMP_NATIVE);
50
51  /**
52   * @brief Destructor of BitcompManager.
53   */
54  NVCOMP_EXPORT
55  ~BitcompManager() noexcept;
56};
57
58} // namespace nvcomp
59 
codekingpro/portable-devtools · Team Ai