algotune: start work on algotune.

This is a library for stress testing algorithms problems.
This commit is contained in:
Kyle Isom 2018-04-12 20:46:58 -07:00
parent 567169dd7b
commit a5d4812025
5 changed files with 112 additions and 0 deletions

11
misc/algotest/Makefile.am Normal file
View File

@ -0,0 +1,11 @@
AM_CPPFLAGS = -Wall -Wextra -pedantic -Wshadow -Wpointer-arith -Wcast-align
AM_CPPFLAGS += -Wwrite-strings -Wmissing-declarations -Wno-long-long -Werror
AM_CPPFLAGS += -Wunused-variable -std=c++14 -D_XOPEN_SOURCE -O2 -I.
AM_CPPFLAGS += -fno-elide-constructors -Weffc++
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libalgotune-1.pc
lib_LTLIBRARIES = libalgotune.la
nobase_include_HEADERS = algotune.h
libalgotune_la_SOURCES = algotune.cc

49
misc/algotest/algotune.cc Normal file
View File

@ -0,0 +1,49 @@
#include <random>
#include <vector>
#include "algotune.h"
namespace algotune {
int
rand_int(int low, int high)
{
return -1;
}
int64_t
rand_int(int64_t low, int64_t high)
{
return -1;
}
std::vector<int>
gen_int_vector(int size, int low, int high)
{
return vector<int>(0);
}
std::vector<int64_t>
gen_int_vector(int size, int low, int high)
{
return vector<int64_t>(0);
}
void
stress_test_int(bool(*func)(std::vector<int>))
{
}
void
stress_test_int64(bool(*func)(std::vector<int64_t))
{
}
} // namespace algotune

20
misc/algotest/algotune.h Normal file
View File

@ -0,0 +1,20 @@
#ifndef __LIB_ALGOTUNE__
#define __LIB_ALGOTUNE__
#include <vector>
namespace algotune {
int rand_int(int low, int high);
int64_t rand_int(int64_t low, int64_t high);
std::vector<int> gen_int_vector(int size, int low, int high);
std::vector<int64_t> gen_int_vector(int size, int low, int high);
void stress_test_int(bool(*func)(std::vector<int>));
void stress_test_int64(bool(*func)(std::vector<int64_t));
} // namespace algotune
#endif // __LIB_ALGOTUNE__

View File

@ -0,0 +1,22 @@
AC_PREREQ([2.68])
AC_INIT([libalgotune],
[1.0.0],
[kyle@imap.cc],
[],
[])
AM_INIT_AUTOMAKE([1.11 foreign])
LT_INIT
PKG_PROG_PKG_CONFIG
AC_CONFIG_SRCDIR([algotune.h])
AC_CONFIG_FILES([Makefile
libalgotune-1.pc])
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_CC_C_O
AC_OUTPUT

View File

@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: @PACKAGE_NAME@
Description: Algorithms and data structure tuning and testing
URL: @PACKAGE_URL@
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -Wl,-rpath,${libdir} -lalgotune