diff --git a/doc/examples/main.cc b/doc/examples/main.cc index 54414bf..519121f 100644 --- a/doc/examples/main.cc +++ b/doc/examples/main.cc @@ -26,6 +26,7 @@ #include #include +#include "../../mtapi_opencl_c/src/embb_mtapi_opencl_runtimelinker.h" void RunMTAPI_C(); void RunMTAPI_C_Plugin(); @@ -67,7 +68,14 @@ int main() { std::cout << "RunMTAPI_C_Network() ... done" << 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_CPP() ..." << std::endl; diff --git a/mtapi_opencl_c/test/main.cc b/mtapi_opencl_c/test/main.cc index 0888cac..5ab6423 100644 --- a/mtapi_opencl_c/test/main.cc +++ b/mtapi_opencl_c/test/main.cc @@ -29,8 +29,17 @@ #include #include +#include + PT_MAIN("MTAPI OPENCL") { - PT_RUN(LinkerTest); - PT_RUN(TaskTest); + if ( embb_mtapi_opencl_link_at_runtime() != 0 ) { + PT_RUN(LinkerTest); + PT_RUN(TaskTest); + } + else { + ::std::cout << + "! Skipping OpenCL tests, as OpenCL is not installed on your system." << + ::std::endl; + } }