FZGPUModules 2.0
GPU-accelerated modular compression pipelines
Loading...
Searching...
No Matches
chunk_geometry.h
Go to the documentation of this file.
1#pragma once
2
23namespace fz {
24namespace fused {
25namespace chunk {
26
27constexpr int TEMP_BYTES = 4096; // LC coder scratch (RZE/RRE/RARE/RAZE/CLOG/HCLOG all 4096)
28constexpr int TPB = 512; // = LC coder TPB
29
38constexpr int kSupportedChunkBytes[] = {4096, 8192, 16384};
39constexpr int kNumSupportedChunkBytes =
40 sizeof(kSupportedChunkBytes) / sizeof(kSupportedChunkBytes[0]);
41
42// Host-only (launcher validation). Excluded from NVRTC's device-JIT compile
43// (__CUDACC_RTC__, defined automatically by NVRTC) via #ifndef below: NVRTC
44// rejects any unannotated function merely being *present* in the translation
45// unit in JIT mode (not just called), and this header can't use
46// __host__/__device__ either, since it's also included from plain host C++
47// translation units where those tokens aren't defined at all (no CUDA
48// compiler). Geom<>'s static_assert below inlines the same check as a literal
49// expression instead of calling this, so it works unmodified under NVRTC too.
50#ifndef __CUDACC_RTC__
51constexpr bool isSupportedChunkBytes(int bytes) {
52 return bytes == 4096 || bytes == 8192 || bytes == 16384;
53}
54#endif
55
57template <int Bytes>
58struct Geom {
59 static_assert(Bytes == 4096 || Bytes == 8192 || Bytes == 16384,
60 "chunk-cooperative chunk size must be one of kSupportedChunkBytes");
61 static constexpr int CHUNK_BYTES = Bytes;
62 static constexpr int NELEM = Bytes / 4; // uint32 codes per chunk
63 static constexpr int NPP = NELEM / 32; // bitshuffle words per plane
64};
65
66} // namespace chunk
67} // namespace fused
68} // namespace fz
constexpr int kSupportedChunkBytes[]
Definition chunk_geometry.h:38
Definition dag.h:24
Per-chunk-size derived geometry, instantiated once per supported size.
Definition chunk_geometry.h:58