Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/fused_kernel/algorithms/basic_ops/algebraic.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace fk {
using Parent = BinaryOperation<float3, M3x3Float, float3, MxVFloat3<BinaryType>>;
DECLARE_BINARY_PARENT

FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input, const ParamsType& params) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input, const ParamsType& params) {
const float3 xOut = input * params.x;
const float3 yOut = input * params.y;
const float3 zOut = input * params.z;
Expand All @@ -54,7 +54,7 @@ namespace fk {
FK_STATIC_STRUCT(MxVFloat3, SelfType)
using Parent = UnaryOperation<Tuple<float3, M3x3Float>, float3, MxVFloat3<UnaryType>>;
DECLARE_UNARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input) {
const float3 xOut = get<0>(input) * get<1>(input).x;
const float3 yOut = get<0>(input) * get<1>(input).y;
const float3 zOut = get<0>(input) * get<1>(input).z;
Expand Down
10 changes: 5 additions & 5 deletions include/fused_kernel/algorithms/basic_ops/arithmetic.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace fk {
FK_STATIC_STRUCT(Add, SelfType)
using Parent = BinaryOperation<I, P, O, Add<I, P, O, BinaryType>>;
DECLARE_BINARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input, const ParamsType& params) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input, const ParamsType& params) {
return input + params;
}
};
Expand All @@ -43,7 +43,7 @@ namespace fk {
FK_STATIC_STRUCT(Add, SelfType)
using Parent = UnaryOperation<Tuple<I1, I2>, O, Add<I1, I2, O, UnaryType>>;
DECLARE_UNARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input) {
return get<0>(input) + get<1>(input);
}
};
Expand All @@ -56,7 +56,7 @@ namespace fk {
FK_STATIC_STRUCT(Sub, SelfType)
using Parent = BinaryOperation<I, P, O, Sub<I, P, O>>;
DECLARE_BINARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input, const ParamsType& params) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input, const ParamsType& params) {
return input - params;
}
};
Expand All @@ -69,7 +69,7 @@ namespace fk {
FK_STATIC_STRUCT(Mul, SelfType)
using Parent = BinaryOperation<I, P, O, Mul<I, P, O>>;
DECLARE_BINARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input, const ParamsType& params) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input, const ParamsType& params) {
return input * params;
}
};
Expand All @@ -82,7 +82,7 @@ namespace fk {
FK_STATIC_STRUCT(Div, SelfType)
using Parent = BinaryOperation<I, P, O, Div<I, P, O>>;
DECLARE_BINARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input, const ParamsType& params) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input, const ParamsType& params) {
return input / params;
}
};
Expand Down
2 changes: 1 addition & 1 deletion include/fused_kernel/algorithms/basic_ops/cast.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace fk {
FK_STATIC_STRUCT(Cast, SelfType)
using Parent = UnaryOperation<I, O, Cast<I, O>>;
DECLARE_UNARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input) {
return cxp::cast<OutputType>::f(input);
}
};
Expand Down
18 changes: 9 additions & 9 deletions include/fused_kernel/algorithms/basic_ops/logical.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace fk {
FK_STATIC_STRUCT(IsEven, SelfType)
using Parent = UnaryOperation<I, bool, IsEven<I>>;
DECLARE_UNARY_PARENT
FK_HOST_DEVICE_FUSE auto exec(const InputType& input) {
FK_HOST_DEVICE_FUSE auto exec(const InputType input) {
return cxp::is_even::f(input);
}
};
Expand All @@ -42,7 +42,7 @@ namespace fk {
FK_STATIC_STRUCT(Max, SelfType)
using Parent = BinaryOperation<I, P, O, Max<I, P, O, BinaryType>>;
DECLARE_BINARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input, const ParamsType& params) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input, const ParamsType& params) {
return cxp::max::f(input, params);
}
};
Expand All @@ -55,7 +55,7 @@ namespace fk {
FK_STATIC_STRUCT(Max, SelfType)
using Parent = UnaryOperation<Tuple<I, P>, O, Max<I, P, O, UnaryType>>;
DECLARE_UNARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input) {
return cxp::max::f(get<0>(input), get<1>(input));
}
};
Expand All @@ -68,7 +68,7 @@ namespace fk {
FK_STATIC_STRUCT(Min, SelfType)
using Parent = BinaryOperation<I, P, O, Min<I, P, O, BinaryType>>;
DECLARE_BINARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input, const ParamsType& params) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input, const ParamsType& params) {
return cxp::min::f(input, params);
}
};
Expand All @@ -81,7 +81,7 @@ namespace fk {
FK_STATIC_STRUCT(Min, SelfType)
using Parent = UnaryOperation<Tuple<I, P>, O, Min<I, P, O, UnaryType>>;
DECLARE_UNARY_PARENT
FK_HOST_DEVICE_FUSE OutputType exec(const InputType& input) {
FK_HOST_DEVICE_FUSE OutputType exec(const InputType input) {
return cxp::min::f(get<0>(input), get<1>(input));
}
};
Expand All @@ -95,21 +95,21 @@ namespace fk {
using Parent = UnaryOperation<Tuple<I1, I2>, bool, Equal<I1, I2>>;
DECLARE_UNARY_PARENT
template <int N = cn<I1>>
FK_HOST_DEVICE_FUSE std::enable_if_t<N==1, OutputType> exec(const InputType& input) {
FK_HOST_DEVICE_FUSE std::enable_if_t<N==1, OutputType> exec(const InputType input) {
return get<0>(input) == get<1>(input);
}
template <int N = cn<I1>>
FK_HOST_DEVICE_FUSE std::enable_if_t<N == 2, OutputType> exec(const InputType& input) {
FK_HOST_DEVICE_FUSE std::enable_if_t<N == 2, OutputType> exec(const InputType input) {
const auto result = get<0>(input) == get<1>(input);
return result.x && result.y;
}
template <int N = cn<I1>>
FK_HOST_DEVICE_FUSE std::enable_if_t<N == 3, OutputType> exec(const InputType& input) {
FK_HOST_DEVICE_FUSE std::enable_if_t<N == 3, OutputType> exec(const InputType input) {
const auto result = get<0>(input) == get<1>(input);
return result.x && result.y && result.z;
}
template <int N = cn<I1>>
FK_HOST_DEVICE_FUSE std::enable_if_t<N == 4, OutputType> exec(const InputType& input) {
FK_HOST_DEVICE_FUSE std::enable_if_t<N == 4, OutputType> exec(const InputType input) {
const auto result = get<0>(input) == get<1>(input);
return result.x && result.y && result.z && result.w;
}
Expand Down
Loading