summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAMD Toolchain Support <73240730+amd-toolchain-support@users.noreply.github.com>2024-03-29 06:58:31 +0000
committerGitHub <noreply@github.com>2024-03-29 00:58:31 -0600
commit4f9fe6f9bf07333e7eaa282153068c24497fcdaa (patch)
tree6126144794195e9ef68ae944aeaa8052946093b7 /var
parentdf6d6d9b5c810d3aa0277ca3439d4e790711e4f1 (diff)
downloadspack-4f9fe6f9bf07333e7eaa282153068c24497fcdaa.tar.gz
spack-4f9fe6f9bf07333e7eaa282153068c24497fcdaa.tar.bz2
spack-4f9fe6f9bf07333e7eaa282153068c24497fcdaa.tar.xz
spack-4f9fe6f9bf07333e7eaa282153068c24497fcdaa.zip
Adding 'logging' and 'tracing' variants to enable AOCL DTL trace and logging capabilities (#43414)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/amdblis/package.py17
-rw-r--r--var/spack/repos/builtin/packages/amdlibflame/package.py17
2 files changed, 34 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/amdblis/package.py b/var/spack/repos/builtin/packages/amdblis/package.py
index bf78a22b44..33fd95aee4 100644
--- a/var/spack/repos/builtin/packages/amdblis/package.py
+++ b/var/spack/repos/builtin/packages/amdblis/package.py
@@ -55,6 +55,9 @@ class Amdblis(BlisBase):
variant("aocl_gemm", default=False, when="@4.1:", description="aocl_gemm support")
variant("suphandling", default=True, description="Small Unpacked Kernel handling")
+ variant("logging", default=False, description="Enable AOCL DTL Logging")
+ variant("tracing", default=False, description="Enable AOCL DTL Tracing")
+
def configure_args(self):
spec = self.spec
args = super().configure_args()
@@ -95,6 +98,20 @@ class Amdblis(BlisBase):
if spec.satisfies("@3.1:"):
args.append("--disable-aocl-dynamic")
+ if spec.satisfies("+logging"):
+ filter_file(
+ "#define AOCL_DTL_LOG_ENABLE 0",
+ "#define AOCL_DTL_LOG_ENABLE 1",
+ f"{self.stage.source_path}/aocl_dtl/aocldtlcf.h",
+ )
+
+ if spec.satisfies("+tracing"):
+ filter_file(
+ "#define AOCL_DTL_TRACE_ENABLE 0",
+ "#define AOCL_DTL_TRACE_ENABLE 1",
+ f"{self.stage.source_path}/aocl_dtl/aocldtlcf.h",
+ )
+
return args
@run_after("install")
diff --git a/var/spack/repos/builtin/packages/amdlibflame/package.py b/var/spack/repos/builtin/packages/amdlibflame/package.py
index d63d7c57e8..c8aa228f0d 100644
--- a/var/spack/repos/builtin/packages/amdlibflame/package.py
+++ b/var/spack/repos/builtin/packages/amdlibflame/package.py
@@ -79,6 +79,9 @@ class Amdlibflame(CMakePackage, LibflameBase):
description="Use hardware vectorization support",
)
+ variant("logging", default="False", description="Enable AOCL DTL Logging")
+ variant("tracing", default="False", description="Enable AOCL DTL Tracing")
+
# Build system
build_system(
conditional("cmake", when="@4.2:"), conditional("autotools", when="@:4.1"), default="cmake"
@@ -215,6 +218,20 @@ class AutotoolsBuilder(spack.build_systems.autotools.AutotoolsBuilder):
aocl_utils_lib_path = spec["aocl-utils"].libs
args.append("LIBAOCLUTILS_LIBRARY_PATH={0}".format(aocl_utils_lib_path))
+ if spec.satisfies("+tracing"):
+ filter_file(
+ "#define AOCL_DTL_TRACE_ENABLE 0",
+ "#define AOCL_DTL_TRACE_ENABLE 1",
+ f"{self.stage.source_path}/aocl_dtl/aocldtlcf.h",
+ )
+
+ if spec.satisfies("+logging"):
+ filter_file(
+ "#define AOCL_DTL_LOG_ENABLE 0",
+ "#define AOCL_DTL_LOG_ENABLE 1",
+ f"{self.stage.source_path}/aocl_dtl/aocldtlcf.h",
+ )
+
return args
@when("@4.1:")