-
Notifications
You must be signed in to change notification settings - Fork 552
Expand file tree
/
Copy pathjit_test_api.cpp
More file actions
34 lines (29 loc) · 888 Bytes
/
jit_test_api.cpp
File metadata and controls
34 lines (29 loc) · 888 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*******************************************************
* Copyright (c) 2021, 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 <gtest/gtest.h>
#include <testHelpers.hpp>
#include <af/data.h>
namespace af {
int getMaxJitLen(void);
void setMaxJitLen(const int jitLen);
} // namespace af
TEST(JIT, UnitMaxHeight) {
const int oldMaxJitLen = af::getMaxJitLen();
af::setMaxJitLen(1);
af::array a = af::constant(1, 10);
af::array b = af::constant(2, 10);
af::array c = a * b;
af::array d = b * c;
c.eval();
d.eval();
af::setMaxJitLen(oldMaxJitLen);
}
TEST(JIT, ZeroMaxHeight) {
EXPECT_THROW({ af::setMaxJitLen(0); }, af::exception);
}