From fa42befcc1e180555e164f4f7c1cf2c63d658baa Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Wed, 23 Nov 2016 21:33:35 +0100 Subject: Made compilation of the Netlib CBLAS API conditional --- CMakeLists.txt | 9 +++++++-- README.md | 8 ++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index aaac87f2..422be4e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ option(SAMPLES "Enable compilation of the examples" OFF) option(TUNERS "Enable compilation of the tuners" OFF) option(CLIENTS "Enable compilation of the clients to test and compare performance" OFF) option(TESTS "Enable compilation of the correctness tests" OFF) +option(NETLIB "Enable compilation of the CBLAS Netlib API" OFF) # Compile in verbose mode with additional diagnostic messages option(VERBOSE "Compile in verbose mode for additional diagnostic messages" OFF) @@ -170,9 +171,11 @@ set(SOURCES src/cache.cpp src/clblast.cpp src/clblast_c.cpp - src/clblast_netlib_c.cpp src/routine.cpp ) +if(NETLIB) + set(SOURCES ${SOURCES} src/clblast_netlib_c.cpp) +endif() foreach(ROUTINE ${LEVEL1_ROUTINES}) set(SOURCES ${SOURCES} src/routines/level1/${ROUTINE}.cpp) endforeach() @@ -214,7 +217,9 @@ install(TARGETS clblast EXPORT CLBlast DESTINATION lib) install(FILES include/clblast.h DESTINATION include) install(FILES include/clblast_c.h DESTINATION include) install(FILES include/clblast_half.h DESTINATION include) -install(FILES include/clblast_netlib_c.h DESTINATION include) +if(NETLIB) + install(FILES include/clblast_netlib_c.h DESTINATION include) +endif() # Installs the config for find_package in dependent projects install(EXPORT CLBlast DESTINATION lib/cmake/CLBLast FILE CLBlastConfig.cmake) diff --git a/README.md b/README.md index 20a320d3..15b65c06 100644 --- a/README.md +++ b/README.md @@ -90,16 +90,16 @@ Or alternatively the plain C version: #include -There is also a Netlib CBLAS C API available. This is however not recommended for full control over performance, since at every call it will copy all buffers to and from the OpenCL device. Especially for level 1 and level 2 BLAS functions performance will be impacted severly. However, it can be useful if you don't want to touch OpenCL at all. You can set the default device and platform by setting the `CLBLAST_DEVICE` and `CLBLAST_PLATFORM` environmental variables. This API can be used as follows: - - #include - Afterwards, any of CLBlast's routines can be called directly: there is no need to initialize the library. The available routines and the required arguments are described in the above mentioned include files and the included [API documentation](doc/clblast.md). Additionally, a couple of stand-alone example programs are included in the `samples` subfolder. They can optionally be compiled using the CMake infrastructure of CLBlast by providing the `-DSAMPLES=ON` flag, for example as follows: cmake -DSAMPLES=ON .. Furthermore, it is possible to optionally set an OS environmental variable `CLBLAST_BUILD_OPTIONS` to pass specific build options to the OpenCL compiler. +There is also a Netlib CBLAS C API available. This is however not recommended for full control over performance, since at every call it will copy all buffers to and from the OpenCL device. Especially for level 1 and level 2 BLAS functions performance will be impacted severly. However, it can be useful if you don't want to touch OpenCL at all. You can set the default device and platform by setting the `CLBLAST_DEVICE` and `CLBLAST_PLATFORM` environmental variables. This API can be used as follows after providing the `-DNETLIB=ON` flag to CMake: + + #include + Using the tuners (optional) ------------- -- cgit v1.2.3