예제 #1
0
 // Helper functions
 dim4 array::dims() const
 {
     dim_type d0, d1, d2, d3;
     AF_THROW(af_get_dims(&d0, &d1, &d2, &d3, arr));
     return dim4(d0, d1, d2, d3);
 }
예제 #2
0
 array upper(const array &in, bool is_unit_diag)
 {
     af_array res;
     AF_THROW(af_upper(&res, in.get(), is_unit_diag));
     return array(res);
 }
예제 #3
0
void Window::hist(const array& X, const double minval, const double maxval,
                  const char* const title) {
    af_cell temp{_r, _c, title, AF_COLORMAP_DEFAULT};
    AF_THROW(af_draw_hist(get(), X.get(), minval, maxval, &temp));
}
예제 #4
0
 array tile(const array& in, const af::dim4 &dims)
 {
     af_array out = 0;
     AF_THROW(af_tile(&out, in.get(), dims[0], dims[1], dims[2], dims[3]));
     return array(out);
 }
예제 #5
0
 array shift(const array& in, const int x, const int y, const int z, const int w)
 {
     af_array out = 0;
     AF_THROW(af_shift(&out, in.get(), x, y, z, w));
     return array(out);
 }
예제 #6
0
 array identity(const dim4 &dims, const af::dtype type)
 {
     af_array res;
     AF_THROW(af_identity(&res, dims.ndims(), dims.get(), type));
     return array(res);
 }
예제 #7
0
 array flat(const array& in)
 {
     af_array out = 0;
     AF_THROW(af_flat(&out, in.get()));
     return array(out);
 }
예제 #8
0
 void array::eval() const
 {
     AF_THROW(af_eval(get()));
 }
예제 #9
0
 void array::free(const void *ptr)
 {
     //FIXME: look up map and call the right free
     AF_THROW(af_free_device((void *)ptr));
 }
예제 #10
0
 array array::as(af_dtype type) const
 {
     af_array out;
     AF_THROW(af_cast(&out, this->get(), type));
     return array(out);
 }
예제 #11
0
 array::array(const array& in) : arr(0), isRef(false)
 {
     AF_THROW(af_weak_copy(&arr, in.get()));
 }
예제 #12
0
 array array::copy() const
 {
     af_array *other = 0;
     AF_THROW(af_copy_array(other, arr));
     return array(*other);
 }
예제 #13
0
 size_t array::bytes() const
 {
     dim_type nElements;
     AF_THROW(af_get_elements(&nElements, arr));
     return nElements * size_of(type());
 }
예제 #14
0
 unsigned array::numdims() const
 {
     unsigned nd;
     AF_THROW(af_get_numdims(&nd, arr));
     return nd;
 }
예제 #15
0
 array range(const dim4 &dims, const int seq_dim, const af::dtype ty)
 {
     af_array out;
     AF_THROW(af_range(&out, dims.ndims(), dims.get(), seq_dim, ty));
     return array(out);
 }
예제 #16
0
 array approx1(const array& yi, const array &xo, const interpType method, const float offGrid)
 {
     af_array yo = 0;
     AF_THROW(af_approx1(&yo, yi.get(), xo.get(), method, offGrid));
     return array(yo);
 }
예제 #17
0
 array iota(const dim4 &dims, const dim4 &tile_dims, const af::dtype ty)
 {
     af_array out;
     AF_THROW(af_iota(&out, dims.ndims(), dims.get(), tile_dims.ndims(), tile_dims.get(), ty));
     return array(out);
 }
예제 #18
0
AFAPI array median(const array& in, const dim_t dim)
{
    af_array temp = 0;
    AF_THROW(af_median(&temp, in.get(), getFNSD(dim, in.dims())));
    return array(temp);
}
예제 #19
0
 array moddims(const array& in, const unsigned ndims, const dim_t * const dims)
 {
     af_array out = 0;
     AF_THROW(af_moddims(&out, in.get(), ndims, dims));
     return array(out);
 }
예제 #20
0
array transform(const array& in, const array& transform, const dim_type odim0, const dim_type odim1, const bool inverse)
{
    af_array out = 0;
    AF_THROW(af_transform(&out, in.get(), transform.get(), odim0, odim1, inverse));
    return array(out);
}
예제 #21
0
 array join(const int dim, const array& first, const array& second)
 {
     af_array out = 0;
     AF_THROW(af_join(&out, dim, first.get(), second.get()));
     return array(out);
 }
예제 #22
0
파일: scale.cpp 프로젝트: 9prady9/arrayfire
array scale(const array& in, const float scale0, const float scale1,
            const dim_t odim0, const dim_t odim1, const interpType method) {
    af_array out = 0;
    AF_THROW(af_scale(&out, in.get(), scale0, scale1, odim0, odim1, method));
    return array(out);
}
예제 #23
0
 array reorder(const array& in, const unsigned x, const unsigned y, const unsigned z, const unsigned w)
 {
     af_array out = 0;
     AF_THROW(af_reorder(&out, in.get(), x, y, z, w));
     return array(out);
 }
예제 #24
0
 array randn(const dim4 &dims, const af::dtype type)
 {
     af_array res;
     AF_THROW(af_randn(&res, dims.ndims(), dims.get(), type));
     return array(res);
 }
예제 #25
0
 array flip(const array &in, const unsigned dim)
 {
     af_array out = 0;
     AF_THROW(af_flip(&out, in.get(), dim));
     return array(out);
 }
예제 #26
0
 void setSeed(const uintl seed)
 {
     AF_THROW(af_set_seed(seed));
 }
예제 #27
0
void Window::scatter3(const array& P, af::markerType marker,
                      const char* const title) {
    af_cell temp{_r, _c, title, AF_COLORMAP_DEFAULT};
    AF_THROW(af_draw_scatter_nd(get(), P.get(), marker, &temp));
}
예제 #28
0
 uintl getSeed()
 {
     uintl seed = 0;
     AF_THROW(af_get_seed(&seed));
     return seed;
 }
예제 #29
0
void Window::surface(const array& S, const char* const title) {
    af::array xVals = range(S.dims(0));
    af::array yVals = range(S.dims(1));
    af_cell temp{_r, _c, title, AF_COLORMAP_DEFAULT};
    AF_THROW(af_draw_surface(get(), xVals.get(), yVals.get(), S.get(), &temp));
}
예제 #30
0
 void array::host(void *data) const
 {
     AF_THROW(af_get_data_ptr(data, arr));
 }