You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					105 lines
				
				2.5 KiB
			
		
		
			
		
	
	
					105 lines
				
				2.5 KiB
			| 
								 
											6 years ago
										 
									 | 
							
								//==============================================================================
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								//  Copyright (c) 2015-2016 Qualcomm Technologies, Inc.
							 | 
						||
| 
								 | 
							
								//  All Rights Reserved.
							 | 
						||
| 
								 | 
							
								//  Confidential and Proprietary - Qualcomm Technologies, Inc.
							 | 
						||
| 
								 | 
							
								//
							 | 
						||
| 
								 | 
							
								//==============================================================================
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#ifndef _SNPE_FACTORY_HPP_
							 | 
						||
| 
								 | 
							
								#define _SNPE_FACTORY_HPP_
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "SNPE/SNPE.hpp"
							 | 
						||
| 
								 | 
							
								#include "DlSystem/DlEnums.hpp"
							 | 
						||
| 
								 | 
							
								#include "DlSystem/UDLFunc.hpp"
							 | 
						||
| 
								 | 
							
								#include "DlSystem/ZdlExportDefine.hpp"
							 | 
						||
| 
								 | 
							
								#include "DlSystem/DlOptional.hpp"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace zdl {
							 | 
						||
| 
								 | 
							
								   namespace DlSystem
							 | 
						||
| 
								 | 
							
								   {
							 | 
						||
| 
								 | 
							
								      class ITensorFactory;
							 | 
						||
| 
								 | 
							
								      class IUserBufferFactory;
							 | 
						||
| 
								 | 
							
								   }
							 | 
						||
| 
								 | 
							
								   namespace DlContainer
							 | 
						||
| 
								 | 
							
								   {
							 | 
						||
| 
								 | 
							
								      class IDlContainer;
							 | 
						||
| 
								 | 
							
								   }
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								namespace zdl { namespace SNPE {
							 | 
						||
| 
								 | 
							
								/** @addtogroup c_plus_plus_apis C++
							 | 
						||
| 
								 | 
							
								@{ */
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * The factory class for creating SNPE objects.
							 | 
						||
| 
								 | 
							
								 *
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								class ZDL_EXPORT SNPEFactory
							 | 
						||
| 
								 | 
							
								{
							 | 
						||
| 
								 | 
							
								public:
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								   /**
							 | 
						||
| 
								 | 
							
								    * Indicates whether the supplied runtime is available on the 
							 | 
						||
| 
								 | 
							
								    * current platform.
							 | 
						||
| 
								 | 
							
								    * 
							 | 
						||
| 
								 | 
							
								    * @param[in] runtime The target runtime to check.
							 | 
						||
| 
								 | 
							
								    *    
							 | 
						||
| 
								 | 
							
								    * @return True if the supplied runtime is available; false, 
							 | 
						||
| 
								 | 
							
								    *         otherwise.
							 | 
						||
| 
								 | 
							
								    */
							 | 
						||
| 
								 | 
							
								   static bool isRuntimeAvailable(zdl::DlSystem::Runtime_t runtime);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								   /**
							 | 
						||
| 
								 | 
							
								    * Gets a reference to the tensor factory.
							 | 
						||
| 
								 | 
							
								    * 
							 | 
						||
| 
								 | 
							
								    * @return A reference to the tensor factory.
							 | 
						||
| 
								 | 
							
								    */
							 | 
						||
| 
								 | 
							
								   static zdl::DlSystem::ITensorFactory& getTensorFactory();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								   /**
							 | 
						||
| 
								 | 
							
								    * Gets a reference to the UserBuffer factory.
							 | 
						||
| 
								 | 
							
								    *
							 | 
						||
| 
								 | 
							
								    * @return A reference to the UserBuffer factory.
							 | 
						||
| 
								 | 
							
								    */
							 | 
						||
| 
								 | 
							
								   static zdl::DlSystem::IUserBufferFactory& getUserBufferFactory();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								   /**
							 | 
						||
| 
								 | 
							
								    * Gets the version of the SNPE library.
							 | 
						||
| 
								 | 
							
								    *
							 | 
						||
| 
								 | 
							
								    * @return Version of the SNPE library.
							 | 
						||
| 
								 | 
							
								    *
							 | 
						||
| 
								 | 
							
								    */
							 | 
						||
| 
								 | 
							
								   static zdl::DlSystem::Version_t getLibraryVersion();
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								   /**
							 | 
						||
| 
								 | 
							
								    * Set the SNPE storage location for all SNPE instances in this
							 | 
						||
| 
								 | 
							
								    * process. Note that this may only be called once, and if so
							 | 
						||
| 
								 | 
							
								    * must be called before creating any SNPE instances.
							 | 
						||
| 
								 | 
							
								    *
							 | 
						||
| 
								 | 
							
								    * @param[in] storagePath Absolute path to a directory which SNPE may
							 | 
						||
| 
								 | 
							
								    *  use for caching and other storage purposes.
							 | 
						||
| 
								 | 
							
								    *
							 | 
						||
| 
								 | 
							
								    * @return True if the supplied path was succesfully set as
							 | 
						||
| 
								 | 
							
								    *  the SNPE storage location, false otherwise.
							 | 
						||
| 
								 | 
							
								    */
							 | 
						||
| 
								 | 
							
								   static bool setSNPEStorageLocation(const char* storagePath);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								   /**
							 | 
						||
| 
								 | 
							
								    * Indicates whether the OpenGL and OpenCL interoperability is supported
							 | 
						||
| 
								 | 
							
								    * on GPU platform.
							 | 
						||
| 
								 | 
							
								    *
							 | 
						||
| 
								 | 
							
								    * @return True if the OpenGL and OpenCl interop is supported; false,
							 | 
						||
| 
								 | 
							
								    *         otherwise.
							 | 
						||
| 
								 | 
							
								    */
							 | 
						||
| 
								 | 
							
								   static bool isGLCLInteropSupported();
							 | 
						||
| 
								 | 
							
								};
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/** @} */ /* end_addtogroup c_plus_plus_apis C++ */
							 | 
						||
| 
								 | 
							
								}}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#endif
							 |