batchedblas: new package (#29028)

This commit is contained in:
FJ-NaokiMatsumura 2022-03-29 00:16:03 +09:00 committed by GitHub
parent 1dbab78db1
commit 9e169ae243
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- spack-src/bblas_src/batched_blas_fp16.h.orig 2022-02-16 17:15:22.000000000 +0900
+++ spack-src/bblas_src/batched_blas_fp16.h 2022-02-16 17:15:31.000000000 +0900
@@ -13,8 +13,6 @@
# if BF_NMANT>7 || BF_NMANT<=1
# error "too large or small mantissa for BFLIKE_FLOAT"
# endif
-#elif defined(__AVX2__)
-# define FP16_AVX2_EMULATION
#elif defined(__clang__) && __clang_major__ >= 8
# define FP16_AUTO_PROMOTION
#else

View File

@ -0,0 +1,41 @@
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Batchedblas(MakefilePackage):
"""Batched BLAS is one of the new approaches for a task-based BLAS
invocation, and it is defined as a new interface that allows users to
execute multiple independent BLAS operations as a single subroutine call"""
homepage = "https://www.r-ccs.riken.jp/labs/lpnctrt/projects/batchedblas/index.html"
url = "https://www.r-ccs.riken.jp/labs/lpnctrt/projects/batchedblas/BatchedBLAS-1.0.tar.gz"
version('1.0', sha256='798ae4e7cc4ad5c3d5f3479f3d001da566d7d5205779103aaf10cd5b956ba433')
depends_on('blas')
patch('AVX2.patch')
def edit(self, spec, prefix):
CCFLAGS = [self.compiler.openmp_flag, '-I./', '-O3']
BLAS = ['-lm', spec['blas'].libs.ld_flags]
if not spec.satisfies('^mkl'):
CCFLAGS.append('-D_CBLAS_')
if spec.satisfies('%intel'):
CCFLAGS.extend(['-Os'])
elif spec.satisfies('%fj'):
CCFLAGS.extend(['-std=gnu11', '-Kfast,ocl', '-Nclang'])
makefile_src = FileFilter('bblas_src/Makefile')
makefile_src.filter(r'^\s*CCFLAG\s*=.*', 'CCFLAG = %s' % ' '.join(CCFLAGS))
makefile_src.filter(r'^\s*BLAS\s*=.*', 'BLAS = %s' % ' '.join(BLAS))
def install(self, spec, prefix):
mkdirp(prefix.lib)
mkdirp(prefix.include)
install(join_path('bblas_src', '*.h'), prefix.include)
install(join_path('bblas_src', 'libbblas.a'), prefix.lib)
install(join_path('bblas_src', 'libbblas.so'), prefix.lib)