Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename SYCL-BLAS to portBLAS #455

Merged
merged 3 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ jobs:
--build-arg git_slug=${GIT_SLUG}
--build-arg impl=${IMPL}
--build-arg command=${COMMAND}
-t sycl-blas .
-t portblas .
- name: Run the Docker image
run: docker run -t sycl-blas
run: docker run -t portblas
# Builds the dockerfile in the repo and uses that to build auto-tuner.
Build-Auto-Tuner:
needs: skip-check
Expand Down Expand Up @@ -116,6 +116,6 @@ jobs:
--build-arg git_slug=${GIT_SLUG}
--build-arg impl=${IMPL}
--build-arg command=${COMMAND}
-t sycl-blas .
-t portblas .
- name: Run the Docker image
run: docker run -t sycl-blas
run: docker run -t portblas
90 changes: 45 additions & 45 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *
# * SYCL-BLAS: BLAS implementation using SYCL
# * portBLAS: BLAS implementation using SYCL
# *
# * @filename CMakeLists.txt
# *
# **************************************************************************/
cmake_minimum_required(VERSION 3.4.3)
project(sycl-blas VERSION 0.1.0 LANGUAGES CXX)
project(portBLAS VERSION 0.1.0 LANGUAGES CXX)

if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
Expand All @@ -36,7 +36,7 @@ if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
endif()

option(INSTALL_HEADER_ONLY "Install SYCL-BLAS as a header only library" OFF)
option(INSTALL_HEADER_ONLY "Install portBLAS as a header only library" OFF)

set(BUILD_SHARED_LIBS ON CACHE BOOL "")
set(CMAKE_CXX_STANDARD 14)
Expand All @@ -58,27 +58,27 @@ list(APPEND CMAKE_MODULE_PATH
)

# This turns the long file names that are generated into short versions using a hash
# This is required to build SYCL-BLAS on Windows and on WSL since Windows doesn't
# This is required to build portBLAS on Windows and on WSL since Windows doesn't
# have good support for long file names
option(SYCLBLAS_USE_SHORT_NAMES "Whether to use short names for generated files" OFF)
option(PORTBLAS_USE_SHORT_NAMES "Whether to use short names for generated files" OFF)
if (WIN32)
# On WIN32 we can force this option to be true, but when building on WSL this
# must be set in the command line
set(SYCLBLAS_USE_SHORT_NAMES ON CACHE BOOL "Enable short names for generated files in Windows" FORCE)
set(PORTBLAS_USE_SHORT_NAMES ON CACHE BOOL "Enable short names for generated files in Windows" FORCE)
endif()

# Setup datatypes, workgroup sizes and other options.
# NB: This has to be included before CmakeFunctionHelper as it declares various options.
if (NOT INSTALL_HEADER_ONLY)
include(ConfigureSYCLBLAS)
include(ConfigurePORTBLAS)
include(SYCL)
find_package(PythonInterp 3 REQUIRED)
endif()

if (MSVC)
# The device compiler needs C++14 to parse the Windows headers
set(BUILD_SHARED_LIBS FALSE CACHE BOOL
"Force SYCL-BLAS to be built as a static library on Windows"
"Force portBLAS to be built as a static library on Windows"
FORCE
)
endif()
Expand All @@ -91,12 +91,12 @@ option(GEMM_VECTORIZATION_SUPPORT "Whether to enable vectorization in Gemm kerne
add_definitions(-DCL_TARGET_OPENCL_VERSION=220)

set(CBLAS_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/external/cblas/include)
set(SYCLBLAS_GENERATED_SRC ${CMAKE_CURRENT_BINARY_DIR}/generated_src)
set(SYCLBLAS_INCLUDE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
set(PORTBLAS_GENERATED_SRC ${CMAKE_CURRENT_BINARY_DIR}/generated_src)
set(PORTBLAS_INCLUDE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)
set(SYCLBLAS_COMMON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/common/include)
set(SYCLBLAS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(SYCLBLAS_SRC_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/python_generator)
set(PORTBLAS_COMMON_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/common/include)
set(PORTBLAS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(PORTBLAS_SRC_GENERATOR ${CMAKE_CURRENT_SOURCE_DIR}/python_generator)
list(APPEND THIRD_PARTIES_INCLUDE ${CBLAS_INCLUDE})

if(IMGDNN_DIR)
Expand All @@ -105,7 +105,7 @@ if(IMGDNN_DIR)
list(APPEND THIRD_PARTIES_INCLUDE ${IMGDNN_INCLUDE_DIRS})
endif()

option(BLAS_ENABLE_EXTENSIONS "Whether to enable sycl-blas extensions" ON)
option(BLAS_ENABLE_EXTENSIONS "Whether to enable portBLAS extensions" ON)

# CmakeFunctionHelper has to be included after any options that it depends on are declared.
# These include:
Expand All @@ -118,91 +118,91 @@ option(BLAS_ENABLE_EXTENSIONS "Whether to enable sycl-blas extensions" ON)
include(CmakeFunctionHelper)

if (INSTALL_HEADER_ONLY)
add_library(sycl_blas INTERFACE)
set_target_properties(sycl_blas PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${SYCLBLAS_INCLUDE};$<INSTALL_INTERFACE:src>"
add_library(portblas INTERFACE)
set_target_properties(portblas PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${PORTBLAS_INCLUDE};$<INSTALL_INTERFACE:src>"
)
else()
add_subdirectory(src)
build_library(sycl_blas ${BLAS_ENABLE_EXTENSIONS})
build_library(portblas ${BLAS_ENABLE_EXTENSIONS})
if (WIN32)
# On Windows, all symbols must be resolved at link time for DLLs.
# The sycl_blas target is just a collection of other objects so
# The portblas target is just a collection of other objects so
# the linked libraries are not going to be propagated to this target.
# This requires manual linking against SYCL on Windows.
if(is_computecpp)
target_link_libraries(sycl_blas PUBLIC ComputeCpp::ComputeCpp)
target_link_libraries(portblas PUBLIC ComputeCpp::ComputeCpp)
elseif(is_dpcpp)
target_link_libraries(sycl_blas PUBLIC DPCPP::DPCPP)
target_link_libraries(portblas PUBLIC DPCPP::DPCPP)
elseif(is_hipsycl)
target_link_libraries(sycl_blas PUBLIC hipSYCL::hipSYCL-rt)
target_link_libraries(portblas PUBLIC hipSYCL::hipSYCL-rt)
endif()
endif()
if(is_computecpp)
set(sycl_impl ComputeCpp::ComputeCpp)
elseif(is_dpcpp)
set(sycl_impl DPCPP::DPCPP)
add_sycl_to_target(TARGET sycl_blas SOURCES)
add_sycl_to_target(TARGET portblas SOURCES)
elseif(is_hipsycl)
set(sycl_impl hipSYCL::hipSYCL-rt)
add_sycl_to_target(TARGET sycl_blas SOURCES)
add_sycl_to_target(TARGET portblas SOURCES)
endif()
if(IMGDNN_DIR)
target_link_libraries(sycl_blas PUBLIC IMGDNN::IMGDNN)
target_link_libraries(portblas PUBLIC IMGDNN::IMGDNN)
endif()
set_target_properties(sycl_blas PROPERTIES
set_target_properties(portblas PROPERTIES
INTERFACE_LINK_LIBRARIES ${sycl_impl}
INTERFACE_INCLUDE_DIRECTORIES "${SYCLBLAS_INCLUDE}"
INTERFACE_INCLUDE_DIRECTORIES "${PORTBLAS_INCLUDE}"
)
set_target_properties(sycl_blas PROPERTIES
set_target_properties(portblas PROPERTIES
VERSION ${PROJECT_VERSION}
)
endif()

include(CMakePackageConfigHelpers)
set(version_file "${CMAKE_CURRENT_BINARY_DIR}/cmake/sycl_blas-version.cmake")
set(version_file "${CMAKE_CURRENT_BINARY_DIR}/cmake/portblas-version.cmake")
write_basic_package_version_file(${version_file}
VERSION ${PROJECT_VERSION}
COMPATIBILITY AnyNewerVersion
)

include(GNUInstallDirs)
install(TARGETS sycl_blas
EXPORT sycl_blas
install(TARGETS portblas
EXPORT portblas
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

install(DIRECTORY ${SYCLBLAS_INCLUDE}
install(DIRECTORY ${PORTBLAS_INCLUDE}
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT sycl_blas
COMPONENT portblas
FILES_MATCHING PATTERN "*.h"
)
if (INSTALL_HEADER_ONLY)
install(DIRECTORY ${SYCLBLAS_SRC}
install(DIRECTORY ${PORTBLAS_SRC}
DESTINATION ${CMAKE_INSTALL_PREFIX}
COMPONENT sycl_blas
COMPONENT portblas
FILES_MATCHING PATTERN "*.hpp"
)
endif()

install(FILES ${version_file} DESTINATION ${CMAKE_INSTALL_PREFIX})
install(EXPORT sycl_blas
install(EXPORT portblas
DESTINATION ${CMAKE_INSTALL_PREFIX}
NAMESPACE SYCL_BLAS::
FILE sycl_blas-config.cmake
NAMESPACE PORTBLAS::
FILE portblas-config.cmake
)

export(EXPORT sycl_blas
NAMESPACE SYCL_BLAS::
FILE sycl_blas-config.cmake
export(EXPORT portblas
NAMESPACE PORTBLAS::
FILE portblas-config.cmake
)

option(BLAS_ENABLE_TESTING "Whether to enable testing" ON)
option(ENABLE_EXPRESSION_TESTS "Whether to build expression tree fusion tests" OFF)
if (INSTALL_HEADER_ONLY AND BLAS_ENABLE_TESTING)
message(STATUS "Tests are disabled when installing SYCL-BLAS in header only mode")
message(STATUS "Tests are disabled when installing portBLAS in header only mode")
set(BLAS_ENABLE_TESTING OFF)
endif()

Expand All @@ -219,13 +219,13 @@ option(BUILD_CLBLAS_BENCHMARKS "Whether to build clBLAS benchmarks" OFF)
option(BUILD_CUBLAS_BENCHMARKS "Whether to build cuBLAS benchmarks" OFF)
option(BUILD_ROCBLAS_BENCHMARKS "Whether to build rocBLAS benchmarks" OFF)
option(BUILD_ACL_BENCHMARKS "Whether to build ARM Compute Library benchmarks" OFF)
option(BLAS_BUILD_SAMPLES "Whether to build SYCL-BLAS samples" ON)
option(BLAS_BUILD_SAMPLES "Whether to build portBLAS samples" ON)
if (INSTALL_HEADER_ONLY AND BLAS_ENABLE_BENCHMARK)
message(STATUS "Benchmarks are disabled when installing SYCL-BLAS in header only mode")
message(STATUS "Benchmarks are disabled when installing portBLAS in header only mode")
set(BLAS_ENABLE_BENCHMARK OFF)
endif()
if (INSTALL_HEADER_ONLY AND BLAS_BUILD_SAMPLES)
message(STATUS "Samples are disabled when installing SYCL-BLAS in header only mode")
message(STATUS "Samples are disabled when installing portBLAS in header only mode")
set(BLAS_BUILD_SAMPLES OFF)
endif()

Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@ RUN if [ "${c_compiler}" = 'gcc-7' ]; then apt-get install -yq \
RUN apt-get install -yq --allow-downgrades --allow-remove-essential \
--allow-change-held-packages ocl-icd-opencl-dev ocl-icd-dev opencl-headers

RUN git clone https://github.com/${git_slug}.git --recursive -b ${git_branch} /sycl-blas
RUN git clone https://github.com/${git_slug}.git --recursive -b ${git_branch} /portBLAS

#OpenBLAS
RUN bash /sycl-blas/.scripts/build_OpenBLAS.sh
RUN bash /portBLAS/.scripts/build_OpenBLAS.sh
# Intel OpenCL Runtime
RUN bash /sycl-blas/.scripts/install_intel_opencl.sh
RUN bash /portBLAS/.scripts/install_intel_opencl.sh

# SYCL
RUN if [ "${impl}" = 'COMPUTECPP' ]; then cd /sycl-blas && bash /sycl-blas/.scripts/build_computecpp.sh; fi
RUN if [ "${impl}" = 'DPCPP' ]; then cd /sycl-blas && bash /sycl-blas/.scripts/build_dpcpp.sh; fi
RUN if [ "${impl}" = 'COMPUTECPP' ]; then cd /portBLAS && bash /portBLAS/.scripts/build_computecpp.sh; fi
RUN if [ "${impl}" = 'DPCPP' ]; then cd /portBLAS && bash /portBLAS/.scripts/build_dpcpp.sh; fi

ENV COMMAND=${command}
ENV CC=${c_compiler}
ENV CXX=${cxx_compiler}
ENV SYCL_IMPL=${impl}

CMD cd /sycl-blas && \
CMD cd /portBLAS && \
if [ "${COMMAND}" = 'build-test' ]; then \
if [ "${SYCL_IMPL}" = 'COMPUTECPP' ]; then \
/tmp/ComputeCpp-latest/bin/computecpp_info && \
Expand Down
2 changes: 1 addition & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SYCL-BLAS
portBLAS
Copyright (C) Codeplay Software Limited.
Loading