Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/pages/configuring_arrayfire_environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,13 @@ This is a useful enviornment variable when running code on servers and systems
without displays. When graphics calls are run on such machines, they will
print warning about window creation failing. To suppress those calls, set this
variable.

AF_PRINT_ERRORS {#af_print_errors}
-------------------------------------------------------------------------------

When AF_PRINT_ERRORS is set to 1, the exceptions thrown are more verbose and
detailed. This helps in locating the exact failure.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
AF_PRINT_ERRORS=1 ./myprogram_opencl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 changes: 4 additions & 0 deletions src/api/c/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,8 @@ af_err af_range(af_array *result, const unsigned ndims, const dim_t * const dims
case f64: out = range_<double >(d, seq_dim); break;
case s32: out = range_<int >(d, seq_dim); break;
case u32: out = range_<uint >(d, seq_dim); break;
case s64: out = range_<intl >(d, seq_dim); break;
case u64: out = range_<uintl >(d, seq_dim); break;
case u8: out = range_<uchar >(d, seq_dim); break;
default: TYPE_ERROR(4, type);
}
Expand Down Expand Up @@ -509,6 +511,8 @@ af_err af_iota(af_array *result, const unsigned ndims, const dim_t * const dims,
case f64: out = iota_<double >(d, t); break;
case s32: out = iota_<int >(d, t); break;
case u32: out = iota_<uint >(d, t); break;
case s64: out = iota_<intl >(d, t); break;
case u64: out = iota_<uintl >(d, t); break;
case u8: out = iota_<uchar >(d, t); break;
default: TYPE_ERROR(4, type);
}
Expand Down
4 changes: 4 additions & 0 deletions src/api/c/diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ af_err af_diff1(af_array *out, const af_array in, const int dim)
case b8: output = diff1<char >(in,dim); break;
case s32: output = diff1<int >(in,dim); break;
case u32: output = diff1<uint >(in,dim); break;
case s64: output = diff1<intl >(in,dim); break;
case u64: output = diff1<uintl >(in,dim); break;
case u8: output = diff1<uchar >(in,dim); break;
default: TYPE_ERROR(1, type);
}
Expand Down Expand Up @@ -85,6 +87,8 @@ af_err af_diff2(af_array *out, const af_array in, const int dim)
case b8: output = diff2<char >(in,dim); break;
case s32: output = diff2<int >(in,dim); break;
case u32: output = diff2<uint >(in,dim); break;
case s64: output = diff2<intl >(in,dim); break;
case u64: output = diff2<uintl >(in,dim); break;
case u8: output = diff2<uchar >(in,dim); break;
default: TYPE_ERROR(1, type);
}
Expand Down
2 changes: 2 additions & 0 deletions src/api/c/flip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ af_err af_flip(af_array *result, const af_array in, const unsigned dim)
case b8: out = flipArray<char> (in, dim); break;
case s32: out = flipArray<int> (in, dim); break;
case u32: out = flipArray<unsigned>(in, dim); break;
case s64: out = flipArray<intl> (in, dim); break;
case u64: out = flipArray<uintl> (in, dim); break;
case u8: out = flipArray<uchar> (in, dim); break;
default: TYPE_ERROR(1, in_type);
}
Expand Down
2 changes: 2 additions & 0 deletions src/api/c/join.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ af_err af_join_many(af_array *out, const int dim, const unsigned n_arrays, const
case b8: output = join_many<char >(dim, n_arrays, inputs); break;
case s32: output = join_many<int >(dim, n_arrays, inputs); break;
case u32: output = join_many<uint >(dim, n_arrays, inputs); break;
case s64: output = join_many<intl >(dim, n_arrays, inputs); break;
case u64: output = join_many<uintl >(dim, n_arrays, inputs); break;
case u8: output = join_many<uchar >(dim, n_arrays, inputs); break;
default: TYPE_ERROR(1, info[0].getType());
}
Expand Down
2 changes: 2 additions & 0 deletions src/api/c/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ af_err af_accum(af_array *out, const af_array in, const int dim)
case c64: res = scan<af_add_t, cdouble, cdouble>(in, dim); break;
case u32: res = scan<af_add_t, uint , uint >(in, dim); break;
case s32: res = scan<af_add_t, int , int >(in, dim); break;
case u64: res = scan<af_add_t, uintl , uintl >(in, dim); break;
case s64: res = scan<af_add_t, intl , intl >(in, dim); break;
case u8: res = scan<af_add_t, uchar , uint >(in, dim); break;
// Make sure you are adding only "1" for every non zero value, even if op == af_add_t
case b8: res = scan<af_notzero_t, char , uint >(in, dim); break;
Expand Down
2 changes: 2 additions & 0 deletions src/api/c/shift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ af_err af_shift(af_array *out, const af_array in, const int sdims[4])
case b8: output = shift<char >(in, sdims); break;
case s32: output = shift<int >(in, sdims); break;
case u32: output = shift<uint >(in, sdims); break;
case s64: output = shift<intl >(in, sdims); break;
case u64: output = shift<uintl >(in, sdims); break;
case u8: output = shift<uchar >(in, sdims); break;
default: TYPE_ERROR(1, type);
}
Expand Down
2 changes: 2 additions & 0 deletions src/api/c/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ af_err af_tile(af_array *out, const af_array in, const af::dim4 &tileDims)
case b8: output = tile<char >(in, tileDims); break;
case s32: output = tile<int >(in, tileDims); break;
case u32: output = tile<uint >(in, tileDims); break;
case s64: output = tile<intl >(in, tileDims); break;
case u64: output = tile<uintl >(in, tileDims); break;
case u8: output = tile<uchar >(in, tileDims); break;
default: TYPE_ERROR(1, type);
}
Expand Down
2 changes: 2 additions & 0 deletions src/backend/cpu/diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ namespace cpu
INSTANTIATE(cdouble)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
INSTANTIATE(char)
}
2 changes: 2 additions & 0 deletions src/backend/cpu/iota.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,7 @@ namespace cpu
INSTANTIATE(double)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
}
2 changes: 2 additions & 0 deletions src/backend/cpu/range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,7 @@ namespace cpu
INSTANTIATE(double)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
}
2 changes: 2 additions & 0 deletions src/backend/cpu/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ namespace cpu
INSTANTIATE(af_add_t, cdouble, cdouble)
INSTANTIATE(af_add_t, int , int )
INSTANTIATE(af_add_t, uint , uint )
INSTANTIATE(af_add_t, intl , intl )
INSTANTIATE(af_add_t, uintl , uintl )
INSTANTIATE(af_add_t, char , int )
INSTANTIATE(af_add_t, uchar , uint )
INSTANTIATE(af_notzero_t, char , uint )
Expand Down
2 changes: 2 additions & 0 deletions src/backend/cpu/shift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ namespace cpu
INSTANTIATE(cdouble)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
INSTANTIATE(char)

Expand Down
2 changes: 2 additions & 0 deletions src/backend/cpu/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ namespace cpu
INSTANTIATE(cdouble)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
INSTANTIATE(char)

Expand Down
2 changes: 2 additions & 0 deletions src/backend/cuda/diff.cu
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ namespace cuda
INSTANTIATE(cdouble)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
INSTANTIATE(char)

Expand Down
2 changes: 2 additions & 0 deletions src/backend/cuda/iota.cu
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace cuda
INSTANTIATE(double)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
}

2 changes: 2 additions & 0 deletions src/backend/cuda/range.cu
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ namespace cuda
INSTANTIATE(double)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
}
2 changes: 2 additions & 0 deletions src/backend/cuda/scan.cu
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ namespace cuda
INSTANTIATE(af_add_t, cdouble, cdouble)
INSTANTIATE(af_add_t, int , int )
INSTANTIATE(af_add_t, uint , uint )
INSTANTIATE(af_add_t, intl , intl )
INSTANTIATE(af_add_t, uintl , uintl )
INSTANTIATE(af_add_t, char , int )
INSTANTIATE(af_add_t, uchar , uint )
INSTANTIATE(af_notzero_t, char , uint )
Expand Down
2 changes: 2 additions & 0 deletions src/backend/cuda/shift.cu
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ namespace cuda
INSTANTIATE(cdouble)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
INSTANTIATE(char)
}
2 changes: 2 additions & 0 deletions src/backend/cuda/tile.cu
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ namespace cuda
INSTANTIATE(cdouble)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
INSTANTIATE(char)

Expand Down
2 changes: 2 additions & 0 deletions src/backend/opencl/diff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,7 @@ namespace opencl
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(uchar)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(char)
}
2 changes: 2 additions & 0 deletions src/backend/opencl/iota.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ namespace opencl
INSTANTIATE(double)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
}
2 changes: 2 additions & 0 deletions src/backend/opencl/range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,7 @@ namespace opencl
INSTANTIATE(double)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
}
2 changes: 2 additions & 0 deletions src/backend/opencl/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ namespace opencl
INSTANTIATE(af_add_t, cdouble, cdouble)
INSTANTIATE(af_add_t, int , int )
INSTANTIATE(af_add_t, uint , uint )
INSTANTIATE(af_add_t, intl , intl )
INSTANTIATE(af_add_t, uintl , uintl )
INSTANTIATE(af_add_t, char , int )
INSTANTIATE(af_add_t, uchar , uint )
INSTANTIATE(af_notzero_t, char , uint)
Expand Down
2 changes: 2 additions & 0 deletions src/backend/opencl/shift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ namespace opencl
INSTANTIATE(cdouble)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
INSTANTIATE(char)
}
2 changes: 2 additions & 0 deletions src/backend/opencl/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ namespace opencl
INSTANTIATE(cdouble)
INSTANTIATE(int)
INSTANTIATE(uint)
INSTANTIATE(intl)
INSTANTIATE(uintl)
INSTANTIATE(uchar)
INSTANTIATE(char)

Expand Down
2 changes: 1 addition & 1 deletion test/diff1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Diff1 : public ::testing::Test
};

// create a list of types to be tested
typedef ::testing::Types<float, cfloat, double, cdouble, int, unsigned, char, unsigned char> TestTypes;
typedef ::testing::Types<float, cfloat, double, cdouble, int, unsigned, intl, uintl, char, unsigned char> TestTypes;

// register the type list
TYPED_TEST_CASE(Diff1, TestTypes);
Expand Down
2 changes: 1 addition & 1 deletion test/diff2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class Diff2 : public ::testing::Test
};

// create a list of types to be tested
typedef ::testing::Types<float, cfloat, double, cdouble, int, unsigned, char, unsigned char> TestTypes;
typedef ::testing::Types<float, cfloat, double, cdouble, int, unsigned, intl, uintl, char, unsigned char> TestTypes;

// register the type list
TYPED_TEST_CASE(Diff2, TestTypes);
Expand Down
2 changes: 1 addition & 1 deletion test/iota.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Iota : public ::testing::Test
};

// create a list of types to be tested
typedef ::testing::Types<float, double, int, unsigned int, unsigned char> TestTypes;
typedef ::testing::Types<float, double, int, unsigned int, intl, uintl, unsigned char> TestTypes;

// register the type list
TYPED_TEST_CASE(Iota, TestTypes);
Expand Down
2 changes: 1 addition & 1 deletion test/range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Range : public ::testing::Test
};

// create a list of types to be tested
typedef ::testing::Types<float, double, int, unsigned int, unsigned char> TestTypes;
typedef ::testing::Types<float, double, int, unsigned int, intl, uintl, unsigned char> TestTypes;

// register the type list
TYPED_TEST_CASE(Range, TestTypes);
Expand Down
6 changes: 4 additions & 2 deletions test/scan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ vector<af_seq> init_subs()
SCAN_TESTS(accum, float , float , float );
SCAN_TESTS(accum, double , double , double );
SCAN_TESTS(accum, int , int , int );
SCAN_TESTS(accum, cfloat , cfloat , cfloat );
SCAN_TESTS(accum, cdouble , cdouble, cdouble);
SCAN_TESTS(accum, cfloat , cfloat , cfloat );
SCAN_TESTS(accum, cdouble , cdouble , cdouble );
SCAN_TESTS(accum, unsigned, unsigned , unsigned );
SCAN_TESTS(accum, intl , intl , intl );
SCAN_TESTS(accum, uintl , uintl , uintl );
SCAN_TESTS(accum, uchar , unsigned char, unsigned);

TEST(Scan,Test_Scan_Big0)
Expand Down
2 changes: 1 addition & 1 deletion test/shift.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Shift : public ::testing::Test
};

// create a list of types to be tested
typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, char, unsigned char> TestTypes;
typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, intl, uintl, char, unsigned char> TestTypes;
// register the type list
TYPED_TEST_CASE(Shift, TestTypes);

Expand Down
2 changes: 1 addition & 1 deletion test/tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Tile : public ::testing::Test
};

// create a list of types to be tested
typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, char, unsigned char> TestTypes;
typedef ::testing::Types<float, double, cfloat, cdouble, int, unsigned int, intl, uintl, char, unsigned char> TestTypes;

// register the type list
TYPED_TEST_CASE(Tile, TestTypes);
Expand Down