From 570cbcffa71e5142194921ae42a1541dc7c6e969 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Sun, 24 Jul 2016 19:10:39 +0300 Subject: CMakeLists.txt: provide a find_package() config for dependent projects --- CMakeLists.txt | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 95d1d500..42a36732 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -127,11 +127,6 @@ endif() # ================================================================================================== -# Includes directories: CLBlast and OpenCL -include_directories(${clblast_SOURCE_DIR}/include ${clblast_SOURCE_DIR}/src ${OPENCL_INCLUDE_DIRS}) - -# ================================================================================================== - # Sets the supported routines and the used kernels. New routines and kernels should be added here. set(KERNELS copy_fast copy_pad transpose_fast transpose_pad xaxpy xdot xger xgemm xgemv) set(SAMPLE_PROGRAMS_CPP sgemm) @@ -173,17 +168,27 @@ endforeach() add_library(clblast SHARED ${SOURCES}) target_link_libraries(clblast ${OPENCL_LIBRARIES}) +# Includes directories: CLBlast and OpenCL +target_include_directories(clblast PUBLIC + $ + $ + $ + ${OPENCL_INCLUDE_DIRS}) + # Sets the proper __declspec(dllexport) keyword for Visual Studio when the library is built if(MSVC) target_compile_definitions(clblast PRIVATE COMPILING_DLL=1) # requires at least CMake 2.8.11 endif() # Installs the library -install(TARGETS clblast DESTINATION lib) +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) +# Installs the config for find_package in dependent projects +install(EXPORT CLBlast DESTINATION lib/cmake/CLBLast FILE CLBlastConfig.cmake) + # ================================================================================================== # Sets a default platform ($DEVICEPLATFORM) and device ($DEFAULT_DEVICE) to run tuners and tests on @@ -197,6 +202,11 @@ endif() # ================================================================================================== +# Includes directories: CLBlast and OpenCL +include_directories(${clblast_SOURCE_DIR}/include ${clblast_SOURCE_DIR}/src ${OPENCL_INCLUDE_DIRS}) + +# ================================================================================================== + # This section contains all the code related to the examples if(SAMPLES) -- cgit v1.2.3 From b5d7b583937cecb2c8c58b676db8617ea93fb474 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Thu, 28 Jul 2016 17:53:54 +0300 Subject: CMakeLists.txt: use target_include_directories() --- CMakeLists.txt | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 42a36732..231b8e95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -202,11 +202,6 @@ endif() # ================================================================================================== -# Includes directories: CLBlast and OpenCL -include_directories(${clblast_SOURCE_DIR}/include ${clblast_SOURCE_DIR}/src ${OPENCL_INCLUDE_DIRS}) - -# ================================================================================================== - # This section contains all the code related to the examples if(SAMPLES) @@ -236,7 +231,6 @@ endif() if(TUNERS) # Includes CLTune - include_directories(${CLTUNE_INCLUDE_DIRS}) # Visual Studio requires the sources of non-exported objects/libraries set(TUNERS_COMMON ) @@ -248,6 +242,7 @@ if(TUNERS) foreach(KERNEL ${KERNELS}) add_executable(clblast_tuner_${KERNEL} ${TUNERS_COMMON} src/tuning/kernels/${KERNEL}.cpp) target_link_libraries(clblast_tuner_${KERNEL} clblast ${CLTUNE_LIBRARIES} ${OPENCL_LIBRARIES}) + target_include_directories(clblast_tuner_${KERNEL} PUBLIC ${CLTUNE_INCLUDE_DIRS}) install(TARGETS clblast_tuner_${KERNEL} DESTINATION bin) endforeach() @@ -291,9 +286,6 @@ if(CLIENTS OR TESTS) endif() endif() - # Sets the include directories - include_directories(${clblast_SOURCE_DIR} ${REF_INCLUDES}) - endif() # ================================================================================================== @@ -309,6 +301,10 @@ if(CLIENTS) else() # Creates the common performance-tests objects (requires CMake 2.8.8) add_library(test_performance_common OBJECT test/performance/client.cpp) + # Adds clblast's interface include pathes because we can't link to clblast here + target_include_directories(test_performance_common PRIVATE + $ + ${clblast_SOURCE_DIR}) set(CLIENTS_COMMON ${CLIENTS_COMMON} $) endif() @@ -331,6 +327,7 @@ if(CLIENTS) endforeach() foreach(ROUTINE ${ROUTINES}) target_link_libraries(clblast_client_${ROUTINE} clblast ${REF_LIBRARIES} ${OPENCL_LIBRARIES}) + target_include_directories(clblast_client_${ROUTINE} PUBLIC ${clblast_SOURCE_DIR} ${REF_INCLUDES}) install(TARGETS clblast_client_${ROUTINE} DESTINATION bin) endforeach() @@ -352,6 +349,9 @@ if(TESTS) # Creates the common correctness-tests objects (requires CMake 2.8.8) add_library(test_correctness_common OBJECT test/correctness/tester.cpp test/correctness/testblas.cpp) + target_include_directories(test_correctness_common PUBLIC + $ + ${clblast_SOURCE_DIR}) set(TESTS_COMMON ${TESTS_COMMON} $) endif() @@ -375,6 +375,7 @@ if(TESTS) foreach(ROUTINE ${ROUTINES}) target_link_libraries(clblast_test_${ROUTINE} clblast ${REF_LIBRARIES} ${OPENCL_LIBRARIES}) install(TARGETS clblast_test_${ROUTINE} DESTINATION bin) + target_include_directories(clblast_test_${ROUTINE} PUBLIC ${clblast_SOURCE_DIR} ${REF_INCLUDES}) add_test(clblast_test_${ROUTINE} clblast_test_${ROUTINE} ${DEVICEPLATFORM}) endforeach() -- cgit v1.2.3 From 35623cd98d798173661c8d86c84fb48261a2493e Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Thu, 28 Jul 2016 20:45:09 +0200 Subject: Minor update regarding the previous CMake export/install target changes --- CHANGELOG | 1 + CMakeLists.txt | 5 ++--- README.md | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CHANGELOG b/CHANGELOG index d018e211..8fce1969 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,7 @@ Development version (next release) - Fixed a performance issue (caused by fp16 support) by optimizing alpha/beta parameter passing to kernels - Added an option (-warm_up) to do a warm-up run before timing in the performance clients - Improved performance significantly of rotated GEMV computations +- Various minor fixes and enhancements - Added tuned parameters for various devices (see README) Version 0.8.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 231b8e95..7393c6e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -230,8 +230,6 @@ endif() # the CLTune library (not included as part of the source). if(TUNERS) - # Includes CLTune - # Visual Studio requires the sources of non-exported objects/libraries set(TUNERS_COMMON ) if(MSVC) @@ -301,7 +299,8 @@ if(CLIENTS) else() # Creates the common performance-tests objects (requires CMake 2.8.8) add_library(test_performance_common OBJECT test/performance/client.cpp) - # Adds clblast's interface include pathes because we can't link to clblast here + + # Adds CLBlast's interface include paths because we can't link to CLBlast here target_include_directories(test_performance_common PRIVATE $ ${clblast_SOURCE_DIR}) diff --git a/README.md b/README.md index 1b3adcb9..d9d30cb1 100644 --- a/README.md +++ b/README.md @@ -286,6 +286,7 @@ The contributing authors (code, pull requests, testing) so far are: * [Marco Hutter](https://github.com/gpus) * [Hugh Perkins](https://github.com/hughperkins) * [Gian-Carlo Pascutto](https://github.com/gcp) +* [Ivan Shapovalov](https://github.com/intelfx) Tuning and testing on a variety of OpenCL devices was made possible by: -- cgit v1.2.3 From 9095537a6a5199e2dc3824381481af790d4e8f27 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov Date: Tue, 13 Sep 2016 16:12:30 +0300 Subject: CMakeLists.txt: use -Wno-ignored-attributes to silence unfixable warnings --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 7393c6e7..c10f66a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,6 +75,12 @@ else() if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9.0) set(FLAGS "${FLAGS} -Wno-attributes -Wno-unused-variable") endif() + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0.0) + # GCC does not support attributes on template arguments + # in particular we hit this with the alignment attributes on cl_XXX types + # which are then used to instantiate various templates in CLBlast + set(FLAGS "${FLAGS} -Wno-ignored-attributes") + endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES Clang) set(FLAGS "${FLAGS} -Wextra -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-padded") set(FLAGS "${FLAGS} -Wno-missing-prototypes -Wno-float-equal -Wno-switch-enum -Wno-switch") -- cgit v1.2.3 From 48ab0428cb3461676072a54571c747e83ef13772 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Tue, 13 Sep 2016 19:08:49 +0200 Subject: Renamed the DEFAULT_DEVICE and DEFAULT_PLATFORM env variables to be in line with recent usages of CLBLAST_DEVICE and CLBLAST_PLATFORM --- CMakeLists.txt | 10 +++++----- README.md | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index c10f66a3..ffcdf1a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -197,13 +197,13 @@ install(EXPORT CLBlast DESTINATION lib/cmake/CLBLast FILE CLBlastConfig.cmake) # ================================================================================================== -# Sets a default platform ($DEVICEPLATFORM) and device ($DEFAULT_DEVICE) to run tuners and tests on +# Sets a default platform ($DEVICEPLATFORM) and device ($CLBLAST_DEVICE) to run tuners and tests on set(DEVICEPLATFORM ) -if(DEFINED ENV{DEFAULT_DEVICE}) - set(DEVICEPLATFORM ${DEVICEPLATFORM} -device $ENV{DEFAULT_DEVICE}) +if(DEFINED ENV{CLBLAST_DEVICE}) + set(DEVICEPLATFORM ${DEVICEPLATFORM} -device $ENV{CLBLAST_DEVICE}) endif() -if(DEFINED ENV{DEFAULT_PLATFORM}) - set(DEVICEPLATFORM ${DEVICEPLATFORM} -platform $ENV{DEFAULT_PLATFORM}) +if(DEFINED ENV{CLBLAST_PLATFORM}) + set(DEVICEPLATFORM ${DEVICEPLATFORM} -platform $ENV{CLBLAST_PLATFORM}) endif() # ================================================================================================== diff --git a/README.md b/README.md index 1dd3ea65..51452028 100644 --- a/README.md +++ b/README.md @@ -136,7 +136,7 @@ If your device is not (yet) among this list or if you want to tune CLBlast for s Note that CLBlast's tuners are based on the [CLTune auto-tuning library](https://github.com/CNugteren/CLTune), which has to be installed separately (requires version 2.3.1 or higher). -Compiling with `-DTUNERS=ON` will generate a number of tuners, each named `clblast_tuner_xxxxx`, in which `xxxxx` corresponds to a `.opencl` kernel file as found in `src/kernels`. These kernels corresponds to routines (e.g. `xgemm`) or to common pre-processing or post-processing kernels (`copy` and `transpose`). Running such a tuner will test a number of parameter-value combinations on your device and report which one gave the best performance. Running `make alltuners` runs all tuners for all precisions in one go. You can set the default device and platform for `alltuners` by setting the `DEFAULT_DEVICE` and `DEFAULT_PLATFORM` environmental variables before running CMake. +Compiling with `-DTUNERS=ON` will generate a number of tuners, each named `clblast_tuner_xxxxx`, in which `xxxxx` corresponds to a `.opencl` kernel file as found in `src/kernels`. These kernels corresponds to routines (e.g. `xgemm`) or to common pre-processing or post-processing kernels (`copy` and `transpose`). Running such a tuner will test a number of parameter-value combinations on your device and report which one gave the best performance. Running `make alltuners` runs all tuners for all precisions in one go. You can set the default device and platform for `alltuners` by setting the `CLBLAST_DEVICE` and `CLBLAST_PLATFORM` environmental variables before running CMake. The tuners output a JSON-file with the results. The best results need to be added to `src/database/kernels/xxxxx.hpp` in the appropriate section. However, this can be done automatically based on the JSON-data using a Python script in `scripts/database/database.py`. If you want the found parameters to be included in future releases of CLBlast, please attach the JSON files to the corresponding issue on GitHub or [email the main author](http://www.cedricnugteren.nl). @@ -168,7 +168,7 @@ To build these tests, another BLAS library is needed to serve as a reference. Th Afterwards, executables in the form of `clblast_test_xxxxx` are available, in which `xxxxx` is the name of a routine (e.g. `xgemm`). Note that CLBlast is tested for correctness against [clBLAS](http://github.com/clMathLibraries/clBLAS) and/or a regular CPU BLAS library. If both are installed on your system, setting the command-line option `-clblas 1` or `-cblas 1` will select the library to test against for the `clblast_test_xxxxx` executables. All tests have a `-verbose` option to enable additional diagnostic output. They also have a `-full_test` option to increase coverage further. -All tests can be run directly together in one go through the `make alltests` target or using CTest (`make test` or `ctest`). In the latter case the output is less verbose. Both cases allow you to set the default device and platform to non-zero by setting the `DEFAULT_DEVICE` and `DEFAULT_PLATFORM` environmental variables before running CMake. +All tests can be run directly together in one go through the `make alltests` target or using CTest (`make test` or `ctest`). In the latter case the output is less verbose. Both cases allow you to set the default device and platform to non-zero by setting the `CLBLAST_DEVICE` and `CLBLAST_PLATFORM` environmental variables before running CMake. Compiling the performance tests/clients (optional) -- cgit v1.2.3 From 4b94afda941a86f363064ff02f97e21eb9618794 Mon Sep 17 00:00:00 2001 From: Cedric Nugteren Date: Tue, 13 Sep 2016 19:20:39 +0200 Subject: Updated to version 0.9.0 --- CHANGELOG | 2 +- CMakeLists.txt | 2 +- README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CHANGELOG b/CHANGELOG index 10cde25d..1995dc84 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,5 @@ -Development version (next release) +Version 0.9.0 - Updated to version 6.0 of the CLCudaAPI C++11 OpenCL header - Improved performance significantly of rotated GEMV computations - Improved performance of unseen/un-tuned devices by a better default tuning parameter selection diff --git a/CMakeLists.txt b/CMakeLists.txt index ffcdf1a9..178ac9bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/cmake/cxx_fla # CMake project details project("clblast" C CXX) set(clblast_VERSION_MAJOR 0) -set(clblast_VERSION_MINOR 8) +set(clblast_VERSION_MINOR 9) set(clblast_VERSION_PATCH 0) # Options and their default values diff --git a/README.md b/README.md index 51452028..b9631ea0 100644 --- a/README.md +++ b/README.md @@ -288,7 +288,7 @@ The contributing authors (code, pull requests, testing) so far are: * [Hugh Perkins](https://github.com/hughperkins) * [Gian-Carlo Pascutto](https://github.com/gcp) * [Ivan Shapovalov](https://github.com/intelfx) -* [Dimitri VA](https://github.com/dvasschemacq) +* [Dimitri Van Assche](https://github.com/dvasschemacq) Tuning and testing on a variety of OpenCL devices was made possible by: -- cgit v1.2.3