Skip to content
Snippets Groups Projects
Commit 0f0eb092 authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Added basic test and disclaimer

parent a7693566
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,8 @@
You must have the ArrayFire library installed on your system.
*Disclaimer: Eclipse Aidge is not affiliated with or endorsed by ArrayFire. The ArrayFire literal mark is used under a limited license granted by ArrayFire the trademark holder in the United States and other countries.*
## Pip installation
You will need to install first the aidge_core library before installing aidge_backend_arrayfire.
......
/********************************************************************************
* Copyright (c) 2023 CEA-List
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
********************************************************************************/
#include <catch2/catch_test_macros.hpp>
#include <arrayfire.h>
void testBackend()
{
af::info();
af_print(af::randu(5, 4));
}
TEST_CASE("[arrayfire] arrayfire") {
try {
printf("Trying CPU Backend\n");
af::setBackend(AF_BACKEND_CPU);
testBackend();
} catch (af::exception& e) {
printf("Caught exception when trying CPU backend\n");
fprintf(stderr, "%s\n", e.what());
}
try {
printf("Trying oneAPI Backend\n");
af::setBackend(AF_BACKEND_ONEAPI);
testBackend();
} catch (af::exception& e) {
printf("Caught exception when trying oneAPI backend\n");
fprintf(stderr, "%s\n", e.what());
}
try {
printf("Trying CUDA Backend\n");
af::setBackend(AF_BACKEND_CUDA);
testBackend();
} catch (af::exception& e) {
printf("Caught exception when trying CUDA backend\n");
fprintf(stderr, "%s\n", e.what());
}
try {
printf("Trying OpenCL Backend\n");
af::setBackend(AF_BACKEND_OPENCL);
testBackend();
} catch (af::exception& e) {
printf("Caught exception when trying OpenCL backend\n");
fprintf(stderr, "%s\n", e.what());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment