/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using af::array;
using af::dim4;
using af::dtype;
using af::randu;
using std::abs;
using std::string;
using std::stringstream;
using std::vector;
const int num = 10000;
struct clamp_params {
dim4 size_;
dtype in_type_;
dtype lo_type_;
dtype hi_type_;
dtype out_type_;
clamp_params(dim4 size, dtype itype, dtype ltype, dtype htype, dtype otype)
: size_(size)
, in_type_(itype)
, lo_type_(ltype)
, hi_type_(htype)
, out_type_(otype) {}
};
template
class Clamp : public ::testing::TestWithParam {
public:
void SetUp() {
clamp_params params = GetParam();
SUPPORTED_TYPE_CHECK(double);
if (noDoubleTests(params.in_type_))
GTEST_SKIP()