diff options
Diffstat (limited to 'examples/graph_squeezenet.cpp')
-rw-r--r-- | examples/graph_squeezenet.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/examples/graph_squeezenet.cpp b/examples/graph_squeezenet.cpp index d38cec28c4..51c4de0ec1 100644 --- a/examples/graph_squeezenet.cpp +++ b/examples/graph_squeezenet.cpp @@ -21,22 +21,15 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef ARM_COMPUTE_CL /* Needed by Utils.cpp to handle OpenCL exceptions properly */ -#error "This example needs to be built with -DARM_COMPUTE_CL" -#endif /* ARM_COMPUTE_CL */ #include "arm_compute/graph/Graph.h" #include "arm_compute/graph/Nodes.h" #include "arm_compute/graph/SubGraph.h" -#include "arm_compute/runtime/CL/CLScheduler.h" -#include "arm_compute/runtime/Scheduler.h" #include "support/ToolchainSupport.h" #include "utils/GraphUtils.h" #include "utils/Utils.h" #include <cstdlib> -#include <iostream> -#include <memory> #include <tuple> using namespace arm_compute::graph; @@ -109,14 +102,15 @@ void main_graph_squeezenet(int argc, const char **argv) } // Check if OpenCL is available and initialize the scheduler - if(arm_compute::opencl_is_available()) + TargetHint hint = TargetHint::NEON; + if(Graph::opencl_is_available()) { - arm_compute::CLScheduler::get().default_init(); + hint = TargetHint::OPENCL; } Graph graph; - graph << TargetHint::OPENCL + graph << hint << Tensor(TensorInfo(TensorShape(224U, 224U, 3U, 1U), 1, DataType::F32), get_input_accessor(image, mean_r, mean_g, mean_b)) << ConvolutionLayer( |