Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
920ad26
Updated cmake files to support oneAPI version 2024.1. Currently doesn…
christophe-murphy Jun 12, 2024
1a475fa
Some tests were showing oneAPI errors due to nested calls of submit t…
christophe-murphy Jun 12, 2024
2e3de39
Modify test cases to check if library functions are supported on the …
christophe-murphy Jun 17, 2024
dd2a9d2
Modified half support check to check the native vector width for half…
christophe-murphy Jun 24, 2024
4848dd3
Fix for bug in index function introduced when implementing a fix for …
christophe-murphy Jun 26, 2024
37277f8
Fixed bug in irreduce_dim_launcher where incorrect templated calls we…
christophe-murphy Jun 27, 2024
3e41a4a
Fix bug in wrap function where one dimension of the output array was …
christophe-murphy Jul 2, 2024
ecafd15
Check for failure of asserts in apiWrapper and return from test to pr…
christophe-murphy Jul 3, 2024
2db0b33
Modified ASSERT_SUCCESS macro to skip unsupported tests rather than f…
christophe-murphy Jul 8, 2024
d374808
Fixed cmake policy issue for oneapi fix (#3569)
edwinsolisf Sep 30, 2024
7b57fa8
Cmake function CMakeDetermineCompileFeatures has been changed to CMak…
christophe-murphy Oct 14, 2024
96569d5
Removed unsupported compute capabilites from all architectures list f…
christophe-murphy Dec 18, 2024
6a42d24
Rename variables for input and output arrays of join method
christophe-murphy Dec 18, 2024
3c14855
Fix issue where NOT_SUPPORTED errors were storing the error message a…
christophe-murphy Dec 19, 2024
23ab660
Added macro for asserting success of C++ API functions that throw exc…
christophe-murphy Dec 20, 2024
ce3aa62
Remove macros that check for unsupported exceptions and skip tests. A…
christophe-murphy Jan 23, 2025
cd2828e
The UNSUPPORTED_BACKEND macro has now been added to all tests that ar…
christophe-murphy Jan 28, 2025
15902c7
Update getBackendName test helper function to support all back ends. …
christophe-murphy Feb 12, 2025
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
Prev Previous commit
Update getBackendName test helper function to support all back ends. …
…It is now used for the UNSUPPORTED_BACKEND macro.
  • Loading branch information
christophe-murphy committed Feb 12, 2025
commit 15902c763cf4a8bcc753605f7f3ecf9190caf1ea
20 changes: 13 additions & 7 deletions test/arrayfire_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,20 @@ std::string readNextNonEmptyLine(std::ifstream &file) {
return result;
}

std::string getBackendName() {
std::string getBackendName(bool lower) {
af::Backend backend = af::getActiveBackend();
if (backend == AF_BACKEND_OPENCL)
return std::string("opencl");
else if (backend == AF_BACKEND_CUDA)
return std::string("cuda");

return std::string("cpu");
switch(backend) {
case AF_BACKEND_CPU:
return lower ? std::string("cpu") : std::string("CPU");
case AF_BACKEND_CUDA:
return lower ? std::string("cuda") : std::string("CUDA");
case AF_BACKEND_OPENCL:
return lower ? std::string("opencl") : std::string("OpenCL");
case AF_BACKEND_ONEAPI:
return lower ? std::string("oneapi") : std::string("oneAPI");
default:
return lower ? std::string("unknown") : std::string("Unknown");
}
}

std::string getTestName() {
Expand Down
8 changes: 4 additions & 4 deletions test/imageio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ TEST(ImageIO, SavePNGCPP) {
input(9, 0, 2) = 255;
input(9, 9, span) = 255;

std::string testname = getTestName() + "_" + getBackendName();
std::string testname = getTestName() + "_" + getBackendName(true);
std::string imagename = "SaveCPP_" + testname + ".png";

saveImage(imagename.c_str(), input);
Expand All @@ -180,7 +180,7 @@ TEST(ImageIO, SaveBMPCPP) {
input(9, 0, 2) = 255;
input(9, 9, span) = 255;

std::string testname = getTestName() + "_" + getBackendName();
std::string testname = getTestName() + "_" + getBackendName(true);
std::string imagename = "SaveCPP_" + testname + ".bmp";

saveImage(imagename.c_str(), input);
Expand Down Expand Up @@ -291,7 +291,7 @@ TEST(ImageIO, SaveImage16CPP) {
array input = randu(dims, u16);
array input_255 = floor(input.as(f32) / 257);

std::string testname = getTestName() + "_" + getBackendName();
std::string testname = getTestName() + "_" + getBackendName(true);
std::string imagename = "saveImage16CPP_" + testname + ".png";

saveImage(imagename.c_str(), input);
Expand Down Expand Up @@ -366,7 +366,7 @@ void saveLoadImageNativeCPPTest(dim4 dims) {

array input = randu(dims, (af_dtype)dtype_traits<T>::af_type);

std::string imagename = getTestName() + "_" + getBackendName() + ".png";
std::string imagename = getTestName() + "_" + getBackendName(true) + ".png";

saveImageNative(imagename.c_str(), input);

Expand Down
25 changes: 5 additions & 20 deletions test/testHelpers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned short ushort;

std::string getBackendName();
std::string getBackendName(bool lower = false);
std::string getTestName();

std::string readNextNonEmptyLine(std::ifstream &file);
Expand Down Expand Up @@ -243,25 +243,10 @@ bool noHalfTests(af::dtype ty);
GTEST_SKIP() << "Device doesn't support Half"

#ifdef SKIP_UNSUPPORTED_TESTS
#define UNSUPPORTED_BACKEND(backend) \
do { \
if(backend == af::getActiveBackend()) { \
switch(backend) { \
case AF_BACKEND_CPU: \
GTEST_SKIP() << "Skipping unsupported function on CPU backend"; \
break; \
case AF_BACKEND_CUDA: \
GTEST_SKIP() << "Skipping unsupported function on CUDA backend"; \
break; \
case AF_BACKEND_OPENCL: \
GTEST_SKIP() << "Skipping unsupported function on OpenCL backend"; \
break; \
case AF_BACKEND_ONEAPI: \
GTEST_SKIP() << "Skipping unsupported function on oneAPI backend"; \
break; \
} \
} \
} while (0)
#define UNSUPPORTED_BACKEND(backend) \
if(backend == af::getActiveBackend()) \
GTEST_SKIP() << "Skipping unsupported function on " \
+ getBackendName() + " backend"
#else
#define UNSUPPORTED_BACKEND(backend)
#endif
Expand Down