This following snippet of code throws an exception.
#include <arrayfire.h>
#include <stdio.h>
const int samples = 20e6;
const int iters = 100;
using namespace af;
array a;
int main()
{
try {
a = randu(samples, 1);
af::sync();
} catch (af::exception &ex) {
printf("%s\n", ex.what());
} catch (...) {
printf("Something went wrong\n");
}
return 0;
}
Exception:
terminate called after throwing an instance of 'AfError'
what(): CUDA Error (29): driver shutting down