Commit ee119d9e authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Use existing method to shorten code

parent 9e03c383
...@@ -36,9 +36,9 @@ bool run_permute_bundle(const Problem& problem) ...@@ -36,9 +36,9 @@ bool run_permute_bundle(const Problem& problem)
void* output = b_device_buf.GetDeviceBuffer(); void* output = b_device_buf.GetDeviceBuffer();
std::copy(begin(shape), end(shape), begin(a_lengths)); std::copy(begin(shape), end(shape), begin(a_lengths));
std::copy(begin(a.mDesc.GetStrides()), end(a.mDesc.GetStrides()), begin(a_strides)); std::copy(begin(a.GetStrides()), end(a.GetStrides()), begin(a_strides));
std::copy(begin(transposed_shape), end(transposed_shape), begin(b_lengths)); std::copy(begin(transposed_shape), end(transposed_shape), begin(b_lengths));
std::copy(begin(b.mDesc.GetStrides()), end(b.mDesc.GetStrides()), begin(b_strides)); std::copy(begin(b.GetStrides()), end(b.GetStrides()), begin(b_strides));
static_assert(std::is_default_constructible_v<DevicePermuteInstance>); static_assert(std::is_default_constructible_v<DevicePermuteInstance>);
......
...@@ -14,7 +14,7 @@ bool run_permute_element(const Problem& problem) ...@@ -14,7 +14,7 @@ bool run_permute_element(const Problem& problem)
Tensor<ADataType> a(shape); Tensor<ADataType> a(shape);
Tensor<BDataType> b(transposed_shape); Tensor<BDataType> b(transposed_shape);
ck::utils::FillUniformDistribution<ADataType>{-1.f, 1.f}(begin(a.mData), end(a.mData)); ck::utils::FillUniformDistribution<ADataType>{-1.f, 1.f}(begin(a), end(a));
DeviceMem a_device_buf(a.GetElementSpaceSizeInBytes()); DeviceMem a_device_buf(a.GetElementSpaceSizeInBytes());
DeviceMem b_device_buf(b.GetElementSpaceSizeInBytes()); DeviceMem b_device_buf(b.GetElementSpaceSizeInBytes());
...@@ -29,9 +29,9 @@ bool run_permute_element(const Problem& problem) ...@@ -29,9 +29,9 @@ bool run_permute_element(const Problem& problem)
void* output = b_device_buf.GetDeviceBuffer(); void* output = b_device_buf.GetDeviceBuffer();
std::copy(begin(shape), end(shape), begin(a_lengths)); std::copy(begin(shape), end(shape), begin(a_lengths));
std::copy(begin(a.mDesc.GetStrides()), end(a.mDesc.GetStrides()), begin(a_strides)); std::copy(begin(a.GetStrides()), end(a.GetStrides()), begin(a_strides));
std::copy(begin(transposed_shape), end(transposed_shape), begin(b_lengths)); std::copy(begin(transposed_shape), end(transposed_shape), begin(b_lengths));
std::copy(begin(b.mDesc.GetStrides()), end(b.mDesc.GetStrides()), begin(b_strides)); std::copy(begin(b.GetStrides()), end(b.GetStrides()), begin(b_strides));
static_assert(std::is_default_constructible_v<DevicePermuteInstance>); static_assert(std::is_default_constructible_v<DevicePermuteInstance>);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment