aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorGian Marco <gianmarco.iodice@arm.com>2017-12-04 13:55:08 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:42:17 +0000
commit0bc5a258903bbbf8623b6e1c4253d958551293ed (patch)
treebde5aeb73f0ebabdac42ae97afcd857d0ba0d08a /utils
parent3bcf15db673fa927eba34356228865678a979844 (diff)
downloadComputeLibrary-0bc5a258903bbbf8623b6e1c4253d958551293ed.tar.gz
COMPMID-556 - Fix SGEMM example
- alpha and beta were integer values whilst should be float. - Replaced CLImage with CLTensor - Replaced Format with DataType Change-Id: I19f81b52d2eab8976be689b601d8e8e2bedfc6aa Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/111725 Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com <bsgcomp@arm.com> Reviewed-by: Anthony Barbier <anthony.barbier@arm.com>
Diffstat (limited to 'utils')
-rw-r--r--utils/Utils.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/utils/Utils.h b/utils/Utils.h
index 9d2b517708..9133fd0ac0 100644
--- a/utils/Utils.h
+++ b/utils/Utils.h
@@ -512,16 +512,16 @@ public:
return _fortran_order;
}
- /** Initialise an image's metadata with the dimensions of the NPY file currently open
+ /** Initialise the tensor's metadata with the dimensions of the NPY file currently open
*
* @param[out] tensor Tensor to initialise
- * @param[in] format Format to use for the image
+ * @param[in] dt Data type to use for the tensor
*/
template <typename T>
- void init_tensor(T &tensor, arm_compute::Format format)
+ void init_tensor(T &tensor, arm_compute::DataType dt)
{
ARM_COMPUTE_ERROR_ON(!is_open());
- ARM_COMPUTE_ERROR_ON(format != arm_compute::Format::F32);
+ ARM_COMPUTE_ERROR_ON(dt != arm_compute::DataType::F32);
// Use the size of the input NPY tensor
TensorShape shape;
@@ -531,7 +531,7 @@ public:
shape.set(i, _shape.at(i));
}
- arm_compute::TensorInfo tensor_info(shape, format);
+ arm_compute::TensorInfo tensor_info(shape, 1, dt);
tensor.allocator()->init(tensor_info);
}
@@ -545,7 +545,7 @@ public:
void fill_tensor(T &tensor)
{
ARM_COMPUTE_ERROR_ON(!is_open());
- ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN(&tensor, arm_compute::Format::F32);
+ ARM_COMPUTE_ERROR_ON_FORMAT_NOT_IN(&tensor, arm_compute::DataType::F32);
try
{
// Map buffer if creating a CLTensor
@@ -582,9 +582,9 @@ public:
}
}
- switch(tensor.info()->format())
+ switch(tensor.info()->data_type())
{
- case arm_compute::Format::F32:
+ case arm_compute::DataType::F32:
{
// Read data
if(tensor.info()->padding().empty())
@@ -607,7 +607,7 @@ public:
break;
}
default:
- ARM_COMPUTE_ERROR("Unsupported format");
+ ARM_COMPUTE_ERROR("Unsupported data type");
}
// Unmap buffer if creating a CLTensor
@@ -875,9 +875,9 @@ void fill_random_tensor(T &tensor, float lower_bound, float upper_bound)
}
template <typename T>
-void init_sgemm_output(T &dst, T &src0, T &src1, arm_compute::Format format)
+void init_sgemm_output(T &dst, T &src0, T &src1, arm_compute::DataType dt)
{
- dst.allocator()->init(TensorInfo(src1.info()->dimension(0), src0.info()->dimension(1), format));
+ dst.allocator()->init(TensorInfo(TensorShape(src1.info()->dimension(0), src0.info()->dimension(1)), 1, dt));
}
} // namespace utils