Commit fca2298d by Christian Kern

Only run opencl tests if opencl is installed. Otherwise skip those tests.

parent b46f1e37
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <iostream> #include <iostream>
#include <embb/base/c/thread.h> #include <embb/base/c/thread.h>
#include "../../mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.h"
void RunMTAPI_C(); void RunMTAPI_C();
void RunMTAPI_C_Plugin(); void RunMTAPI_C_Plugin();
...@@ -67,7 +68,14 @@ int main() { ...@@ -67,7 +68,14 @@ int main() {
std::cout << "RunMTAPI_C_Network() ... done" << std::endl; std::cout << "RunMTAPI_C_Network() ... done" << std::endl;
std::cout << "RunMTAPI_C_OpenCL() ..." << std::endl; std::cout << "RunMTAPI_C_OpenCL() ..." << std::endl;
RunMTAPI_C_OpenCL(); if (embb_mtapi_opencl_link_at_runtime() != 0) {
RunMTAPI_C_OpenCL();
}
else {
::std::cout <<
"! Skipping OpenCL tests, as OpenCL is not installed on your system." <<
::std::endl;
}
std::cout << "RunMTAPI_C_OpenCL() ... done" << std::endl; std::cout << "RunMTAPI_C_OpenCL() ... done" << std::endl;
std::cout << "RunMTAPI_CPP() ..." << std::endl; std::cout << "RunMTAPI_CPP() ..." << std::endl;
......
...@@ -29,8 +29,17 @@ ...@@ -29,8 +29,17 @@
#include <embb_mtapi_opencl_test_linker.h> #include <embb_mtapi_opencl_test_linker.h>
#include <embb_mtapi_opencl_test_task.h> #include <embb_mtapi_opencl_test_task.h>
#include <embb_mtapi_opencl_runtimelinker.h>
PT_MAIN("MTAPI OPENCL") { PT_MAIN("MTAPI OPENCL") {
PT_RUN(LinkerTest); if ( embb_mtapi_opencl_link_at_runtime() != 0 ) {
PT_RUN(TaskTest); PT_RUN(LinkerTest);
PT_RUN(TaskTest);
}
else {
::std::cout <<
"! Skipping OpenCL tests, as OpenCL is not installed on your system." <<
::std::endl;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment