From 19a2bdc7340175a00a79653dd7b983a8e098ac87 Mon Sep 17 00:00:00 2001 From: Xianwei Zhang Date: Thu, 18 Jul 2019 05:15:06 -0500 Subject: [PATCH] tests: add top-level Makefile and run.sh Change-Id: Ieaef51422c11ec27d56ff19953f9a5dd1f563353 [ROCm/rocprofiler commit: a5a56425bb91ea302815602ad6462bf0ec5f2212] --- .../test/memory_validation/Makefile | 10 +++++++ .../rocprofiler/test/memory_validation/README | 6 ++++ .../test/memory_validation/benches/Makefile | 19 ++++++++++++ .../rocprofiler/test/memory_validation/run.sh | 30 +++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 projects/rocprofiler/test/memory_validation/Makefile create mode 100644 projects/rocprofiler/test/memory_validation/benches/Makefile create mode 100755 projects/rocprofiler/test/memory_validation/run.sh diff --git a/projects/rocprofiler/test/memory_validation/Makefile b/projects/rocprofiler/test/memory_validation/Makefile new file mode 100644 index 0000000000..8225fb124e --- /dev/null +++ b/projects/rocprofiler/test/memory_validation/Makefile @@ -0,0 +1,10 @@ +# benchmarks dir +BENCH_DIR = benches + +.PHONY: build + +build: + $(MAKE) -C $(BENCH_DIR) + +clean: + $(MAKE) -C $(BENCH_DIR) clean diff --git a/projects/rocprofiler/test/memory_validation/README b/projects/rocprofiler/test/memory_validation/README index f12bc44c8a..66bb874111 100644 --- a/projects/rocprofiler/test/memory_validation/README +++ b/projects/rocprofiler/test/memory_validation/README @@ -14,6 +14,8 @@ against expected values (self-checking); fail. #### Source tree #### +- run.sh top-level script to start all tests +- Makefile top-level makefile - run_scripts/ - global.cfg: settings and global codes used by .sh files - test_cache_miss.sh: test TCP/TCC miss rates @@ -22,6 +24,7 @@ fail. - cache_pmc.txt: counters used for cache tests - benches/ - test_cache/: benchmark used for cached-related tests + - Makefile: makefile to compile benchmarks #### How to run #### @@ -29,6 +32,9 @@ fail. $cd test/memory_validation/ 2) run tests + to start all tests + $run.sh + or, to separtely run each $run_scripts/test_cache_miss.sh [TCP/TCC/TCP TCC] $run_scripts/test_fetchwrite_size.sh diff --git a/projects/rocprofiler/test/memory_validation/benches/Makefile b/projects/rocprofiler/test/memory_validation/benches/Makefile new file mode 100644 index 0000000000..e1f9fbe2fa --- /dev/null +++ b/projects/rocprofiler/test/memory_validation/benches/Makefile @@ -0,0 +1,19 @@ +# specify each subdir here +SUBDIRS = test_cache + +TARGETS = all clean + +.PHONY: $(TARGETS) default + +# change this line to change the default action +# (using one of the targets above) +default: all + +define do-target +$(1): $$(foreach subdir, $$(SUBDIRS), $(1)-$$(subdir)) + +$(1)-%: + $$(MAKE) -C $$* $(1) +endef + +$(foreach tgt, $(TARGETS), $(eval $(call do-target,$(tgt)))) diff --git a/projects/rocprofiler/test/memory_validation/run.sh b/projects/rocprofiler/test/memory_validation/run.sh new file mode 100755 index 0000000000..fe004944c9 --- /dev/null +++ b/projects/rocprofiler/test/memory_validation/run.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +############################################################################### +# Copyright (c) 2019 Advanced Micro Devices, Inc. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +############################################################################### + +# test TCP/TCC miss +# to test separately, append TCP or TCC as argument +run_scripts/test_cache_miss.sh + +# test data fetch/write size to memory +run_scripts/test_fetchwrite_size.sh