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

Remove 'elementwise' from identifiers

parent 9c5dd6bf
...@@ -353,10 +353,7 @@ std::enable_if_t<detail::is_random_access_range_v<Axes> && detail::is_sized_rang ...@@ -353,10 +353,7 @@ std::enable_if_t<detail::is_random_access_range_v<Axes> && detail::is_sized_rang
std::add_lvalue_reference_t<Dest>, std::add_lvalue_reference_t<Dest>,
std::add_lvalue_reference_t<Src>>, std::add_lvalue_reference_t<Src>>,
bool> bool>
host_elementwise_permute(const Tensor<Src>& src, host_permute(const Tensor<Src>& src, const Axes& axes, Functor functor, Tensor<Dest>& dest)
const Axes& axes,
Functor functor,
Tensor<Dest>& dest)
{ {
const auto& shape = src.mDesc.GetLengths(); const auto& shape = src.mDesc.GetLengths();
const auto& transposed_shape = dest.mDesc.GetLengths(); const auto& transposed_shape = dest.mDesc.GetLengths();
......
...@@ -6,9 +6,9 @@ ...@@ -6,9 +6,9 @@
using ADataType = F16; using ADataType = F16;
using BDataType = F16; using BDataType = F16;
using DeviceElementwisePermuteInstance = ck::tensor_operation::device:: using DevicePermuteInstance = ck::tensor_operation::device::
DevicePermute<ck::Tuple<ADataType>, ck::Tuple<BDataType>, PassThrough, 4, 8, S<8>, S<1>>; DevicePermute<ck::Tuple<ADataType>, ck::Tuple<BDataType>, PassThrough, 4, 8, S<8>, S<1>>;
#include "run_elementwise_permute_example.inc" #include "run_elementwise_permute_example.inc"
int main(int argc, char* argv[]) { return !run_elementwise_permute_example(argc, argv); } int main(int argc, char* argv[]) { return !run_permute_example(argc, argv); }
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
#pragma once #pragma once
bool run_elementwise_permute(const ExecutionConfig& config, const Problem& problem) bool run_permute(const ExecutionConfig& config, const Problem& problem)
{ {
using std::begin, std::end; using std::begin, std::end;
...@@ -31,7 +31,7 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl ...@@ -31,7 +31,7 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
std::copy(begin(a.mDesc.GetStrides()), end(a.mDesc.GetStrides()), begin(a_strides)); std::copy(begin(a.mDesc.GetStrides()), end(a.mDesc.GetStrides()), begin(a_strides));
std::copy(begin(b.mDesc.GetStrides()), end(b.mDesc.GetStrides()), begin(b_strides)); std::copy(begin(b.mDesc.GetStrides()), end(b.mDesc.GetStrides()), begin(b_strides));
auto permute = DeviceElementwisePermuteInstance{}; auto permute = DevicePermuteInstance{};
auto argument = auto argument =
permute.MakeArgument(ab_lengths, {a_strides}, {b_strides}, input, output, PassThrough{}); permute.MakeArgument(ab_lengths, {a_strides}, {b_strides}, input, output, PassThrough{});
...@@ -50,7 +50,7 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl ...@@ -50,7 +50,7 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
if(config.do_verification) if(config.do_verification)
{ {
Tensor<BDataType> host_b(transposed_shape); Tensor<BDataType> host_b(transposed_shape);
host_elementwise_permute(a, problem.axes, PassThrough{}, host_b); host_permute(a, problem.axes, PassThrough{}, host_b);
b_device_buf.FromDevice(b.mData.data()); b_device_buf.FromDevice(b.mData.data());
...@@ -61,10 +61,10 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl ...@@ -61,10 +61,10 @@ bool run_elementwise_permute(const ExecutionConfig& config, const Problem& probl
return true; return true;
} }
bool run_elementwise_permute_example(int argc, char* argv[]) bool run_permute_example(int argc, char* argv[])
{ {
ExecutionConfig config; ExecutionConfig config;
Problem problem; Problem problem;
return parse_cmd_args(argc, argv, config, problem) && run_elementwise_permute(config, problem); return parse_cmd_args(argc, argv, config, problem) && run_permute(config, problem);
} }
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