MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / cast_test

Function cast_test

test/cast.cpp:29–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27
28template<typename Ti, typename To>
29void cast_test() {
30 SUPPORTED_TYPE_CHECK(Ti);
31 SUPPORTED_TYPE_CHECK(To);
32
33 af_dtype ta = (af_dtype)dtype_traits<Ti>::af_type;
34 af_dtype tb = (af_dtype)dtype_traits<To>::af_type;
35 dim4 dims(num, 1, 1, 1);
36 af_array a, b;
37 af_randu(&a, dims.ndims(), dims.get(), ta);
38 af_err err = af_cast(&b, a, tb);
39 af_release_array(a);
40 af_release_array(b);
41 ASSERT_SUCCESS(err);
42}
43
44#define REAL_TO_TESTS(Ti, To) \
45 TEST(CAST_TEST, Test_Real_##Ti##_##To) { cast_test<Ti, To>(); }

Callers

nothing calls this directly

Calls 5

af_randuFunction · 0.50
af_castFunction · 0.50
af_release_arrayFunction · 0.50
ndimsMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected