diff options
author | SiCong Li <sicong.li@arm.com> | 2023-06-28 09:49:45 +0100 |
---|---|---|
committer | SiCong Li <sicong.li@arm.com> | 2023-07-25 15:48:50 +0000 |
commit | 23882a9014eb3972bca958206866c8e0d0b829cc (patch) | |
tree | 9139b91699099160e26a64abd8cf182bd7447278 /src/dynamic_fusion/sketch/gpu/ckw_driver/components/utils/TypeConverter.h | |
parent | 0a59e69fd922b02d9e3b5b043ee7f891061df7be (diff) | |
download | ComputeLibrary-23882a9014eb3972bca958206866c8e0d0b829cc.tar.gz |
Add GpuKernelArgumentBinding for runtime argument setting
* Add flexible runtime argument setting that accept argument bindings
exported from ckw.
* Introduce internal build flag ACL_INTERNAL_TEST_CKW_IN_DF. If set to
true, ckw will be tested in dynamic fusion validation tests. Otherwise
it will not be tested and the dynamic fusion will keep using
ClTemplateWriter instead.
* Fix CKW sampler for elementwise binary to deal with tile sizes > 1
in both dimensions
Resolves: COMPMID-6282
Partially resolves: COMPMID-6260
Signed-off-by: SiCong Li <sicong.li@arm.com>
Change-Id: I0ab225a4484eb2119643d900a4e72806558626ee
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9917
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
Reviewed-by: Anitha Raj <Anitha.Raj@arm.com>
Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/dynamic_fusion/sketch/gpu/ckw_driver/components/utils/TypeConverter.h')
-rw-r--r-- | src/dynamic_fusion/sketch/gpu/ckw_driver/components/utils/TypeConverter.h | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/src/dynamic_fusion/sketch/gpu/ckw_driver/components/utils/TypeConverter.h b/src/dynamic_fusion/sketch/gpu/ckw_driver/components/utils/TypeConverter.h index 9027bddd76..8a38d67d80 100644 --- a/src/dynamic_fusion/sketch/gpu/ckw_driver/components/utils/TypeConverter.h +++ b/src/dynamic_fusion/sketch/gpu/ckw_driver/components/utils/TypeConverter.h @@ -28,6 +28,7 @@ #include "arm_compute/core/TensorShape.h" #include "arm_compute/core/Types.h" #include "ckw/TensorInfo.h" +#include "src/dynamic_fusion/sketch/gpu/GpuKernelArgument.h" namespace arm_compute { @@ -98,6 +99,103 @@ inline ckw::TensorInfo to_ckw(const ITensorInfo &tensor_info) tensor_info.id() }; } + +inline TensorComponentType from_ckw(const ckw::TensorComponentType &component) +{ + switch(component) + { + case ckw::TensorComponentType::OffsetFirstElement: + return TensorComponentType::OffsetFirstElement; + break; + case ckw::TensorComponentType::Stride0: + return TensorComponentType::Stride0; + break; + case ckw::TensorComponentType::Stride1: + return TensorComponentType::Stride1; + break; + case ckw::TensorComponentType::Stride2: + return TensorComponentType::Stride2; + break; + case ckw::TensorComponentType::Stride3: + return TensorComponentType::Stride3; + break; + case ckw::TensorComponentType::Stride4: + return TensorComponentType::Stride4; + break; + case ckw::TensorComponentType::Dim0: + return TensorComponentType::Dim0; + break; + case ckw::TensorComponentType::Dim1: + return TensorComponentType::Dim1; + break; + case ckw::TensorComponentType::Dim2: + return TensorComponentType::Dim2; + break; + case ckw::TensorComponentType::Dim3: + return TensorComponentType::Dim3; + break; + case ckw::TensorComponentType::Dim4: + return TensorComponentType::Dim4; + break; + case ckw::TensorComponentType::Dim1xDim2: + return TensorComponentType::Dim1xDim2; + break; + case ckw::TensorComponentType::Dim2xDim3: + return TensorComponentType::Dim2xDim3; + break; + case ckw::TensorComponentType::Dim1xDim2xDim3: + return TensorComponentType::Dim1xDim2xDim3; + break; + case ckw::TensorComponentType::Unknown: + return TensorComponentType::Unknown; + default: + ARM_COMPUTE_ERROR("Unknown CKW tensor component"); + return TensorComponentType::Unknown; + } +} + +inline ckw::TensorStorageType to_ckw(const TensorStorageType &storage) +{ + switch(storage) + { + case TensorStorageType::ClBufferUint8Ptr: + return ckw::TensorStorageType::BufferUint8Ptr; + break; + case TensorStorageType::ClImage2dReadOnly: + return ckw::TensorStorageType::Texture2dReadOnly; + break; + case TensorStorageType::ClImage2dWriteOnly: + return ckw::TensorStorageType::Texture2dWriteOnly; + break; + case TensorStorageType::Unknown: + return ckw::TensorStorageType::Unknown; + break; + default: + ARM_COMPUTE_ERROR("Unknown tensor storage type"); + return ckw::TensorStorageType::Unknown; + } +} +inline TensorStorageType from_ckw(const ckw::TensorStorageType &storage) +{ + switch(storage) + { + case ckw::TensorStorageType::BufferUint8Ptr: + return TensorStorageType::ClBufferUint8Ptr; + break; + case ckw::TensorStorageType::Texture2dReadOnly: + return TensorStorageType::ClImage2dReadOnly; + break; + case ckw::TensorStorageType::Texture2dWriteOnly: + return TensorStorageType::ClImage2dWriteOnly; + break; + case ckw::TensorStorageType::Unknown: + return TensorStorageType::Unknown; + break; + default: + ARM_COMPUTE_ERROR("Unknown CKW tensor storage type"); + return TensorStorageType::Unknown; + } +} } // namespace dynamic_fusion } // namespace experimental } // namespace arm_compute |