Skip to content

Commit

Permalink
[BLAS] Fix AMD GPU backend with hipSYCL (uxlfoundation#439)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmeterel authored Jan 22, 2024
1 parent 55a8b40 commit f5dc527
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
22 changes: 15 additions & 7 deletions src/blas/backends/rocblas/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ target_include_directories(${LIB_OBJ}
${PROJECT_BINARY_DIR}/bin
${ONEMKL_GENERATED_INCLUDE_PATH}
)
target_compile_options(${LIB_OBJ} PRIVATE ${ONEMKL_BUILD_COPT})
target_compile_options(ONEMKL::SYCL::SYCL INTERFACE
-fsycl-targets=amdgcn-amd-amdhsa -fsycl-unnamed-lambda
-Xsycl-target-backend --offload-arch=${HIP_TARGETS})
target_link_options(ONEMKL::SYCL::SYCL INTERFACE
-fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend
--offload-arch=${HIP_TARGETS})

if(NOT ${ONEMKL_SYCL_IMPLEMENTATION} STREQUAL "hipsycl")
target_compile_options(${LIB_OBJ} PRIVATE ${ONEMKL_BUILD_COPT})
target_compile_options(ONEMKL::SYCL::SYCL INTERFACE
-fsycl-targets=amdgcn-amd-amdhsa -fsycl-unnamed-lambda
-Xsycl-target-backend --offload-arch=${HIP_TARGETS})
target_link_options(ONEMKL::SYCL::SYCL INTERFACE
-fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend
--offload-arch=${HIP_TARGETS})
else()
target_compile_options(${LIB_OBJ} PRIVATE ${ONEMKL_BUILD_COPT})
target_compile_options(ONEMKL::SYCL::SYCL INTERFACE)
target_link_options(ONEMKL::SYCL::SYCL INTERFACE)
endif()

target_link_libraries(${LIB_OBJ} PUBLIC ONEMKL::SYCL::SYCL ONEMKL::rocBLAS::rocBLAS)
target_compile_features(${LIB_OBJ} PUBLIC cxx_std_17)
set_target_properties(${LIB_OBJ} PROPERTIES
Expand Down
2 changes: 1 addition & 1 deletion src/blas/backends/rocblas/rocblas_helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#define _ROCBLAS_HELPER_HPP_

#include <rocblas.h>
#include <rocblas/rocblas.h>
#include <complex>
#include "oneapi/mkl/types.hpp"
#include <hip/hip_runtime.h>
Expand Down
2 changes: 1 addition & 1 deletion src/blas/backends/rocblas/rocblas_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
**************************************************************************/
#ifndef _ROCBLAS_TASK_HPP_
#define _ROCBLAS_TASK_HPP_
#include <rocblas.h>
#include <rocblas/rocblas.h>
#include <complex>
#if __has_include(<sycl/sycl.hpp>)
#include <sycl/sycl.hpp>
Expand Down

0 comments on commit f5dc527

Please sign in to comment.