Skip to content

Commit

Permalink
Fully disable Force Array Output Modification for Auto Path (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
mzhukova authored Nov 14, 2024
1 parent 0b6a68d commit 970be45
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,9 @@ is returned as a bit vector. However, if the flag
:c:macro:`QPL_FLAG_FORCE_ARRAY_OUTPUT` is specified, the output is returned
as an array of a bit width defined by the :c:member:`qpl_job.output_bit_width`
field. Use this feature to receive the output as an array of a larger bit width
when the output is expected to have a bit width of 1 bit. This feature is only
supported on the hardware path for Intel® In-Memory Analytics Accelerator 2.0 and later.
when the output is expected to have a bit width of 1 bit.

.. attention::

This feature is only supported on the ``Hardware Path`` and Intel® In-Memory Analytics Accelerator 2.0 and later.

Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ auto main(int argc, char** argv) -> int {
status = qpl_execute_job(job);
if (status == QPL_STS_NOT_SUPPORTED_MODE_ERR) {
std::cout
<< "Force Array Output Modification is not supported. This feature is only available on Intel® In-Memory Analytics Accelerator (Intel® IAA) 2.0 with Hardware Path.\n";
std::cout << "Note that Force Array Output Modification is supported only in Hardware Path.\n";
<< "Force Array Output Modification is not supported. This feature is only available on Intel® In-Memory Analytics Accelerator (Intel® IAA) 2.0 and Hardware Path.\n";
return 0;
} else if (status == QPL_STS_OUT_FORMAT_ERR) {
std::cout
Expand Down
3 changes: 2 additions & 1 deletion include/qpl/c_api/defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ extern "C" {
#define QPL_FLAG_OMIT_AGGREGATES 0x00200000U

/**
* Filtering only: Force Array Output Mod
* Filtering only: Force output to be returned as an array of a bit width defined by the output_bit_width
* @note Only supported on the Hardware Path
*/
#define QPL_FLAG_FORCE_ARRAY_OUTPUT 0x00800000U

Expand Down
6 changes: 0 additions & 6 deletions sources/c_api/filter_operations/arguments_check.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,6 @@ static inline qpl_status bad_arguments_check(const qpl_job* const job_ptr) {
return QPL_STS_NOT_SUPPORTED_MODE_ERR;
}

// Check if running on hardware path when the force array output flag is set
if ((job_ptr->flags & QPL_FLAG_FORCE_ARRAY_OUTPUT) && job_ptr->data_ptr.path != qpl_path_hardware) {
// If the force array output mod flag is set and NOT running on hardware path, return unsupported error
return QPL_STS_NOT_SUPPORTED_MODE_ERR;
}

uint32_t source_bit_width = job_ptr->src1_bit_width;
const bool source_bit_width_is_unknown =
(qpl_p_parquet_rle == job_ptr->parser && (QPL_FLAG_DECOMPRESS_ENABLE & job_ptr->flags));
Expand Down
2 changes: 1 addition & 1 deletion sources/c_api/job.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ static inline bool is_sw_fallback_supported(const qpl_job* const qpl_job_ptr, qp
// Check if Force Array Output Modification is supported
static inline bool is_force_array_output_supported(const qpl_job* const job_ptr) noexcept {
// Check if job_ptr and hw_state_ptr are not null
if (job_ptr != nullptr && job_ptr->data_ptr.path != qpl_path_software &&
if (job_ptr != nullptr && job_ptr->data_ptr.path != qpl_path_software && job_ptr->data_ptr.path != qpl_path_auto &&
job_ptr->data_ptr.hw_state_ptr != nullptr) {
// Check if force array output modification is supported
return ((qpl_hw_state*)job_ptr->data_ptr.hw_state_ptr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(expand, analytic_with_decompression, Expan

// Force Array Output Modification Test
QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(expand, force_array_output_modification, ExpandTest) {
// Force array output modification not available on Software or Auto Paths
QPL_SKIP_TEST_FOR(qpl_path_software);
QPL_SKIP_TEST_FOR(qpl_path_auto);

// Assert that Force Array Output Modification is supported
QPL_SKIP_TEST_FOR_EXPR_VERBOSE(is_iaa_force_array_output_mod_supported() == false,
"Force array output modification not available on device, skipping test.");

// Skip test if on software path
QPL_SKIP_TEST_FOR_VERBOSE(qpl_path_software, "Force array output modification not available on software path");

// Constants
const uint32_t source_size = 5U;
const uint32_t mask_byte_length = 1U;
Expand All @@ -138,13 +139,13 @@ QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(expand, force_array_output_modification, E
uint32_t size = 0U;

// Job initialization
qpl_status status = qpl_get_job_size(qpl_path_hardware, &size);
qpl_status status = qpl_get_job_size(GetExecutionPath(), &size);
ASSERT_EQ(QPL_STS_OK, status) << "An error " << status << " acquired during job size getting.\n";

job_buffer = std::make_unique<uint8_t[]>(size);
qpl_job* job = reinterpret_cast<qpl_job*>(job_buffer.get());

status = qpl_init_job(qpl_path_hardware, job);
status = qpl_init_job(GetExecutionPath(), job);
ASSERT_EQ(QPL_STS_OK, status) << "An error " << status << " acquired during job initializing.\n";

// Performing an operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,14 @@ QPL_LOW_LEVEL_API_ALGORITHMIC_TEST(parquet_extract, bitwidth_mismatch_non_octa_g
// The test creates a source vector with 64 elements, and extracts a range of elements from index 16 to 47
// The output will be extended to the force array output modification, and the output will be verified
QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(extract, force_array_output_modification, ExtractTest) {
// Force array output modification not available on Software or Auto Paths
QPL_SKIP_TEST_FOR(qpl_path_software);
QPL_SKIP_TEST_FOR(qpl_path_auto);

// Assert that Force Array Output Modification is supported
QPL_SKIP_TEST_FOR_EXPR_VERBOSE(is_iaa_force_array_output_mod_supported() == false,
"Force array output modification not available on device, skipping test.");

// Skip test if on software path
QPL_SKIP_TEST_FOR_VERBOSE(qpl_path_software, "Force array output modification not available on software path");

constexpr const uint32_t source_size = 64;
constexpr const uint32_t input_vector_width = 8;
constexpr const uint32_t lower_index = 16;
Expand All @@ -347,13 +348,13 @@ QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(extract, force_array_output_modification,
}

// Job initialization
qpl_status status = qpl_get_job_size(qpl_path_hardware, &size);
qpl_status status = qpl_get_job_size(GetExecutionPath(), &size);
ASSERT_EQ(QPL_STS_OK, status) << "An error " << status << " acquired during job size getting.\n";

job_buffer = std::make_unique<uint8_t[]>(size);
qpl_job* job = reinterpret_cast<qpl_job*>(job_buffer.get());

status = qpl_init_job(qpl_path_hardware, job);
status = qpl_init_job(GetExecutionPath(), job);
ASSERT_EQ(QPL_STS_OK, status) << "An error " << status << " acquired during job initializing.\n";

// Performing an operation
Expand Down
11 changes: 6 additions & 5 deletions tools/tests/functional/algorithmic_tests/low_level_api/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,14 @@ QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(scan, scan_range_initial_output_index, Sca
// The test performs a scan operation with the Force Array Output Modification enabled.
// The test checks if the output matches the reference value.
QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(scan, force_array_output_modification, ScanTest) {
// Force array output modification not available on Software or Auto Paths
QPL_SKIP_TEST_FOR(qpl_path_software);
QPL_SKIP_TEST_FOR(qpl_path_auto);

// Assert that Force Array Output Modification is supported
QPL_SKIP_TEST_FOR_EXPR_VERBOSE(is_iaa_force_array_output_mod_supported() == false,
"Force array output modification not available on device, skipping test.");

// Skip test if on software path
QPL_SKIP_TEST_FOR_VERBOSE(qpl_path_software, "Force array output modification not available on software path");

constexpr const uint32_t source_size = 64; // 64 elements
constexpr const uint32_t input_vector_width = 8; // 8-bit values
constexpr const uint32_t output_vector_width = 32; // 32-bit values (because of Force Array Output Mod)
Expand All @@ -425,13 +426,13 @@ QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(scan, force_array_output_modification, Sca
}

// Job initialization
qpl_status status = qpl_get_job_size(qpl_path_hardware, &size);
qpl_status status = qpl_get_job_size(GetExecutionPath(), &size);
ASSERT_EQ(QPL_STS_OK, status) << "An error " << status << " acquired during job size getting.\n";

job_buffer = std::make_unique<uint8_t[]>(size);
qpl_job* job = reinterpret_cast<qpl_job*>(job_buffer.get());

status = qpl_init_job(qpl_path_hardware, job);
status = qpl_init_job(GetExecutionPath(), job);
ASSERT_EQ(QPL_STS_OK, status) << "An error " << status << " acquired during job initializing.\n";

// Performing an operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,14 @@ QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(select, analytic_with_decompress, SelectTe
// The select operation is performed on the source array with the mask
// The output is an array with values from the source array where the mask is set
QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(select, force_array_output_modification, SelectTest) {
// Force array output modification not available on Software or Auto Paths
QPL_SKIP_TEST_FOR(qpl_path_software);
QPL_SKIP_TEST_FOR(qpl_path_auto);

// Assert that Force Array Output Modification is supported
QPL_SKIP_TEST_FOR_EXPR_VERBOSE(is_iaa_force_array_output_mod_supported() == false,
"Force array output modification not available on device, skipping test.");

// Skip test if on software path
QPL_SKIP_TEST_FOR_VERBOSE(qpl_path_software, "Force array output modification not available on software path");

constexpr const uint32_t source_size = 64; // Upper boundary for select
constexpr const uint32_t input_vector_width = 8;
constexpr const uint32_t select_output_vector_width = 1;
Expand Down Expand Up @@ -161,13 +162,13 @@ QPL_LOW_LEVEL_API_ALGORITHMIC_TEST_TC(select, force_array_output_modification, S
select_mask[7] = 222;

// Job initialization
qpl_status status = qpl_get_job_size(qpl_path_hardware, &size);
qpl_status status = qpl_get_job_size(GetExecutionPath(), &size);
ASSERT_EQ(QPL_STS_OK, status) << "An error " << status << " acquired during job size getting.\n";

job_buffer = std::make_unique<uint8_t[]>(size);
qpl_job* job = reinterpret_cast<qpl_job*>(job_buffer.get());

status = qpl_init_job(qpl_path_hardware, job);
status = qpl_init_job(GetExecutionPath(), job);
ASSERT_EQ(QPL_STS_OK, status) << "An error " << status << " acquired during job initializing.\n";

// Performing a select operation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,12 @@ QPL_LOW_LEVEL_API_BAD_ARGUMENT_TEST(expand, buffer_overlap) {

// If flag is set, output bit width is nominal, QPL_STS_OUT_FORMAT_ERR is expected
QPL_LOW_LEVEL_API_BAD_ARGUMENT_TEST(expand, force_array_output_nominal) {
// Force array output modification not available on Software or Auto Paths
QPL_SKIP_TEST_FOR(qpl_path_software);
QPL_SKIP_TEST_FOR(qpl_path_auto);

QPL_SKIP_TEST_FOR_EXPR_VERBOSE(is_iaa_force_array_output_mod_supported() == false,
"Force array output modification is not supported. Skip the test.");
QPL_SKIP_TEST_FOR_VERBOSE(qpl_path_software, "Force array output modification not available on software path");

std::array<uint8_t, SOURCE_ARRAY_SIZE> source {};
std::array<uint8_t, MASK_ARRAY_SIZE> mask {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,12 @@ QPL_LOW_LEVEL_API_BAD_ARGUMENT_TEST(extract, drop_initial_bytes) {

// If flag is set, output bit width is nominal, QPL_STS_OUT_FORMAT_ERR is expected
QPL_LOW_LEVEL_API_BAD_ARGUMENT_TEST(extract, force_array_output_nominal) {
// Force array output modification not available on Software or Auto Paths
QPL_SKIP_TEST_FOR(qpl_path_software);
QPL_SKIP_TEST_FOR(qpl_path_auto);

QPL_SKIP_TEST_FOR_EXPR_VERBOSE(is_iaa_force_array_output_mod_supported() == false,
"Force array output modification is not supported. Skip the test.");
QPL_SKIP_TEST_FOR_VERBOSE(qpl_path_software, "Force array output modification not available on software path");

std::array<uint8_t, SOURCE_ARRAY_SIZE> source {};
std::array<uint8_t, MASK_ARRAY_SIZE> mask {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,12 @@ QPL_LOW_LEVEL_API_BAD_ARGUMENT_TEST(scan, drop_initial_bytes) {

// If flag is set, output bit width is nominal, QPL_STS_OUT_FORMAT_ERR is expected
QPL_LOW_LEVEL_API_BAD_ARGUMENT_TEST(scan, force_array_output_nominal) {
// Force array output modification not available on Software or Auto Paths
QPL_SKIP_TEST_FOR(qpl_path_software);
QPL_SKIP_TEST_FOR(qpl_path_auto);

QPL_SKIP_TEST_FOR_EXPR_VERBOSE(is_iaa_force_array_output_mod_supported() == false,
"Force array output modification is not supported. Skip the test.");
QPL_SKIP_TEST_FOR_VERBOSE(qpl_path_software, "Force array output modification not available on software path");

qpl::test::random random_scan_operation(qpl_op_scan_eq, qpl_op_scan_not_range,
TestEnviroment::GetInstance().GetSeed());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,12 @@ QPL_LOW_LEVEL_API_BAD_ARGUMENT_TEST(select, buffer_overlap) {

// If flag is set, output bit width is nominal, QPL_STS_OUT_FORMAT_ERR is expected
QPL_LOW_LEVEL_API_BAD_ARGUMENT_TEST(select, force_array_output_nominal) {
// Force array output modification not available on Software or Auto Paths
QPL_SKIP_TEST_FOR(qpl_path_software);
QPL_SKIP_TEST_FOR(qpl_path_auto);

QPL_SKIP_TEST_FOR_EXPR_VERBOSE(is_iaa_force_array_output_mod_supported() == false,
"Force array output modification is not supported. Skip the test.");
QPL_SKIP_TEST_FOR_VERBOSE(qpl_path_software, "Force array output modification not available on software path");

std::array<uint8_t, SOURCE_ARRAY_SIZE> source {};
std::array<uint8_t, MASK_ARRAY_SIZE> mask {};
Expand Down

0 comments on commit 970be45

Please sign in to comment.