summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFJ-NaokiMatsumura <98728917+FJ-NaokiMatsumura@users.noreply.github.com>2022-03-29 00:16:03 +0900
committerGitHub <noreply@github.com>2022-03-28 17:16:03 +0200
commit9e169ae243ce315fb779f5d3f84c28b9dbc39612 (patch)
treeeb912470097aac357fb88dff6ba72b22b3b03118
parent1dbab78db18629ba3c606309814898fe9d86e7a8 (diff)
downloadspack-9e169ae243ce315fb779f5d3f84c28b9dbc39612.tar.gz
spack-9e169ae243ce315fb779f5d3f84c28b9dbc39612.tar.bz2
spack-9e169ae243ce315fb779f5d3f84c28b9dbc39612.tar.xz
spack-9e169ae243ce315fb779f5d3f84c28b9dbc39612.zip
batchedblas: new package (#29028)
-rw-r--r--var/spack/repos/builtin/packages/batchedblas/AVX2.patch11
-rw-r--r--var/spack/repos/builtin/packages/batchedblas/package.py41
2 files changed, 52 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/batchedblas/AVX2.patch b/var/spack/repos/builtin/packages/batchedblas/AVX2.patch
new file mode 100644
index 0000000000..219aed9ad5
--- /dev/null
+++ b/var/spack/repos/builtin/packages/batchedblas/AVX2.patch
@@ -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
diff --git a/var/spack/repos/builtin/packages/batchedblas/package.py b/var/spack/repos/builtin/packages/batchedblas/package.py
new file mode 100644
index 0000000000..0c92cedd72
--- /dev/null
+++ b/var/spack/repos/builtin/packages/batchedblas/package.py
@@ -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)