diff options
author | Gian Marco <gianmarco.iodice@arm.com> | 2017-12-12 10:08:38 +0000 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:42:33 +0000 |
commit | bfa3b52de2cfbd330efc19e2096134a20c645406 (patch) | |
tree | 30812054cbeaa87a268bb21174402d3b2ec199d4 /utils/GraphUtils.h | |
parent | 397252889a2d7e7d9d241ee9dcecff3edf2bcff7 (diff) | |
download | ComputeLibrary-bfa3b52de2cfbd330efc19e2096134a20c645406.tar.gz |
COMPMID-556 - Fix examples
- Fixed data type issue in cl_sgemm
- Added support for NEON and OpenCL targets in graph examples. Before we
could run only OpenCL target
- Add auto_init() in NEDepthwiseVectorToTensorKernel
Change-Id: I4410ce6f4992b2375b980634fe55f1083cf3c471
Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/112850
Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com>
Diffstat (limited to 'utils/GraphUtils.h')
-rw-r--r-- | utils/GraphUtils.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/utils/GraphUtils.h b/utils/GraphUtils.h index d7d5cd6778..429394d1cc 100644 --- a/utils/GraphUtils.h +++ b/utils/GraphUtils.h @@ -25,6 +25,7 @@ #define __ARM_COMPUTE_GRAPH_UTILS_H__ #include "arm_compute/core/PixelValue.h" +#include "arm_compute/graph/Graph.h" #include "arm_compute/graph/ITensorAccessor.h" #include "arm_compute/graph/Types.h" @@ -220,6 +221,26 @@ inline std::unique_ptr<graph::ITensorAccessor> get_input_accessor(const std::str } } +/** Utility function to return the TargetHint + * + * @param[in] target Integer value which expresses the selected target. Must be 0 for NEON or 1 for OpenCL + * + * @return the TargetHint + */ +inline graph::TargetHint set_target_hint(int target) +{ + ARM_COMPUTE_ERROR_ON_MSG(target > 1, "Invalid target. Target must be 0 (NEON) or 1 (OpenCL)"); + if(target == 1 && graph::Graph::opencl_is_available()) + { + // If type of target is OpenCL, check if OpenCL is available and initialize the scheduler + return graph::TargetHint::OPENCL; + } + else + { + return graph::TargetHint::NEON; + } +} + /** Generates appropriate output accessor according to the specified labels_path * * @note If labels_path is empty will generate a DummyAccessor else will generate a TopNPredictionsAccessor |