runall_result test_main() { accelerator::set_default(require_device().get_device_path()); runall_result result; result &= REPORT_RESULT((test_feature<int, 1>())); result &= REPORT_RESULT((test_feature<int, 2>())); result &= REPORT_RESULT((test_feature<int, 3>())); result &= REPORT_RESULT((test_feature<int, 5>())); result &= REPORT_RESULT((test_feature<unsigned, 1>())); result &= REPORT_RESULT((test_feature<unsigned, 2>())); result &= REPORT_RESULT((test_feature<unsigned, 3>())); result &= REPORT_RESULT((test_feature<unsigned, 5>())); result &= REPORT_RESULT((test_feature<float, 1>())); result &= REPORT_RESULT((test_feature<float, 2>())); result &= REPORT_RESULT((test_feature<float, 3>())); result &= REPORT_RESULT((test_feature<float, 5>())); result &= REPORT_RESULT((test_feature<double, 1>())); result &= REPORT_RESULT((test_feature<double, 2>())); result &= REPORT_RESULT((test_feature<double, 3>())); result &= REPORT_RESULT((test_feature<double, 5>())); return result; }
bool CopyConstructWithIndexOnDevice() { accelerator_view av = require_device().get_default_view(); Log()<< "Testing copy construct index with an index on device" << std::endl; vector<int> resultsA(RANK), resultsB(1); array<int, 1> A(extent<1>(RANK), av), B(extent<1>(1), av); Concurrency::extent<1> ex(1); parallel_for_each(ex, [&](index<1> idx) __GPU{ kernelIndex(A, B); });
runall_result TestOnDevice() { runall_result result; Log() << "Testing Index-assignment operator on Device" << std::endl; accelerator_view av = require_device().default_view; array<int, 1> A(extent<1>(RANK), av), B(extent<1>(RANK), av), C(extent<1>(2), av); extent<1> ex(1); parallel_for_each(ex, [&](index<1> idx) __GPU{ kernel(A, B, C); });
runall_result TestOnDevice() { runall_result result; Log() << "Testing constructor that takes individual co-ordinates on Device" << std::endl; accelerator_view av = require_device().get_default_view(); /* vA, vB, vC, vD hold the components of each index. vE, holds all the rank values */ vector<int> vA(1), vB(2), vC(3), vD(3); array<int, 1> A(extent<1>(1), av), B(extent<1>(2), av), C(extent<1>(3), av), D(extent<1>(3), av); extent<1> ex(1); parallel_for_each(ex, [&](index<1> idx) __GPU { kernel(A, B, C, D); });
runall_result CopyConstructWithIndexOnDevice() { runall_result result; Log() << "Testing copy construct index as parallel_for_each parameter (from another index)" << std::endl; accelerator_view av = require_device().default_view; index<RANK> idxparam(0, 1, 2); vector<int> vA(RANK), vB(1), vC(RANK), vD(1); array<int, 1> A(extent<1>(RANK), av), B(extent<1>(1), av), C(extent<1>(RANK), av), D(extent<1>(1), av); extent<1> ex(1); parallel_for_each(ex, [&, idxparam](index<1> idx) __GPU { kernel(A, B, C, D, idxparam); });
runall_result test_main() { accelerator::set_default(require_device().get_device_path()); runall_result result; result &= REPORT_RESULT((test_feature<int, 1, 1, 1>())); result &= REPORT_RESULT((test_feature<int, 7, 31, 2>())); result &= REPORT_RESULT((test_feature<int, 5, 91, 5>())); result &= REPORT_RESULT((test_feature<unsigned, 31, 19, 1>())); result &= REPORT_RESULT((test_feature<signed, 91, 5, 5>())); result &= REPORT_RESULT((test_feature<float, 2, 31, 19>())); result &= REPORT_RESULT((test_feature<float, 5, 1, 5>())); result &= REPORT_RESULT((test_feature<double, 13, 7, 7>())); return result; }
runall_result test_main() { accelerator::set_default(require_device().device_path); runall_result result; result &= REPORT_RESULT(test_array_type<int>()); result &= REPORT_RESULT(test_array_type<unsigned>()); result &= REPORT_RESULT(test_array_type<unsigned int>()); result &= REPORT_RESULT(test_array_type<long>()); result &= REPORT_RESULT(test_array_type<unsigned long>()); result &= REPORT_RESULT(test_array_type<float>()); accelerator device; if (device.supports_double_precision) { result &= REPORT_RESULT(test_array_type<double>()); } return result; }
runall_result test_main() { accelerator_view av = require_device().get_default_view(); runall_result result; result &= INVOKE_TEST_FUNC_ON_CPU_AND_GPU(av, []() restrict(amp,cpu)->bool{return test_tile<extent<2>>();});