diff options
author | Michalis Spyrou <michalis.spyrou@arm.com> | 2021-04-20 11:26:21 +0100 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2021-04-21 20:48:28 +0000 |
commit | 402740da11c4fd2a9dc7aee5dadf3b1fdda0afde (patch) | |
tree | 61501d2f0af7115b87d26907d6ca9a3d00f4ef5e /arm_compute/graph | |
parent | bff2f9f2f92bf7a8d2f7532df0329dedfbe84693 (diff) | |
download | ComputeLibrary-402740da11c4fd2a9dc7aee5dadf3b1fdda0afde.tar.gz |
Add support for CLVK
This patch enables CLVK through the graph API and inside the
CLScheduler. By default the Native platform is selected.
Selecting CLVK can be done via --target=clvk.
Resolves COMPMID-4205 and COMPMID-4206
Change-Id: Ic60744980c6b8a60e776627ea677ed46be88f656
Signed-off-by: Michalis Spyrou <michalis.spyrou@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5475
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Diffstat (limited to 'arm_compute/graph')
-rw-r--r-- | arm_compute/graph/TypePrinter.h | 3 | ||||
-rw-r--r-- | arm_compute/graph/Types.h | 24 | ||||
-rw-r--r-- | arm_compute/graph/backends/CL/CLDeviceBackend.h | 2 |
3 files changed, 19 insertions, 10 deletions
diff --git a/arm_compute/graph/TypePrinter.h b/arm_compute/graph/TypePrinter.h index 317c5a7596..0bbb4695de 100644 --- a/arm_compute/graph/TypePrinter.h +++ b/arm_compute/graph/TypePrinter.h @@ -48,6 +48,9 @@ inline ::std::ostream &operator<<(::std::ostream &os, const Target &target) case Target::CL: os << "CL"; break; + case Target::CLVK: + os << "CLVK"; + break; default: ARM_COMPUTE_ERROR("NOT_SUPPORTED!"); } diff --git a/arm_compute/graph/Types.h b/arm_compute/graph/Types.h index 4f3ce76370..7306b82a1e 100644 --- a/arm_compute/graph/Types.h +++ b/arm_compute/graph/Types.h @@ -28,6 +28,7 @@ #include "arm_compute/core/PixelValue.h" #include "arm_compute/core/Types.h" #include "arm_compute/runtime/CL/CLTunerTypes.h" +#include "arm_compute/runtime/CL/CLTypes.h" #include <limits> #include <string> @@ -37,6 +38,7 @@ namespace arm_compute namespace graph { using arm_compute::CLTunerMode; +using arm_compute::CLBackendType; using arm_compute::Status; using arm_compute::Coordinates; @@ -80,16 +82,17 @@ struct TensorDescriptor; /** Graph configuration structure */ struct GraphConfig { - bool use_function_memory_manager{ true }; /**< Use a memory manager to manage per-function auxilary memory */ - bool use_function_weights_manager{ true }; /**< Use a weights manager to manage transformed weights */ - bool use_transition_memory_manager{ true }; /**< Use a memory manager to manager transition buffer memory */ - bool use_tuner{ false }; /**< Use a tuner in tunable backends */ - bool use_synthetic_type{ false }; /**< Convert graph to a synthetic graph for a data type */ - DataType synthetic_type{ DataType::QASYMM8 }; /**< The data type of the synthetic graph */ - CLTunerMode tuner_mode{ CLTunerMode::EXHAUSTIVE }; /**< Tuner mode to be used by the CL tuner */ - int num_threads{ -1 }; /**< Number of threads to use (thread capable backends), if 0 the backend will auto-initialize, if -1 the backend will stay as it is. */ - std::string tuner_file{ "acl_tuner.csv" }; /**< File to load/store tuning values from */ - std::string mlgo_file{ "heuristics.mlgo" }; /**< Filename to load MLGO heuristics from */ + bool use_function_memory_manager{ true }; /**< Use a memory manager to manage per-function auxilary memory */ + bool use_function_weights_manager{ true }; /**< Use a weights manager to manage transformed weights */ + bool use_transition_memory_manager{ true }; /**< Use a memory manager to manager transition buffer memory */ + bool use_tuner{ false }; /**< Use a tuner in tunable backends */ + bool use_synthetic_type{ false }; /**< Convert graph to a synthetic graph for a data type */ + DataType synthetic_type{ DataType::QASYMM8 }; /**< The data type of the synthetic graph */ + CLTunerMode tuner_mode{ CLTunerMode::EXHAUSTIVE }; /**< Tuner mode to be used by the CL tuner */ + int num_threads{ -1 }; /**< Number of threads to use (thread capable backends), if 0 the backend will auto-initialize, if -1 the backend will stay as it is. */ + std::string tuner_file{ "acl_tuner.csv" }; /**< File to load/store tuning values from */ + std::string mlgo_file{ "heuristics.mlgo" }; /**< Filename to load MLGO heuristics from */ + CLBackendType backend_type{ CLBackendType::Native }; /**< CL backend type to use */ }; /**< Device target types */ @@ -98,6 +101,7 @@ enum class Target UNSPECIFIED, /**< Unspecified Target */ NEON, /**< Arm® Neon™ capable target device */ CL, /**< OpenCL capable target device */ + CLVK, /**< CLVK capable target device */ }; /** Supported Element-wise operations */ diff --git a/arm_compute/graph/backends/CL/CLDeviceBackend.h b/arm_compute/graph/backends/CL/CLDeviceBackend.h index 82c0eacd11..278a8e5031 100644 --- a/arm_compute/graph/backends/CL/CLDeviceBackend.h +++ b/arm_compute/graph/backends/CL/CLDeviceBackend.h @@ -28,6 +28,7 @@ #include "arm_compute/runtime/CL/CLBufferAllocator.h" #include "arm_compute/runtime/CL/CLGEMMHeuristicsHandle.h" +#include "arm_compute/runtime/CL/CLTypes.h" #include "arm_compute/runtime/CL/CLTuner.h" namespace arm_compute @@ -76,6 +77,7 @@ private: CLGEMMHeuristicsHandle _gemm_heuristics; /**< GEMM heuristics */ std::unique_ptr<CLBufferAllocator> _allocator; /**< CL buffer affinity allocator */ std::string _tuner_file; /**< Filename to load/store the tuner's values from */ + CLBackendType _backend_type; /**< OpenCL backend type to use */ }; } // namespace backends } // namespace graph |