Skip to content

Commit

Permalink
Merge branch 'develop' for 2.9.00
Browse files Browse the repository at this point in the history
Part of Kokkos C++ Performance Portability Programming EcoSystem 2.9
  • Loading branch information
ndellingwood committed Jun 24, 2019
2 parents 4ee5f3c + 094da30 commit d86db11
Show file tree
Hide file tree
Showing 868 changed files with 77,018 additions and 20,733 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Change Log

## [2.9.00](https://github.com/kokkos/kokkos-kernels/tree/2.9.00) (2019-06-24)
[Full Changelog](https://github.com/kokkos/kokkos-kernels/compare/2.8.00...2.9.00)

**Implemented enhancements:**

- KokkosBatched: Add specialization for float2, float4 and double4 [\#427](https://github.com/kokkos/kokkos-kernels/pull/427)
- KokkosBatched: Reduce VectorLength (16 to 8) [\#432](https://github.com/kokkos/kokkos-kernels/pull/432)
- KokkosBatched: Remove experimental name space for batched blas [\#371](https://github.com/kokkos/kokkos-kernels/issues/371)
- Capability: Initial sparse triangular solve capability [\#435](https://github.com/kokkos/kokkos-kernels/pull/435)
- Capability: Add support for MAGMA GESV TPL [\#409](https://github.com/kokkos/kokkos-kernels/pull/409)
- cuBLAS: Add CudaUVMSpace specializations for GEMM [\#397](https://github.com/kokkos/kokkos-kernels/issues/397)

**Fixed bugs:**

- Deprecated Code Fixes [\#411](https://github.com/kokkos/kokkos-kernels/issues/411)
- BuildSystem: Compilation error on rzansel [\#401](https://github.com/kokkos/kokkos-kernels/issues/401)

## [2.8.00](https://github.com/kokkos/kokkos-kernels/tree/2.8.00) (2019-02-05)
[Full Changelog](https://github.com/kokkos/kokkos-kernels/compare/2.7.24...2.8.00)

Expand Down
75 changes: 64 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -290,23 +290,64 @@ ENDIF()
# Enable Third Party Libraries
# ==================================================================

IF (TPL_ENABLE_BLAS)
SET(KOKKOSKERNELS_ENABLE_TPL_BLAS ${TPL_ENABLE_BLAS})
IF (DEFINED KOKKOSKERNELS_ENABLE_TPL_BLAS)
# user overriding kokkoskernels
IF (KOKKOSKERNELS_ENABLE_TPL_BLAS)
IF (NOT TPL_ENABLE_BLAS)
MESSAGE( WARNING "KOKKOSKERNELS_ENABLE_TPL_BLAS is ON but TPL_ENABLE_BLAS is OFF. Please set TPL_ENABLE_BLAS:BOOL=ON")
SET(KOKKOSKERNELS_ENABLE_TPL_BLAS OFF)
ENDIF()
ENDIF()
ELSE()
# default behavior
IF (TPL_ENABLE_BLAS)
SET(KOKKOSKERNELS_ENABLE_TPL_BLAS ${TPL_ENABLE_BLAS})
ENDIF()
ENDIF()
IF (TPL_ENABLE_MKL)
SET(KOKKOSKERNELS_ENABLE_TPL_MKL ${TPL_ENABLE_MKL})

IF (DEFINED KOKKOSKERNELS_ENABLE_TPL_MKL)
# user overriding kokkoskernels
IF (KOKKOSKERNELS_ENABLE_TPL_MKL)
IF (NOT TPL_ENABLE_MKL)
MESSAGE( WARNING "KOKKOSKERNELS_ENABLE_TPL_MKL is ON but TPL_ENABLE_MKL is OFF. Please set TPL_ENABLE_MKL:BOOL=ON")
SET(KOKKOSKERNELS_ENABLE_TPL_MKL OFF)
ENDIF()
ENDIF()
ELSE()
IF (TPL_ENABLE_MKL)
SET(KOKKOSKERNELS_ENABLE_TPL_MKL ${TPL_ENABLE_MKL})
ENDIF()
ENDIF()

IF(${Kokkos_ENABLE_Cuda})
IF (NOT KOKKOSKERNELS_ENABLE_TPL_BLAS)
SET(KOKKOSKERNELS_ENABLE_TPL_BLAS ON)
LIST(APPEND TPL_LIST "BLAS")
ENDIF()
# CUBLAS is ON by default when CUDA is enabled
SET(KOKKOSKERNELS_ENABLE_TPL_CUBLAS ON)
IF (NOT DEFINED KOKKOSKERNELS_ENABLE_TPL_CUBLAS)
SET(KOKKOSKERNELS_ENABLE_TPL_CUBLAS ON)
ENDIF()

# Tribit provides TPL mechanism for CUSPARSE; thus, use it
IF (TPL_ENABLE_CUSPARSE)
SET(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE ${TPL_ENABLE_CUSPARSE})
IF (DEFINED KOKKOSKERNELS_ENABLE_TPL_CUSPARSE)
IF (NOT TPL_ENABLE_CUSPARSE)
MESSAGE( WARNING "KOKKOSKERNELS_ENABLE_TPL_CUSPARSE is ON but TPL_ENABLE_CUSPARSE is OFF. Please set TPL_ENABLE_CUSPARSE:BOOL=ON")
SET(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE OFF)
ENDIF()
ELSE()
IF (TPL_ENABLE_CUSPARSE)
SET(KOKKOSKERNELS_ENABLE_TPL_CUSPARSE ${TPL_ENABLE_CUSPARSE})
ENDIF()
ENDIF()

IF (DEFINED KOKKOSKERNELS_ENABLE_TPL_MAGMA)
IF (KOKKOSKERNELS_ENABLE_TPL_MAGMA)
IF (NOT TPL_ENABLE_MAGMA)
MESSAGE( WARNING "KOKKOSKERNELS_ENABLE_TPL_MAGMA is ON but TPL_ENABLE_MAGMA is OFF. Please set TPL_ENABLE_MAGMA:BOOL=ON")
SET(KOKKOSKERNELS_ENABLE_TPL_MAGMA OFF)
ENDIF()
ENDIF()
ELSE()
IF (TPL_ENABLE_MAGMA)
SET(KOKKOSKERNELS_ENABLE_TPL_MAGMA ${TPL_ENABLE_MAGMA})
ENDIF()
ENDIF()
ENDIF()

Expand All @@ -322,6 +363,18 @@ ENDIF()
IF (KOKKOSKERNELS_ENABLE_TPL_CUBLAS)
LIST(APPEND TPL_LIST "CUBLAS")
ENDIF()
IF (KOKKOSKERNELS_ENABLE_TPL_MAGMA)
LIST(APPEND TPL_LIST "MAGMA")
IF (F77_BLAS_MANGLE STREQUAL "(name,NAME) name ## _")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DADD_ -fopenmp -lgfortran")
ELSEIF (F77_BLAS_MANGLE STREQUAL "(name,NAME) NAME")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DUPCASE -fopenmp -lgfortran")
ELSEIF (F77_BLAS_MANGLE STREQUAL "(name,NAME) name")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNOCHANGE -fopenmp -lgfortran")
ELSE ()
MESSAGE(FATAL_ERROR "F77_BLAS_MANGLE ${F77_BLAS_MANGLE} detected while MAGMA only accepts Fortran mangling that is one of single underscore (-DADD_), uppercase (-DUPCASE), and no change (-DNOCHANGE)")
ENDIF()
ENDIF()

# ==================================================================
# Fortran Complex BLAS
Expand Down
47 changes: 43 additions & 4 deletions Makefile.kokkos-kernels
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ KOKKOSKERNELS_SPACES ?= $(KOKKOS_DEVICES),HostSpace
KOKKOSKERNELS_ORDINALS ?= int,int64_t
KOKKOSKERNELS_OFFSETS ?= int,size_t

# mkl, blas, yaml
# mkl, blas, yaml, magma
KOKKOSKERNELS_ENABLE_TPLS ?= ""

# eti-only
Expand All @@ -23,6 +23,7 @@ KOKKOSKERNELS_INTERNAL_ENABLE_BLAS := $(strip $(shell echo $(KOKKOSKERNELS_ENABL
KOKKOSKERNELS_INTERNAL_ENABLE_MKL := $(strip $(shell echo $(KOKKOSKERNELS_ENABLE_TPLS) | grep "mkl" | wc -l))
KOKKOSKERNELS_INTERNAL_ENABLE_CUSPARSE := $(strip $(shell echo $(KOKKOSKERNELS_ENABLE_TPLS) | grep "cusparse" | wc -l))
KOKKOSKERNELS_INTERNAL_ENABLE_CUBLAS := $(strip $(shell echo $(KOKKOSKERNELS_ENABLE_TPLS) | grep "cublas" | wc -l))
KOKKOSKERNELS_INTERNAL_ENABLE_MAGMA := $(strip $(shell echo $(KOKKOSKERNELS_ENABLE_TPLS) | grep "magma" | wc -l))

YAML_PATH ?= ${HOME}/yaml-cpp/install
YAML_LIBS ?= -L${YAML_PATH}/lib -lyaml-cpp
Expand All @@ -33,6 +34,8 @@ BLAS_LIBS ?= -L${BLAS_PATH}/lib64 $(BLAS_LIBRARIES) -lgfortran -lgomp
MKL_PATH ?= ${SEMS_INTEL_ROOT}/mkl
MKL_LIBS ?= -L${MKL_PATH}/lib/intel64 -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl -L${MKL_PATH}/../compiler/lib/intel64

MAGMA_PATH ?= ${MAGMADIR}

default-kokkos-kernels: kokkoskernels-build-lib
echo "Start Build"

Expand Down Expand Up @@ -77,17 +80,30 @@ tmp := $(shell echo "\#define KOKKOSKERNELS_CONFIG_H_" >> KokkosKernels_config.t

# default mangling scheme with a single under score
KOKKOSKERNELS_FORTRAN_GLOBAL = name\#\#_
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_MAGMA}, 1)
MAGMA_FORTRAN_MANGLING = ADD_
endif

KOKKOSKERNELS_INTERNAL_OVERRIDE_FORTRAN_MANGLING_WITH_DOUBLE_UNDERSCORES := $(strip $(shell echo $(KOKKOSKERNELS_OPTIONS) | grep "blas-mangle__" | wc -l))
ifeq ($(KOKKOSKERNELS_INTERNAL_OVERRIDE_FORTRAN_MANGLING_WITH_DOUBLE_UNDERSCORES), 1)
KOKKOSKERNELS_FORTRAN_GLOBAL = name\#\#__
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_MAGMA}, 1)
$(error MAGMA does not prefer Fortran mangling with double underscore)
endif
else
KOKKOSKERNELS_INTERNAL_OVERRIDE_FORTRAN_MANGLING_WITH_SINGLE_UNDERSCORE := $(strip $(shell echo $(KOKKOSKERNELS_OPTIONS) | grep "blas-mangle_" | wc -l))
ifeq ($(KOKKOSKERNELS_INTERNAL_OVERRIDE_FORTRAN_MANGLING_WITH_SINGLE_UNDERSCORE), 1)
KOKKOSKERNELS_FORTRAN_GLOBAL = name\#\#_
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_MAGMA}, 1)
MAGMA_FORTRAN_MANGLING = ADD_
endif
else
KOKKOSKERNELS_INTERNAL_OVERRIDE_FORTRAN_MANGLING_WITH_NO_UNDERSCORE := $(strip $(shell echo $(KOKKOSKERNELS_OPTIONS) | grep "blas-mangle" | wc -l))
ifeq ($(KOKKOSKERNELS_INTERNAL_OVERRIDE_FORTRAN_MANGLING_WITH_NO_UNDERSCORE), 1)
KOKKOSKERNELS_FORTRAN_GLOBAL = name\#\#
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_MAGMA}, 1)
MAGMA_FORTRAN_MANGLING = NOCHANGE
endif
endif
endif
endif
Expand Down Expand Up @@ -306,6 +322,16 @@ ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_CUBLAS}, 1)
tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_CUBLAS" >> KokkosKernels_config.tmp )
endif

ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_MAGMA}, 1)
KOKKOS_INTERNAL_NVCC_PATH := $(shell which nvcc)
CUDA_PATH ?= $(KOKKOS_INTERNAL_NVCC_PATH:/bin/nvcc=)
KOKKOSKERNELS_CPPFLAGS += -D${MAGMA_FORTRAN_MANGLING} -I${MAGMA_PATH}/include -I${MAGMA_PATH}/sparse/include -I${CUDA_PATH}/include
KOKKOSKERNELS_LDFLAGS += -L${MAGMA_PATH}/lib -L${CUDA_PATH}/lib64
KOKKOSKERNELS_LIBS += -lmagma_sparse -lmagma -lcublas -lcudart -lcusparse -fopenmp

tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_MAGMA" >> KokkosKernels_config.tmp )
endif

tmp := $(shell echo "\#if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#if !defined(KOKKOSKERNELS_ENABLE_TPL_BLAS)" >> KokkosKernels_config.tmp )
tmp := $(shell echo "\#define KOKKOSKERNELS_ENABLE_TPL_BLAS" >> KokkosKernels_config.tmp )
Expand Down Expand Up @@ -435,6 +461,10 @@ ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_CUBLAS}, 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += ${KOKKOSKERNELS_PATH}/src/impl/tpls/KokkosBlas_Cuda_tpl.cpp
endif

ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_MAGMA}, 1)
KOKKOSKERNELS_INTERNAL_SRC_BLAS += ${KOKKOSKERNELS_PATH}/src/impl/tpls/KokkosBlas_Cuda_tpl.cpp
endif

KOKKOSKERNELS_INTERNAL_ENABLE_HOST_BLAS=0
ifeq (${KOKKOSKERNELS_INTERNAL_ENABLE_BLAS}, 1)
KOKKOSKERNELS_INTERNAL_ENABLE_HOST_BLAS=1
Expand All @@ -456,15 +486,24 @@ endif

DEPFLAGS = -M

CP = cp

ifeq ($(KOKKOS_OS),CYGWIN)
COPY_FLAG = -u
endif
ifeq ($(KOKKOS_OS),Linux)
COPY_FLAG = -u
endif
ifeq ($(KOKKOS_OS),Darwin)
COPY_FLAG =
endif
#ifeq ($(KOKKOS_OS),Darwin)
# If using Homebrew on OSX with the 'coreutils' package installed
# we have a gnu version of cp which has the -u option
# ifeq (,$(wildcard "/usr/local/opt/coreutils/libexec/gnubin/cp"))
# CP = /usr/local/opt/coreutils/libexec/gnubin/cp
# COPY_FLAG = -u
# else
# COPY_FLAG =
# endif
#endif

KOKKOSKERNELS_INTERNAL_SRC_BLAS_NODIR = $(notdir $(KOKKOSKERNELS_INTERNAL_SRC_BLAS))
KOKKOSKERNELS_INTERNAL_SRC_SPARSE_NODIR = $(notdir $(KOKKOSKERNELS_INTERNAL_SRC_SPARSE))
Expand Down
2 changes: 1 addition & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
TRIBITS_PACKAGE_DEFINE_DEPENDENCIES(
LIB_REQUIRED_PACKAGES KokkosCore KokkosContainers KokkosAlgorithms
LIB_OPTIONAL_TPLS quadmath MKL BLAS LAPACK CUSPARSE
LIB_OPTIONAL_TPLS quadmath MKL BLAS LAPACK CUSPARSE MAGMA
TEST_OPTIONAL_TPLS yaml-cpp
)
2 changes: 2 additions & 0 deletions cmake/KokkosKernels_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_CUSPARSE
/* CUBLAS */
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_CUBLAS
/* MAGMA */
#cmakedefine KOKKOSKERNELS_ENABLE_TPL_MAGMA

/* if MKL, BLAS is also defined */
#if defined(KOKKOSKERNELS_ENABLE_TPL_MKL)
Expand Down
Loading

0 comments on commit d86db11

Please sign in to comment.