batchedblas: new package (#29028)
This commit is contained in:
parent
1dbab78db1
commit
9e169ae243
11
var/spack/repos/builtin/packages/batchedblas/AVX2.patch
Normal file
11
var/spack/repos/builtin/packages/batchedblas/AVX2.patch
Normal 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
|
41
var/spack/repos/builtin/packages/batchedblas/package.py
Normal file
41
var/spack/repos/builtin/packages/batchedblas/package.py
Normal 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)
|
Loading…
Reference in New Issue
Block a user