[test-suite] r338167 - [test-suite] Add common files required by kernels of Rodinia Benchmark

Brian Homerding via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 27 14:34:38 PDT 2018


Author: homerdin
Date: Fri Jul 27 14:34:38 2018
New Revision: 338167

URL: http://llvm.org/viewvc/llvm-project?rev=338167&view=rev
Log:
[test-suite] Add common files required by kernels of Rodinia Benchmark

Includes Rodinia license and a rand() implementation that is reproducible
on different platforms for use by various Rodinia benchmarks.

Patch by Pankaj, Kukreja, thanks!

Reviewers: Meinersbur

Differential Revision: https://reviews.llvm.org/D49896

Added:
    test-suite/trunk/MultiSource/Benchmarks/Rodinia/
    test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/
    test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.c
    test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.h
    test-suite/trunk/MultiSource/Benchmarks/Rodinia/LICENSE
Modified:
    test-suite/trunk/LICENSE.TXT
    test-suite/trunk/MultiSource/Benchmarks/CMakeLists.txt
    test-suite/trunk/MultiSource/Benchmarks/Makefile

Modified: test-suite/trunk/LICENSE.TXT
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/LICENSE.TXT?rev=338167&r1=338166&r2=338167&view=diff
==============================================================================
--- test-suite/trunk/LICENSE.TXT (original)
+++ test-suite/trunk/LICENSE.TXT Fri Jul 27 14:34:38 2018
@@ -124,3 +124,6 @@ SingleSource Tests: llvm-test/SingleSour
                     llvm-test/SingleSource/Gizmos
                     llvm-test/SingleSource/Benchmarks/SmallPT
 zlib:               llvm-test/MultiSource/Applications/ClamAV/zlib_*
+Rodinia:            llvm-test/MultiSource/Benchmarks/Rodinia
+Rodinia:            llvm-test/MultiSource/Benchmarks/Rodinia
+Rodinia:            llvm-test/MultiSource/Benchmarks/Rodinia

Modified: test-suite/trunk/MultiSource/Benchmarks/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/CMakeLists.txt?rev=338167&r1=338166&r2=338167&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/CMakeLists.txt (original)
+++ test-suite/trunk/MultiSource/Benchmarks/CMakeLists.txt Fri Jul 27 14:34:38 2018
@@ -19,6 +19,7 @@ add_subdirectory(mediabench)
 add_subdirectory(nbench)
 add_subdirectory(sim)
 add_subdirectory(DOE-ProxyApps-C)
+add_subdirectory(Rodinia)
 
 if((NOT "${TARGET_OS}" STREQUAL "Darwin") OR (NOT "${ARCH}" STREQUAL "ARM"))
   add_subdirectory(TSVC)

Modified: test-suite/trunk/MultiSource/Benchmarks/Makefile
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Makefile?rev=338167&r1=338166&r2=338167&view=diff
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Makefile (original)
+++ test-suite/trunk/MultiSource/Benchmarks/Makefile Fri Jul 27 14:34:38 2018
@@ -9,7 +9,7 @@ PARALLEL_DIRS := Fhourstones Fhourstones
                  McCat Olden Ptrdist llubenchmark \
                  sim FreeBench MallocBench Prolangs-C SciMark2-C mediabench\
                  nbench ASCI_Purple MiBench Trimaran VersaBench NPB-serial\
-                 BitBench ASC_Sequoia TSVC DOE-ProxyApps-C
+                 BitBench ASC_Sequoia TSVC DOE-ProxyApps-C Rodinia
 
 # Disable TSVC on Darwin until the tests support SMALL_PROBLEM_SIZE=1.
 ifeq ($(TARGET_OS),Darwin)

Added: test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.c
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.c?rev=338167&view=auto
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.c (added)
+++ test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.c Fri Jul 27 14:34:38 2018
@@ -0,0 +1,60 @@
+/*===------------ glibc_compat_rand.c - glibc rand emulation --------------===*\
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is distributed under the University of Illinois Open Source
+ * License. See LICENSE.TXT for details.
+ *
+\*===----------------------------------------------------------------------===*/
+
+#include "glibc_compat_rand.h"
+
+/**
+ * This rand implementation is designed to emulate the implementation of
+ * rand/srand in recent versions of glibc. This is used for programs which
+ * require this specific rand implementation in order to pass verification
+ * tests.
+ *
+ * For more information, see: http://www.mathstat.dal.ca/~selinger/random/
+ **/
+
+#define TABLE_SIZE 344
+static unsigned int table[TABLE_SIZE];
+static int next;
+
+int glibc_compat_rand(void) {
+  /* Calculate the indices i-3 and i-31 in the circular vector. */
+  int i3 = (next < 3) ? (TABLE_SIZE + next - 3) : (next - 3);
+  int i31 = (next < 31) ? (TABLE_SIZE + next - 31) : (next - 31);
+
+  table[next] = table[i3] + table[i31];
+  unsigned int r = table[next] >> 1;
+
+  ++next;
+  if (next >= TABLE_SIZE)
+    next = 0;
+
+  return r;
+}
+
+void glibc_compat_srand(unsigned int seed) {
+  if (seed == 0)
+    seed = 1;
+
+  table[0] = seed;
+
+  for (int i = 1; i < 31; i++) {
+    int r = (16807ll * table[i - 1]) % 2147483647;
+    if (r < 0)
+      r += 2147483647;
+
+    table[i] = r;
+  }
+
+  for (int i = 31; i < 34; i++)
+    table[i] = table[i - 31];
+  for (int i = 34; i < TABLE_SIZE; i++)
+    table[i] = table[i - 31] + table[i - 3];
+
+  next = 0;
+}

Added: test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.h
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.h?rev=338167&view=auto
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.h (added)
+++ test-suite/trunk/MultiSource/Benchmarks/Rodinia/Common/glibc_compat_rand.h Fri Jul 27 14:34:38 2018
@@ -0,0 +1,16 @@
+/*===------------- glibc_compat_rand.h- glibc rand emulation --------------===*\
+|*
+|*                     The LLVM Compiler Infrastructure
+|*
+|* This file is distributed under the University of Illinois Open Source
+|* License. See LICENSE.TXT for details.
+|*
+\*===----------------------------------------------------------------------===*/
+
+#ifndef GLIBC_COMPAT_RAND_H
+#define GLIBC_COMPAT_RAND_H
+
+int glibc_compat_rand(void);
+void glibc_compat_srand(unsigned int seed);
+
+#endif /* GLIBC_COMPAT_RAND_H */

Added: test-suite/trunk/MultiSource/Benchmarks/Rodinia/LICENSE
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/MultiSource/Benchmarks/Rodinia/LICENSE?rev=338167&view=auto
==============================================================================
--- test-suite/trunk/MultiSource/Benchmarks/Rodinia/LICENSE (added)
+++ test-suite/trunk/MultiSource/Benchmarks/Rodinia/LICENSE Fri Jul 27 14:34:38 2018
@@ -0,0 +1,38 @@
+LICENSE TERMS
+
+Copyright (c)2008-2011 University of Virginia
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted without royalty fees or other restrictions, provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
+    * Neither the name of the University of Virginia, the Dept. of Computer Science, nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE UNIVERSITY OF VIRGINIA OR THE SOFTWARE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+If you use this software or a modified version of it, please cite the most relevant among the following papers:
+
+- M. A. Goodrum, M. J. Trotter, A. Aksel, S. T. Acton, and K. Skadron. Parallelization of Particle Filter Algorithms. In Proceedings 
+of the 3rd Workshop on Emerging Applications and Many-core Architecture (EAMA), in conjunction with the IEEE/ACM International 
+Symposium on Computer Architecture (ISCA), June 2010.
+
+- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, Sang-Ha Lee and K. Skadron.
+"Rodinia: A Benchmark Suite for Heterogeneous Computing". IEEE International Symposium
+on Workload Characterization, Oct 2009.
+
+- J. Meng and K. Skadron. "Performance Modeling and Automatic Ghost Zone Optimization
+for Iterative Stencil Loops on GPUs." In Proceedings of the 23rd Annual ACM International
+Conference on Supercomputing (ICS), June 2009.
+
+- L.G. Szafaryn, K. Skadron and J. Saucerman. "Experiences Accelerating MATLAB Systems
+Biology Applications." in Workshop on Biomedicine in Computing (BiC) at the International
+Symposium on Computer Architecture (ISCA), June 2009.
+
+- M. Boyer, D. Tarjan, S. T. Acton, and K. Skadron. "Accelerating Leukocyte Tracking using CUDA:
+A Case Study in Leveraging Manycore Coprocessors." In Proceedings of the International Parallel
+and Distributed Processing Symposium (IPDPS), May 2009.
+
+- S. Che, M. Boyer, J. Meng, D. Tarjan, J. W. Sheaffer, and K. Skadron. "A Performance
+Study of General Purpose Applications on Graphics Processors using CUDA" Journal of
+Parallel and Distributed Computing, Elsevier, June 2008.




More information about the llvm-commits mailing list