/* * Copyright 2008-2012 NVIDIA Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include namespace thrust { namespace detail { template struct unary_traits_imp; template struct unary_traits_imp { typedef Operation function_type; typedef const function_type & param_type; typedef typename Operation::result_type result_type; typedef typename Operation::argument_type argument_type; }; // end unary_traits_imp template struct unary_traits_imp { typedef Result (*function_type)(Argument); typedef Result (*param_type)(Argument); typedef Result result_type; typedef Argument argument_type; }; // end unary_traits_imp template struct binary_traits_imp; template struct binary_traits_imp { typedef Operation function_type; typedef const function_type & param_type; typedef typename Operation::result_type result_type; typedef typename Operation::first_argument_type first_argument_type; typedef typename Operation::second_argument_type second_argument_type; }; // end binary_traits_imp template struct binary_traits_imp { typedef Result (*function_type)(Argument1, Argument2); typedef Result (*param_type)(Argument1, Argument2); typedef Result result_type; typedef Argument1 first_argument_type; typedef Argument2 second_argument_type; }; // end binary_traits_imp } // end detail template struct unary_traits { typedef typename detail::unary_traits_imp::function_type function_type; typedef typename detail::unary_traits_imp::param_type param_type; typedef typename detail::unary_traits_imp::result_type result_type; typedef typename detail::unary_traits_imp::argument_type argument_type; }; // end unary_traits template struct unary_traits { typedef Result (*function_type)(Argument); typedef Result (*param_type)(Argument); typedef Result result_type; typedef Argument argument_type; }; // end unary_traits template struct binary_traits { typedef typename detail::binary_traits_imp::function_type function_type; typedef typename detail::binary_traits_imp::param_type param_type; typedef typename detail::binary_traits_imp::result_type result_type; typedef typename detail::binary_traits_imp::first_argument_type first_argument_type; typedef typename detail::binary_traits_imp::second_argument_type second_argument_type; }; // end binary_traits template struct binary_traits { typedef Result (*function_type)(Argument1, Argument2); typedef Result (*param_type)(Argument1, Argument2); typedef Result result_type; typedef Argument1 first_argument_type; typedef Argument2 second_argument_type; }; // end binary_traits template unary_negate not1(const Predicate &pred) { return unary_negate(pred); } // end not1() template binary_negate not2(const BinaryPredicate &pred) { return binary_negate(pred); } // end not2() } // end thrust