diff options
author | Gian Marco Iodice <gianmarco.iodice@arm.com> | 2018-04-11 10:58:31 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:51:17 +0000 |
commit | 1ed442a9b4024741860106cd96f5f7535a38fd04 (patch) | |
tree | c4419214f3ea254a9e934eada9c59c9328cb3658 /examples/graph_vgg19.cpp | |
parent | d8cde8582a2a87959c9ca40fb23cf84328727d06 (diff) | |
download | ComputeLibrary-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_vgg19.cpp')
-rw-r--r-- | examples/graph_vgg19.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/examples/graph_vgg19.cpp b/examples/graph_vgg19.cpp index 28e1a0fe04..fed2c806ee 100644 --- a/examples/graph_vgg19.cpp +++ b/examples/graph_vgg19.cpp @@ -51,8 +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; + + ConvolutionMethod first_convolution3x3_hint = is_opencl ? ConvolutionMethod::DIRECT : ConvolutionMethod::GEMM; + ConvolutionMethod convolution3x3_hint = ConvolutionMethod::DEFAULT; // Parse arguments if(argc < 2) @@ -87,6 +91,7 @@ public: } graph << target_hint + << first_convolution3x3_hint << InputLayer(TensorDescriptor(TensorShape(224U, 224U, 3U, 1U), DataType::F32), get_input_accessor(image, std::move(preprocessor))) // Layer 1 @@ -96,6 +101,7 @@ public: get_weights_accessor(data_path, "/cnn_data/vgg19_model/conv1_1_b.npy"), PadStrideInfo(1, 1, 1, 1)) << ActivationLayer(ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)) + << convolution3x3_hint << ConvolutionLayer( 3U, 3U, 64U, get_weights_accessor(data_path, "/cnn_data/vgg19_model/conv1_2_w.npy"), |