cuPHY  0.1
CUDA PHY Layer Acceration Library
Data Structures | Functions
CRC Computation

This section describes the CRC computation functions of the cuPHY application programming interface. More...

Data Structures

struct  crcLaunchDescriptor
 CRC Launch descriptor. More...
 

Functions

cuphyStatus_t cuphyCRCDecode (uint32_t *d_outputCBCRCs, uint32_t *d_outputTBCRCs, uint8_t *d_outputTransportBlocks, const uint32_t *d_inputCodeBlocks, const PerTbParams *d_tbPrmsArray, uint32_t nTBs, uint32_t maxNCBsPerTB, uint32_t maxTBByteSize, int reverseBytes, int timeIt, uint32_t NRUNS, uint32_t codeBlocksOnly, cudaStream_t strm)
 Perform CRC decode. More...
 
cuphyStatus_t cuphyCRCDecodeLaunchSetup (uint32_t nTBs, uint32_t maxNCBsPerTB, uint32_t maxTBByteSize, crcLaunchDescriptor *crcDecodeDesc)
 populates crcLaunchDescriptor More...
 
cuphyStatus_t cuphyCrcEncodeGetDescrInfo (size_t *pDescrSizeBytes, size_t *pDescrAlignBytes)
 : Compute descriptor size and alignment for CRC Encoder. More...
 
cuphyStatus_t cuphySetupCrcEncode (cuphyCrcEncodeLaunchConfig_t crcEncodeLaunchConfig, uint32_t *d_cbCRCs, uint32_t *d_tbCRCs, const uint32_t *d_inputTransportBlocks, uint8_t *d_codeBlocks, const PdschPerTbParams *d_tbPrmsArray, uint32_t nTBs, uint32_t maxNCBsPerTB, uint32_t maxTBByteSize, uint8_t reverseBytes, uint8_t codeBlocksOnly, void *cpu_desc, void *gpu_desc, uint8_t enable_desc_async_copy, cudaStream_t strm)
 : Setup CRC encoder component. More...
 

Detailed Description

Function Documentation

◆ cuphyCRCDecode()

cuphyStatus_t cuphyCRCDecode ( uint32_t *  d_outputCBCRCs,
uint32_t *  d_outputTBCRCs,
uint8_t *  d_outputTransportBlocks,
const uint32_t *  d_inputCodeBlocks,
const PerTbParams d_tbPrmsArray,
uint32_t  nTBs,
uint32_t  maxNCBsPerTB,
uint32_t  maxTBByteSize,
int  reverseBytes,
int  timeIt,
uint32_t  NRUNS,
uint32_t  codeBlocksOnly,
cudaStream_t  strm 
)

Perform CRC Decode

Returns CUPHY_STATUS_SUCCESS if execution is successful

Parameters
d_outputCBCRCs- output buffer containing result of CRC check for each input code block (one uint32_t value per code block): 0 if the CRC check passed, a value different than zero otherwise
d_outputTBCRCs- output buffer containing result of CRC check for each input transport block (one uint32_t value per transport block): 0 if the CRC check passed, a value different than zero otherwise
d_outputTransportBlocks- output buffer containing the information bytes of each input transport block
d_inputCodeBlocks- input buffer containing the input code blocks
d_tbPrmsArray- array of PerTbParams structs describing each input transport block
nTBs- total number of input transport blocks
maxNCBsPerTB- Maximum number of code blocks per transport block for current launch
maxTBByteSize- Maximum size in bytes of transport block for current launch
reverseBytes- reverse order of bytes in each word before computing the CRC
timeIt- run NRUNS times and report average running time
NRUNS- number of iterations used to compute average running time
codeBlocksOnly- Only compute CRC of code blocks. Skip transport block CRC computation
strm- CUDA stream for execution
Returns
CUPHY_STATUS_SUCCESS, CUPHY_STATUS_INVALID_ARGUMENT
See also
cuphyStatus_t,cuphyCRCDecodeLaunchSetup

◆ cuphyCRCDecodeLaunchSetup()

cuphyStatus_t cuphyCRCDecodeLaunchSetup ( uint32_t  nTBs,
uint32_t  maxNCBsPerTB,
uint32_t  maxTBByteSize,
crcLaunchDescriptor crcDecodeDesc 
)

Call updates CRC launch descriptor

Returns CUPHY_STATUS_SUCCESS if execution is successful

Parameters
nTBs- total number of input transport blocks
maxNCBsPerTB- Maximum number of code blocks per transport block for current launch
maxTBByteSize- Maximum size in bytes of transport block for current launch
crcDecodeDesc- launch descriptor to be populated
Returns
CUPHY_STATUS_SUCCESS, CUPHY_STATUS_INVALID_ARGUMENT
See also
cuphyStatus_t,cuphyCRCDecode

◆ cuphyCrcEncodeGetDescrInfo()

cuphyStatus_t cuphyCrcEncodeGetDescrInfo ( size_t *  pDescrSizeBytes,
size_t *  pDescrAlignBytes 
)
Parameters
[in,out]pDescrSizeBytesSize in bytes of descriptor
[in,out]pDescrAlignBytesAlignment in bytes of descriptor
Returns
CUPHY_STATUS_SUCCESS or CUPHY_STATUS_INVALID_ARGUMENT

◆ cuphySetupCrcEncode()

cuphyStatus_t cuphySetupCrcEncode ( cuphyCrcEncodeLaunchConfig_t  crcEncodeLaunchConfig,
uint32_t *  d_cbCRCs,
uint32_t *  d_tbCRCs,
const uint32_t *  d_inputTransportBlocks,
uint8_t *  d_codeBlocks,
const PdschPerTbParams d_tbPrmsArray,
uint32_t  nTBs,
uint32_t  maxNCBsPerTB,
uint32_t  maxTBByteSize,
uint8_t  reverseBytes,
uint8_t  codeBlocksOnly,
void *  cpu_desc,
void *  gpu_desc,
uint8_t  enable_desc_async_copy,
cudaStream_t  strm 
)
Parameters
[in]crcEncodeLaunchConfigPointer to cuphyCrcEncodeLaunchConfig.
[in,out]d_cbCRCsif not nullptr, output buffer with per-CB CRCs across all TBs for debugging
[in,out]d_tbCRCsoutput buffer containing per-TB CRCs across all TBS (needed by CB kernel)
[in]d_inputTransportBlocksinput buffer; currently prepared via cuphyPrepareCRCEncode
[out]d_codeBlocksCRC output
[in,out]d_tbPrmsArrayarray of PdschPerTbParams structs describing each input transport block.
[in]nTBsnumber of TBs handled in a kernel launch
[in]maxNCBsPerTBmaximum number of code blocks per transport block for current launch
[in]maxTBByteSizemaximum size in bytes of transport block for current launch
[in]reverseBytesreverse order of bytes in each word before computing CRC
[in]codeBlocksOnlyonly compute CRC of code blocks (CBs); skip transport block CRC computation.
[in]cpu_descPointer to descriptor in CPU memory
[in]gpu_descPointer to descriptor in GPU memory
[in]enable_desc_async_copyasync copy CPU descriptor into GPU if set.
[in]strmCUDA stream for async copy
Returns
CUPHY_STATUS_SUCCESS or CUPHY_STATUS_INVALID_ARGUMENT