Skip to content

Commit

Permalink
syclstd 2017 in new release to propagate subgroup
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Oct 5, 2021
1 parent b9013be commit 073d2fa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions cmake/create_test.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function(ginkgo_create_dpcpp_test test_name)
add_executable(${test_target_name} ${test_name}.dp.cpp)
target_compile_features(${test_target_name} PUBLIC cxx_std_17)
target_compile_options(${test_target_name} PRIVATE "${GINKGO_DPCPP_FLAGS}")
target_compile_options(${test_target_name} PRIVATE "${GINKGO_COMPILER_FLAGS}")
target_link_options(${test_target_name} PRIVATE -fsycl-device-code-split=per_kernel)
ginkgo_set_test_target_properties(${test_name} ${test_target_name})
# Note: MKL_ENV is empty on linux. Maybe need to apply MKL_ENV to all test.
Expand Down
3 changes: 3 additions & 0 deletions dpcpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ target_sources(ginkgo_dpcpp
ginkgo_compile_features(ginkgo_dpcpp)
target_compile_definitions(ginkgo_dpcpp PRIVATE GKO_COMPILING_DPCPP)

# -sycl-std=2017 is temporary workaround after 2021.4 to propagate subgroup setting correctly
set(GINKGO_DPCPP_FLAGS "-sycl-std=2017")
set(GINKGO_DPCPP_FLAGS ${GINKGO_DPCPP_FLAGS} PARENT_SCOPE)
target_compile_options(ginkgo_dpcpp PRIVATE "${GINKGO_DPCPP_FLAGS}")
target_compile_options(ginkgo_dpcpp PRIVATE "${GINKGO_COMPILER_FLAGS}")
# Note: add MKL as PRIVATE not PUBLIC (MKL example shows) to avoid propagating
# find_package(MKL) everywhere when linking ginkgo (see the MKL example
# https://software.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/getting-started/cmake-config-for-onemkl.html)
Expand Down
12 changes: 6 additions & 6 deletions dpcpp/matrix/dense_kernels.dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ namespace dpcpp {
namespace dense {


// Disable the 64 subgroup. CPU supports 64 now, but conj_transpose will
// lead CL_OUT_OF_RESOURCES. TODO: investigate this issue.
using KCFG_1D = ConfigSet<11, 7>;
constexpr auto kcfg_1d_list =
syn::value_list<std::uint32_t, KCFG_1D::encode(512, 64),
KCFG_1D::encode(512, 32), KCFG_1D::encode(512, 16),
KCFG_1D::encode(256, 32), KCFG_1D::encode(256, 16),
KCFG_1D::encode(256, 8)>();
constexpr auto subgroup_list =
syn::value_list<std::uint32_t, 64, 32, 16, 8, 4>();
syn::value_list<std::uint32_t, KCFG_1D::encode(512, 32),
KCFG_1D::encode(512, 16), KCFG_1D::encode(256, 32),
KCFG_1D::encode(256, 16), KCFG_1D::encode(256, 8)>();
constexpr auto subgroup_list = syn::value_list<std::uint32_t, 32, 16, 8, 4>();
constexpr auto kcfg_1d_array = syn::as_array(kcfg_1d_list);
constexpr int default_block_size = 256;

Expand Down

0 comments on commit 073d2fa

Please sign in to comment.