Skip to content

Commit 6b649bf

Browse files
authored
Fix build error in expression tests (codeplaysoftware#359)
Update Gemm documentation with TARGET changes Fix typos in rotmg comments
1 parent 983dba0 commit 6b649bf

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

doc/Gemm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ The notable calls in the stack are (all located in `src/interface/gemm_interface
163163
164164
## GEMM Backends
165165
166-
GEMM backends are a mechanism to provide different compile-time configurations for different hardware platforms/backends.
167-
Backend selection is controlled by passing the cmake variable `TARGET` during CMake configuration, for example passing `-DTARGET=INTEL_GPU` would select the appropriate configurations for Intel GPUs.
166+
GEMM backends are a mechanism to provide different compile-time configurations for different hardware platforms/backends.
167+
Backend selection is controlled by passing the cmake variable `TUNING_TARGET` during CMake configuration, for example passing `-DTUNING_TARGET=INTEL_GPU` would select the appropriate configurations for Intel GPUs.
168168
This cmake variable causes a corresponding define for the selected platform to be included in the source which then controls backend selection through `#ifdef`s in `src/interface/blas3/backend/backend.hpp` like so:
169169
170170
```c++
@@ -392,7 +392,7 @@ Configurations are provided per backend target and will be generated for each da
392392
As an example let's look at the configurations in `CmakeFunctionHelper.cmake` for the `RCAR` target backend, inside the function `generate_blas_gemm_objects`:
393393

394394
```cmake
395-
if(${TARGET} STREQUAL "RCAR")
395+
if(${TUNING_TARGET} STREQUAL "RCAR")
396396
set(supported_types
397397
"float"
398398
)

src/operations/blas1_trees.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ SYCL_BLAS_INLINE typename Rotmg<operand_t>::value_t Rotmg<operand_t>::eval(
662662
* overflows. Consult the papers above for more info */
663663
constexpr value_t gamma = static_cast<value_t>(4096.0);
664664

665-
/* Square of gamma. It is hardcoded to avoid computing it on every call */
665+
/* Square of gamma. */
666666
constexpr value_t gamma_sq = gamma * gamma;
667667

668668
/* Inverse of the square of gamma (i.e. 1 / (gamma * gamma)) */
@@ -703,7 +703,7 @@ SYCL_BLAS_INLINE typename Rotmg<operand_t>::value_t Rotmg<operand_t>::eval(
703703
* Scaling may be needed */
704704
else if ((d1 == zero::value() || x1 == zero::value()) && d2 > zero::value()) {
705705
flag = clts_flag::value();
706-
/* clts_matrix assumes h12 and h21 values. But they still need to be set
706+
/* clts_flag assumes h12 and h21 values. But they still need to be set
707707
* because of possible re-scaling */
708708
h12 = one::value();
709709
h21 = m_one::value();
@@ -727,7 +727,7 @@ SYCL_BLAS_INLINE typename Rotmg<operand_t>::value_t Rotmg<operand_t>::eval(
727727

728728
if (abs_c > abs_s) {
729729
flag = sltc_flag::value();
730-
/* sltc_matrix assumes h11 and h22 values. But they still need to be set
730+
/* sltc_flag assumes h11 and h22 values. But they still need to be set
731731
* because of possible re-scaling */
732732
h11 = one::value();
733733
h22 = one::value();
@@ -750,7 +750,7 @@ SYCL_BLAS_INLINE typename Rotmg<operand_t>::value_t Rotmg<operand_t>::eval(
750750
} else {
751751
flag = clts_flag::value();
752752

753-
/* clts_matrix assumes h12 and h21 values. But they still need to be set
753+
/* clts_flag assumes h12 and h21 values. But they still need to be set
754754
* because of possible re-scaling */
755755
h12 = one::value();
756756
h21 = m_one::value();

test/exprtest/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222
# * @filename CMakeLists.txt
2323
# *
2424
# **************************************************************************/
25-
add_definitions(-D${TARGET})
26-
2725
set(SYCLBLAS_EXPRTEST ${CMAKE_CURRENT_SOURCE_DIR})
2826

2927
# compiling tests
@@ -36,7 +34,11 @@ set(SYCL_EXPRTEST_SRCS
3634
foreach(blas_test ${SYCL_EXPRTEST_SRCS})
3735
get_filename_component(test_exec ${blas_test} NAME_WE)
3836
add_executable(${test_exec} main.cpp ${blas_test})
39-
target_compile_definitions(${test_exec} PRIVATE -DBLAS_INDEX_T=${BLAS_TEST_INDEX_TYPE})
37+
if(is_computecpp)
38+
set_property(TARGET ${test_exec} PROPERTY CXX_STANDARD 14)
39+
endif()
40+
# -DTUNING_TARGET is needed when using SYCL-BLAS in header only mode.
41+
target_compile_definitions(${test_exec} PRIVATE -DBLAS_INDEX_T=${BLAS_TEST_INDEX_TYPE} -D${TUNING_TARGET})
4042
target_link_libraries(${test_exec} PRIVATE gtest_main blas::blas sycl_blas)
4143
target_include_directories(${test_exec} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/.." ${CBLAS_INCLUDE} ${SYCLBLAS_SRC} ${SYCLBLAS_COMMON_INCLUDE_DIR})
4244
add_sycl_to_target(

test/unittest/blas1/blas1_rotmg_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ void RotmgTest<scalar_t>::validate_with_reference() {
169169
* side of the following formula is calculated by rotm.
170170
*
171171
* x1_output * sqrt(d1_output) = [ h11 h12 ] * [ x1_input]
172-
* 0.0 * sqrt(d2_output) [h21 h22 ] [ y1_input]
172+
* 0.0 * sqrt(d2_output) [ h21 h22 ] [ y1_input]
173173
*/
174174
template <typename scalar_t>
175175
void RotmgTest<scalar_t>::validate_with_rotm() {

0 commit comments

Comments
 (0)