Skip to content

Commit

Permalink
Changing TUNING_TARGET from DEFAULT_CPU to DEFAULT
Browse files Browse the repository at this point in the history
This tuning target is capable of compiling for every device if
DPCPP_SYCL_TARGET and DPCPP_SYCL_ARCH are specified correctly.
So this comment is a first step in changing this target behaviour and
increasing general understanding.
  • Loading branch information
s-Nick committed Apr 29, 2024
1 parent 896c9a7 commit 192e5e3
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ Some of the supported options are:
| `BLAS_ENABLE_TESTING` | `ON`/`OFF` | Set it to `OFF` to avoid building the tests (`ON` is the default value) |
| `BLAS_ENABLE_BENCHMARK` | `ON`/`OFF` | Set it to `OFF` to avoid building the benchmarks (`ON` is the default value) |
| `SYCL_COMPILER` | name | Used to determine which SYCL implementation to use. By default, the first implementation found is used. Supported values are: `dpcpp`, `adaptivecpp` and `computecpp`*(deprecated)*. |
| `TUNING_TARGET` | name | By default, this flag is set to `DEFAULT_CPU` to restrict any device specific compiler optimizations. Use this flag to tune the code for a target (**highly recommended** for performance). The supported targets are: `INTEL_GPU`, `NVIDIA_GPU`, `AMD_GPU` |
| `TUNING_TARGET` | name | By default, this flag is set to `DEFAULT` to restrict any device specific compiler optimizations. Use this flag to tune the code for a target (**highly recommended** for performance). The supported targets are: `INTEL_GPU`, `NVIDIA_GPU`, `AMD_GPU` |
| `CMAKE_PREFIX_PATH` | path | List of paths to check when searching for dependencies |
| `CMAKE_INSTALL_PREFIX` | path | Specify the install location, used when invoking `ninja install` |
| `BUILD_SHARED_LIBS` | `ON`/`OFF` | Build as shared library (`ON` by default) |
Expand Down
8 changes: 4 additions & 4 deletions cmake/CmakeFunctionHelper.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ function(set_target_compile_def in_target)
elseif(${TUNING_TARGET} STREQUAL "NVIDIA_GPU")
target_compile_definitions(${in_target} PUBLIC NVIDIA_GPU=1)
else()
if(NOT ${TUNING_TARGET} STREQUAL "DEFAULT_CPU")
message(STATUS "${TUNING_TARGET} not supported. Switching to DEFAULT_CPU instead.")
set(TUNING_TARGET "DEFAULT_CPU")
if(NOT ${TUNING_TARGET} STREQUAL "DEFAULT")
message(STATUS "${TUNING_TARGET} not supported. Switching to DEFAULT instead.")
set(TUNING_TARGET "DEFAULT")
endif()
target_compile_definitions(${in_target} PUBLIC DEFAULT_CPU=1)
target_compile_definitions(${in_target} PUBLIC DEFAULT=1)
endif()
message(STATUS "Adding ${TUNING_TARGET} backend to target ${in_target}")
#setting tall skinny support
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/ConfigurePORTBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ if(NAIVE_GEMM)
endif()

# the TUNING_TARGET variable defines the platform for which the sycl library is tuned
SET(TUNING_TARGET "DEFAULT_CPU" CACHE STRING "Default Platform 'DEFAULT_CPU'")
SET(TUNING_TARGET "DEFAULT" CACHE STRING "Default Platform 'DEFAULT'")
message(STATUS "${TUNING_TARGET} is chosen as a tuning target")

if(DEFINED TARGET)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Modules/SYCL.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ elseif(is_adaptivecpp)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
get_target_property(SYCL_INCLUDE_DIRS AdaptiveCpp::acpp-rt INTERFACE_INCLUDE_DIRECTORIES)
set(HIP_BENCH_UNSUPPORTED_TARGETS "INTEL_GPU" "DEFAULT_CPU")
set(HIP_BENCH_UNSUPPORTED_TARGETS "INTEL_GPU" "DEFAULT")
if((${BLAS_ENABLE_BENCHMARK}) AND (${TUNING_TARGET} IN_LIST HIP_BENCH_UNSUPPORTED_TARGETS))
message(STATUS "Benchmarks are not supported when targetting OpenCL/LevelZero backend
devices. portBLAS Benchmarks are disabled.")
Expand Down
4 changes: 2 additions & 2 deletions src/interface/blas1/backend/default_cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @filename defaul_cpu.hpp
*
**************************************************************************/
#ifndef PORTBLAS_ASUM_DEFAULT_CPU_BACKEND_HPP
#define PORTBLAS_ASUM_DEFAULT_CPU_BACKEND_HPP
#ifndef PORTBLAS_ASUM_DEFAULT_BACKEND_HPP
#define PORTBLAS_ASUM_DEFAULT_BACKEND_HPP
#include "interface/blas1_interface.h"

namespace blas {
Expand Down
4 changes: 2 additions & 2 deletions src/interface/blas2/backend/default_cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @filename default_cpu.hpp
*
**************************************************************************/
#ifndef PORTBLAS_GEMV_DEFAULT_CPU_BACKEND_HPP
#define PORTBLAS_GEMV_DEFAULT_CPU_BACKEND_HPP
#ifndef PORTBLAS_GEMV_DEFAULT_BACKEND_HPP
#define PORTBLAS_GEMV_DEFAULT_BACKEND_HPP
#include "interface/blas2_interface.h"

namespace blas {
Expand Down
4 changes: 2 additions & 2 deletions src/interface/blas3/backend/default_cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @filename default_cpu.hpp
*
**************************************************************************/
#ifndef PORTBLAS_GEMM_DEFAULT_CPU_BACKEND_HPP
#define PORTBLAS_GEMM_DEFAULT_CPU_BACKEND_HPP
#ifndef PORTBLAS_GEMM_DEFAULT_BACKEND_HPP
#define PORTBLAS_GEMM_DEFAULT_BACKEND_HPP
#include "interface/gemm_launcher.h"

namespace blas {
Expand Down
4 changes: 2 additions & 2 deletions src/interface/extension/backend/default_cpu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @filename default_cpu.hpp
*
**************************************************************************/
#ifndef PORTBLAS_TRANSPOSE_DEFAULT_CPU_BACKEND_HPP
#define PORTBLAS_TRANSPOSE_DEFAULT_CPU_BACKEND_HPP
#ifndef PORTBLAS_TRANSPOSE_DEFAULT_BACKEND_HPP
#define PORTBLAS_TRANSPOSE_DEFAULT_BACKEND_HPP
#include "interface/extension_interface.h"

namespace blas {
Expand Down
6 changes: 3 additions & 3 deletions test/unittest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ if(is_dpcpp)
)
endif()

if(is_dpcpp AND ${TUNING_TARGET} STREQUAL "DEFAULT_CPU")
if(is_dpcpp AND ${TUNING_TARGET} STREQUAL "DEFAULT")
if (${DPCPP_SYCL_TARGET} STREQUAL "nvptx64-nvidia-cuda")
set(DEFAULT_SKIP
${PORTBLAS_UNITTEST}/blas1/blas1_iamax_test.cpp
Expand All @@ -111,7 +111,7 @@ if(is_dpcpp AND ${TUNING_TARGET} STREQUAL "DEFAULT_CPU")
${PORTBLAS_UNITTEST}/blas2/blas2_tpsv_test.cpp
${PORTBLAS_UNITTEST}/blas3/blas3_trsm_test.cpp
)
message(WARNING "Targetting NVIDIA hardware with DEFAULT_CPU TUNING_TARGET.
message(WARNING "Targetting NVIDIA hardware with DEFAULT TUNING_TARGET.
Disabling tests for following operators: iamax, iamin, trsv, tbsv, tpsv, trsm.")
elseif(${DPCPP_SYCL_TARGET} STREQUAL "amdgcn-amd-amdhsa")
set(DEFAULT_SKIP
Expand All @@ -120,7 +120,7 @@ if(is_dpcpp AND ${TUNING_TARGET} STREQUAL "DEFAULT_CPU")
${PORTBLAS_UNITTEST}/blas2/blas2_tbsv_test.cpp
${PORTBLAS_UNITTEST}/blas2/blas2_tpsv_test.cpp
)
message(WARNING "Targetting AMD hardware with DEFAULT_CPU TUNING_TARGET.
message(WARNING "Targetting AMD hardware with DEFAULT TUNING_TARGET.
Disabling tests for following operators: iamax, iamin, tbsv, tpsv.")
endif()
endif()
Expand Down

0 comments on commit 192e5e3

Please sign in to comment.