diff options
Diffstat (limited to 'compute_kernel_writer/src/cl/CLHelpers.h')
-rw-r--r-- | compute_kernel_writer/src/cl/CLHelpers.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/compute_kernel_writer/src/cl/CLHelpers.h b/compute_kernel_writer/src/cl/CLHelpers.h index 669424088e..3c1a7724e2 100644 --- a/compute_kernel_writer/src/cl/CLHelpers.h +++ b/compute_kernel_writer/src/cl/CLHelpers.h @@ -24,8 +24,11 @@ #ifndef CKW_SRC_CL_CLHELPERS_H #define CKW_SRC_CL_CLHELPERS_H +#include "ckw/types/Operators.h" + #include <cstdint> #include <string> +#include <tuple> #include <vector> /** OpenCL specific helper functions */ @@ -52,6 +55,24 @@ bool cl_validate_vector_length(int32_t len); */ std::string cl_get_variable_datatype_as_string(DataType dt, int32_t len); +/** Return the assignment operator in OpenCL language. + * + * @param[in] op The assignment operator. + * + * @return The operator in OpenCL language as a string. + */ +std::string cl_get_assignment_op_as_string(AssignmentOp op); + +/** Return the information about the unary operation. + * + * The result contains: + * - is_func: true if it's a function and false if it's an unary operator in OpenCL language. + * - str: the function name or the operator in OpenCL language. + * + * @param[in] op The unary operator. + */ +std::tuple<bool, std::string> cl_get_unary_op(UnaryOp op); + /** Helper function to return the OpenCL vector size that accommodate the the desired width * * @param[in] width The desired width |