From c5be7a790947cddcc1fe6fc45c10a2a45b694d94 Mon Sep 17 00:00:00 2001 From: Ouadie EL FAROUKI Date: Wed, 6 Mar 2024 17:41:31 +0000 Subject: [PATCH] minor fixes and reverting of ACPP changes causing unexpected tests & header only lib behaviors --- cmake/Modules/SYCL.cmake | 12 ++++++---- include/container/sycl_iterator.h | 40 +++++++------------------------ samples/CMakeLists.txt | 4 ++++ 3 files changed, 19 insertions(+), 37 deletions(-) diff --git a/cmake/Modules/SYCL.cmake b/cmake/Modules/SYCL.cmake index 31f28245e..a4efc0226 100644 --- a/cmake/Modules/SYCL.cmake +++ b/cmake/Modules/SYCL.cmake @@ -26,11 +26,13 @@ include(CheckCXXCompilerFlag) include(ConfigurePORTBLAS) # find_package(AdaptiveCpp) requires ACPP_TARGETS to be set, so set it to a default value before find_package(AdaptiveCpp) -if(SYCL_COMPILER MATCHES "adaptivecpp" AND NOT ACPP_TARGETS AND NOT ENV{ACPP_TARGETS}) - message(STATUS "Using `omp` as ACPP_TARGETS") - set(ACPP_TARGETS "omp") -else() - message(STATUS "Using ${ACPP_TARGETS} as ACPP_TARGETS") +if(SYCL_COMPILER MATCHES "adaptivecpp") + if(NOT ACPP_TARGETS AND NOT ENV{ACPP_TARGETS}) + message(STATUS "Using `omp` as ACPP_TARGETS") + set(ACPP_TARGETS "omp") + else() + message(STATUS "Using ${ACPP_TARGETS} as ACPP_TARGETS") + endif() endif() check_cxx_compiler_flag("--acpp-targets" has_acpp) diff --git a/include/container/sycl_iterator.h b/include/container/sycl_iterator.h index 9e12939ed..e6ea4f953 100644 --- a/include/container/sycl_iterator.h +++ b/include/container/sycl_iterator.h @@ -194,32 +194,17 @@ template inline typename BufferIterator::template accessor_t BufferIterator::get_range_accessor(cl::sycl::handler& cgh, size_t size) { - if constexpr (acc_md_t == cl::sycl::access::mode::read) { - return typename BufferIterator::template accessor_t( - buffer_, cgh, cl::sycl::range<1>(size), - cl::sycl::id<1>(BufferIterator::get_offset())); - } else { - // Skip data initialization if not accessing in read mode only - return typename BufferIterator::template accessor_t( - buffer_, cgh, cl::sycl::range<1>(size), - cl::sycl::id<1>(BufferIterator::get_offset()), - cl::sycl::property::no_init{}); - } + return typename BufferIterator::template accessor_t( + buffer_, cgh, cl::sycl::range<1>(size), + cl::sycl::id<1>(BufferIterator::get_offset())); } template template inline typename BufferIterator::template accessor_t BufferIterator::get_range_accessor(cl::sycl::handler& cgh) { - if constexpr (acc_md_t == cl::sycl::access::mode::read) { - return BufferIterator::get_range_accessor( - cgh, BufferIterator::get_size()); - } else { - // Skip data initialization if not accessing in read mode only - return BufferIterator::get_range_accessor( - cgh, BufferIterator::get_size(), - cl::sycl::property::no_init{}); - } + return BufferIterator::get_range_accessor( + cgh, BufferIterator::get_size()); } template @@ -227,18 +212,9 @@ template inline typename BufferIterator::template placeholder_accessor_t< acc_md_t> BufferIterator::get_range_accessor(size_t size) { - if constexpr (acc_md_t == cl::sycl::access::mode::read) { - return typename BufferIterator::template placeholder_accessor_t< - acc_md_t>(buffer_, cl::sycl::range<1>(size), - cl::sycl::id<1>(BufferIterator::get_offset())); - - } else { - // Skip data initialization if not accessing in read mode only - return typename BufferIterator::template placeholder_accessor_t< - acc_md_t>(buffer_, cl::sycl::range<1>(size), - cl::sycl::id<1>(BufferIterator::get_offset()), - cl::sycl::property::no_init{}); - } + return typename BufferIterator::template placeholder_accessor_t< + acc_md_t>(buffer_, cl::sycl::range<1>(size), + cl::sycl::id<1>(BufferIterator::get_offset())); } template diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index eac74afb7..d5a99be3f 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -1,3 +1,7 @@ +cmake_minimum_required(VERSION 3.4.3) + +project(portBLASSample LANGUAGES CXX) + set(PORTBLAS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../include) set(PORTBLAS_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../src) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})