diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2018-07-03 12:06:23 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:54:10 +0000 |
commit | 12be7ab4876f77fecfab903df70791623219b3da (patch) | |
tree | 1cfa6852e60948bee9db0831a9f3abc97a2031c8 /utils/Utils.h | |
parent | e39334c15c7fd141bb8173d5017ea5ca157fca2c (diff) | |
download | ComputeLibrary-12be7ab4876f77fecfab903df70791623219b3da.tar.gz |
COMPMID-1310: Create graph validation executables.
Change-Id: I9e0b57b1b83fe5a95777cdaeddba6ecef650bafc
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/138697
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'utils/Utils.h')
-rw-r--r-- | utils/Utils.h | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/utils/Utils.h b/utils/Utils.h index c18ad217a4..ced6b147f1 100644 --- a/utils/Utils.h +++ b/utils/Utils.h @@ -55,6 +55,14 @@ namespace arm_compute { namespace utils { +/** Supported image types */ +enum class ImageType +{ + UNKNOWN, + PPM, + JPEG +}; + /** Abstract Example class. * * All examples have to inherit from this class. @@ -66,8 +74,13 @@ public: * * @param[in] argc Argument count. * @param[in] argv Argument values. + * + * @return True in case of no errors in setup else false */ - virtual void do_setup(int argc, char **argv) {}; + virtual bool do_setup(int argc, char **argv) + { + return true; + }; /** Run the example. */ virtual void do_run() {}; /** Teardown the example. */ @@ -101,6 +114,14 @@ int run_example(int argc, char **argv) */ void draw_detection_rectangle(arm_compute::ITensor *tensor, const arm_compute::DetectionWindow &rect, uint8_t r, uint8_t g, uint8_t b); +/** Gets image type given a file + * + * @param[in] filename File to identify its image type + * + * @return Image type + */ +ImageType get_image_type_from_file(const std::string &filename); + /** Parse the ppm header from an input file stream. At the end of the execution, * the file position pointer will be located at the first pixel stored in the ppm file * @@ -167,7 +188,7 @@ inline std::string get_typestring(DataType data_type) case DataType::SIZET: return endianness + "u" + support::cpp11::to_string(sizeof(size_t)); default: - ARM_COMPUTE_ERROR("NOT SUPPORTED!"); + ARM_COMPUTE_ERROR("Data type not supported"); } } |