From 1673d3e3223eefa609ab66ae11a9c0b1d244f7fe Mon Sep 17 00:00:00 2001 From: Brian Van Essen Date: Mon, 14 Aug 2023 07:11:30 -0700 Subject: Added package for the hipTT library (#39388) --- .../repos/builtin/packages/hiptt/bugfix_make.patch | 18 +++++++++++ var/spack/repos/builtin/packages/hiptt/package.py | 35 ++++++++++++++++++++++ var/spack/repos/builtin/packages/lbann/package.py | 1 + 3 files changed, 54 insertions(+) create mode 100644 var/spack/repos/builtin/packages/hiptt/bugfix_make.patch create mode 100644 var/spack/repos/builtin/packages/hiptt/package.py (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hiptt/bugfix_make.patch b/var/spack/repos/builtin/packages/hiptt/bugfix_make.patch new file mode 100644 index 0000000000..aff01b8af8 --- /dev/null +++ b/var/spack/repos/builtin/packages/hiptt/bugfix_make.patch @@ -0,0 +1,18 @@ +diff --git a/Makefile b/Makefile +index 14a7aae..c7e39f2 100755 +--- a/Makefile ++++ b/Makefile +@@ -93,11 +93,11 @@ CUDAROOT = $(subst /bin/,,$(dir $(shell which $(CUDAC)))) + #CFLAGS = -I${CUDAROOT}/include -std=c++11 $(DEFS) $(OPTLEV) -fPIC -D__HIP_PLATFORM_NVCC__ + CFLAGS = -I${CUDAROOT}/include -std=c++11 $(DEFS) $(OPTLEV) -fPIC -D__HIP_PLATFORM_HCC__ -D__HIP_ROCclr__ + ifeq ($(CPU),x86_64) +-CFLAGS += -march=native ++CFLAGS += -march=native -fPIC + endif + + #CUDA_CFLAGS = -ccbin $(GPU_CC) -I${CUDAROOT}/include -std=c++11 $(OPTLEV) -Xptxas -dlcm=ca -lineinfo $(GENCODE_FLAGS) --resource-usage -Xcompiler -fPIC -D_FORCE_INLINES -x cu -Wno-deprecated-declarations +-CUDA_CFLAGS = --amdgpu-target=gfx906,gfx908 -std=c++11 $(OPTLEV) -D_FORCE_INLINES ++CUDA_CFLAGS = --amdgpu-target=gfx906,gfx908,gfx90a -std=c++11 $(OPTLEV) -D_FORCE_INLINES -fPIC + + ifeq ($(OS),osx) + CUDA_LFLAGS = -L$(CUDAROOT)/lib diff --git a/var/spack/repos/builtin/packages/hiptt/package.py b/var/spack/repos/builtin/packages/hiptt/package.py new file mode 100644 index 0000000000..d2c9e118a7 --- /dev/null +++ b/var/spack/repos/builtin/packages/hiptt/package.py @@ -0,0 +1,35 @@ +# Copyright 2013-2023 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.package import * + + +class Hiptt(MakefilePackage, ROCmPackage): + """hipTT - Fast GPU Tensor Transpose for NVIDIA and AMD GPU.""" + + homepage = "https://github.com/DmitryLyakh/hipTT" + url = "https://github.com/DmitryLyakh/hipTT" + git = "https://github.com/DmitryLyakh/hipTT.git" + tags = ["ecp", "radiuss"] + + maintainers("bvanessen") + + version("master", branch="master") + + patch("bugfix_make.patch") + + # To enable this package add it to the LD_LIBRARY_PATH + def setup_dependent_build_environment(self, env, dependent_spec): + hiptt_home = self.spec["hiptt"].prefix + env.prepend_path("cuTT_ROOT", hiptt_home) + env.prepend_path("cuTT_LIBRARY", hiptt_home.lib) + env.prepend_path("cuTT_INCLUDE_PATH", hiptt_home.include) + + def install(self, spec, prefix): + mkdir(prefix.bin) + install("bin/cutt_test", prefix.bin) + install("bin/cutt_bench", prefix.bin) + install_tree("lib", prefix.lib) + install_tree("include", prefix.include) diff --git a/var/spack/repos/builtin/packages/lbann/package.py b/var/spack/repos/builtin/packages/lbann/package.py index cf258955e2..f358c3e6d4 100644 --- a/var/spack/repos/builtin/packages/lbann/package.py +++ b/var/spack/repos/builtin/packages/lbann/package.py @@ -258,6 +258,7 @@ class Lbann(CachedCMakePackage, CudaPackage, ROCmPackage): depends_on("hwloc@1.11.0:1.11", when="@0.95:0.101 +hwloc") depends_on("hwloc +cuda +nvml", when="+cuda") depends_on("hwloc@2.3.0:", when="+rocm") + depends_on("hiptt", when="+rocm") depends_on("half", when="+half") -- cgit v1.2.3-60-g2f50