aboutsummaryrefslogtreecommitdiff
path: root/examples/graph_vgg16.cpp
diff options
context:
space:
mode:
authorGian Marco Iodice <gianmarco.iodice@arm.com>2018-04-11 10:58:31 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:51:17 +0000
commit1ed442a9b4024741860106cd96f5f7535a38fd04 (patch)
treec4419214f3ea254a9e934eada9c59c9328cb3658 /examples/graph_vgg16.cpp
parentd8cde8582a2a87959c9ca40fb23cf84328727d06 (diff)
downloadComputeLibrary-1ed442a9b4024741860106cd96f5f7535a38fd04.tar.gz
COMPMID-1046 - Enabling Winograd VGG19 to use Winograd on NEON and OpenCL
Change-Id: If8a28fc6a3a58473df51c8e7399e6d06d0db10f9 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/127384 Reviewed-by: Anthony Barbier <anthony.barbier@arm.com> Tested-by: Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'examples/graph_vgg16.cpp')
-rw-r--r--examples/graph_vgg16.cpp24
1 files changed, 4 insertions, 20 deletions
diff --git a/examples/graph_vgg16.cpp b/examples/graph_vgg16.cpp
index 82be97c316..9e8e69411f 100644
--- a/examples/graph_vgg16.cpp
+++ b/examples/graph_vgg16.cpp
@@ -32,20 +32,6 @@ using namespace arm_compute::utils;
using namespace arm_compute::graph::frontend;
using namespace arm_compute::graph_utils;
-namespace
-{
-/** This function checks if we can use GEMM-based convolution trying to allocate a memory of size "size_in_bytes"
- *
- * @param[in] size_in_bytes Memory size in bytes needed for VGG-16
- *
- * @return The convolution layer hint
- */
-ConvolutionMethod convolution_hint_vgg16(size_t size_in_bytes)
-{
- return ((get_mem_free_from_meminfo() * 1024) >= size_in_bytes) ? ConvolutionMethod::GEMM : ConvolutionMethod::DIRECT;
-}
-} // namespace
-
/** Example demonstrating how to implement VGG16's network using the Compute Library's graph API
*
* @param[in] argc Number of arguments
@@ -65,14 +51,12 @@ public:
std::unique_ptr<IPreprocessor> preprocessor = arm_compute::support::cpp14::make_unique<CaffePreproccessor>(mean_rgb);
// Set target. 0 (NEON), 1 (OpenCL), 2 (OpenCL with Tuner). By default it is NEON
- const int target = argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0;
- Target target_hint = set_target_hint(target);
+ const int target = argc > 1 ? std::strtol(argv[1], nullptr, 10) : 0;
+ Target target_hint = set_target_hint(target);
+ const bool is_opencl = target_hint == Target::CL;
- // Check if we can use GEMM-based convolutions evaluating if the platform has at least 1.8 GB of available memory
- const size_t memory_required = 1932735283L;
- const bool is_opencl = target_hint == Target::CL;
ConvolutionMethod first_convolution3x3_hint = is_opencl ? ConvolutionMethod::DIRECT : ConvolutionMethod::GEMM;
- ConvolutionMethod convolution3x3_hint = is_opencl ? ConvolutionMethod::WINOGRAD : convolution_hint_vgg16(memory_required);
+ ConvolutionMethod convolution3x3_hint = ConvolutionMethod::DEFAULT;
// Parse arguments
if(argc < 2)