+TEST_P(BfpCheck, AVX512_cp_sweep_xranlib)
+{
+ int32_t resSum = 0;
+ int16_t len = 0;
+
+ int16_t compMethod = XRAN_COMPMETHOD_BLKFLOAT;
+ int16_t iqWidth[] = {8, 9, 10, 12};
+ int16_t numRB = 1;
+ int16_t antElm[] = {8, 16, 32, 64};
+
+ struct xranlib_decompress_request bfp_decom_req;
+ struct xranlib_decompress_response bfp_decom_rsp;
+
+ struct xranlib_compress_request bfp_com_req;
+ struct xranlib_compress_response bfp_com_rsp;
+ int32_t numDataElements;
+
+ // Create random number generator
+ std::random_device rd;
+ std::mt19937 gen(rd()); //Standard mersenne_twister_engine seeded with rd()
+ std::uniform_int_distribution<int16_t> randInt16(-32768, 32767);
+ std::uniform_int_distribution<int> randExpShift(0, 4);
+
+ BlockFloatCompander::ExpandedData expandedData;
+ expandedData.dataExpanded = &loc_dataExpandedIn[0];
+ BlockFloatCompander::ExpandedData expandedDataRes;
+ expandedDataRes.dataExpanded = &loc_dataExpandedRes[0];
+
+ for (int iq_w_id = 0; iq_w_id < sizeof(iqWidth)/sizeof(iqWidth[0]); iq_w_id ++){
+ for (int tc = 0; tc < sizeof(antElm)/sizeof(antElm[0]); tc ++){
+
+ numDataElements = 2*antElm[tc];
+
+ // Generate input data
+ for (int m = 0; m < numRB; ++m)
+ {
+ auto shiftVal = randExpShift(gen);
+ for (int n = 0; n < numDataElements; ++n)
+ {
+ expandedData.dataExpanded[m * numDataElements + n] = int16_t(randInt16(gen) >> shiftVal);
+ }
+ }
+
+ BlockFloatCompander::CompressedData compressedData;
+ compressedData.dataCompressed = &loc_dataCompressedDataOut[0];
+
+ std::memset(&loc_dataCompressedDataOut[0], 0, 288*numDataElements);
+ std::memset(&loc_dataExpandedRes[0], 0, 288*numDataElements);
+
+ std::memset(&bfp_com_req, 0, sizeof(struct xranlib_compress_request));
+ std::memset(&bfp_com_rsp, 0, sizeof(struct xranlib_compress_response));
+ std::memset(&bfp_decom_req, 0, sizeof(struct xranlib_decompress_request));
+ std::memset(&bfp_decom_rsp, 0, sizeof(struct xranlib_decompress_response));
+
+ bfp_com_req.data_in = (int16_t *)expandedData.dataExpanded;
+ bfp_com_req.numRBs = numRB;
+ bfp_com_req.numDataElements = numDataElements;
+ bfp_com_req.len = antElm[tc]*4;
+ bfp_com_req.compMethod = compMethod;
+ bfp_com_req.iqWidth = iqWidth[iq_w_id];
+
+ bfp_com_rsp.data_out = (int8_t *)(compressedData.dataCompressed);
+ bfp_com_rsp.len = 0;
+
+ xranlib_compress_avx512_bfw(&bfp_com_req, &bfp_com_rsp);
+
+ bfp_decom_req.data_in = (int8_t *)(compressedData.dataCompressed);
+ bfp_decom_req.numRBs = numRB;
+ bfp_decom_req.numDataElements = numDataElements;
+ bfp_decom_req.len = bfp_com_rsp.len;
+ bfp_decom_req.compMethod = compMethod;
+ bfp_decom_req.iqWidth = iqWidth[iq_w_id];
+
+ bfp_decom_rsp.data_out = (int16_t *)expandedDataRes.dataExpanded;
+ bfp_decom_rsp.len = 0;
+
+ xranlib_decompress_avx512_bfw(&bfp_decom_req, &bfp_decom_rsp);
+
+ resSum += checkDataApprox(expandedData.dataExpanded, expandedDataRes.dataExpanded, numRB*numDataElements);
+
+ ASSERT_EQ(antElm[tc]*4, bfp_decom_rsp.len);
+ ASSERT_EQ(0, resSum);
+ }
+ }
+}
+