| 122 | } |
| 123 | |
| 124 | af_err af_constant_ulong(af_array *result, const uintl val, |
| 125 | const unsigned ndims, const dim_t *const dims) { |
| 126 | try { |
| 127 | af_array out; |
| 128 | AF_CHECK(af_init()); |
| 129 | |
| 130 | if (ndims <= 0) { return af_create_handle(result, 0, nullptr, u64); } |
| 131 | dim4 d = verifyDims(ndims, dims); |
| 132 | |
| 133 | out = getHandle(createValueArray<uintl>(d, val)); |
| 134 | |
| 135 | std::swap(*result, out); |
| 136 | } |
| 137 | CATCHALL; |
| 138 | |
| 139 | return AF_SUCCESS; |
| 140 | } |
| 141 | |
| 142 | template<typename T> |
| 143 | static inline af_array identity_(const af::dim4 &dims) { |