Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/gemv rps test -- RAJAPerf Suite Version of the BLAS2 GEMV Test #1085

Merged
merged 70 commits into from
Oct 5, 2021
Merged
Show file tree
Hide file tree
Changes from 53 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
9d23ea2
Testing commit
DavidPoliakoff Apr 26, 2021
29d2961
Testing commit
DavidPoliakoff Apr 28, 2021
309cd93
Testing commit
DavidPoliakoff Apr 28, 2021
bc142c9
Mondo commit of RAJAPERF everything. To be trimmed down
DavidPoliakoff May 11, 2021
f553052
Initial, harebrained commit
DavidPoliakoff May 11, 2021
2d427f7
More build fixes
DavidPoliakoff May 11, 2021
64f288d
Commit for demo
DavidPoliakoff May 13, 2021
509a277
Got rid of bad test
DavidPoliakoff May 13, 2021
a7beb1f
BuiltinTimer.hpp: add includes to RPS header
ajpowelsnl May 20, 2021
afdaf6f
perf test data: setter, getter, runtime opts
ajpowelsnl May 21, 2021
4611f0d
KokkosKernelsTrackedTesting.cpp: runtime option
ajpowelsnl May 21, 2021
fe5ceb7
KokkosKernelsTrackedTesting.cpp: help message for input data
May 24, 2021
d102d59
KokkosSparse_spmv_: include QuickKernelBase.hpp
ajpowelsnl Jun 8, 2021
1af92b3
Merge branch 'feature/perf_testing_perfsuite' of github.com:davidpoli…
ajpowelsnl Jun 8, 2021
d4c726c
KokkosBlas_dot_perf_test: KK perf test for RPS implementation
ajpowelsnl Jun 9, 2021
b9e2331
KokkosBlas2_gemv_perf_test:adding pthreads for BMK
ajpowelsnl Jun 10, 2021
0c53bbb
Blas2_gemv_perf_test:adding pthreads handling
ajpowelsnl Jun 10, 2021
8c3e8ee
Merge branch 'blas/dot_test' into feature/perf_testing_perfsuite
ajpowelsnl Jun 15, 2021
f8646f8
KokkosBlas_dot_perf_test_rps: RPS dot implement.
ajpowelsnl Jun 16, 2021
6999e5f
KokkosBlas_dot_perf_test:implement dot w/ TeamPolicy
ajpowelsnl Jun 16, 2021
bda505a
watchr_KokkosConfig.json: reporting for Jenkins job
ajpowelsnl Jun 16, 2021
992f7b4
watchr_KokkosConfig.json: mv to scripts
ajpowelsnl Jun 16, 2021
e108091
watchr_KokkosConfig.json: updating RAJAPerf-timing fname
ajpowelsnl Jun 16, 2021
ed6066e
watchr_KokkosConfig.json: fix up for KK
ajpowelsnl Jun 16, 2021
73e8f9f
watchr_KokkosConfig.json: fix ignore_old_files
ajpowelsnl Jun 16, 2021
4ccc8a4
watchr_KokkosConfig.json: fix KK test name parsing
ajpowelsnl Jun 16, 2021
0efed22
watchr_KokkosConfig.json: fix up regex for KK jobs
ajpowelsnl Jun 16, 2021
4352774
Merge pull request #1 from ajpowelsnl/blas/TeamPolicy_dot_test
ajpowelsnl Jul 1, 2021
1004515
rps as infrastructure
ajpowelsnl Jul 6, 2021
9cf99e7
added git submodule
ajpowelsnl Jul 6, 2021
732a85d
rajaperf as a git submodule
ajpowelsnl Jul 6, 2021
edd1864
tpls/rajaperf: updating watchr json
ajpowelsnl Jul 27, 2021
855927a
dot tests: BUILD FAILURES
ajpowelsnl Jul 27, 2021
be5dedd
tpls/rajaperf: fix watchr config
ajpowelsnl Jul 27, 2021
c84c844
tpls/rajaperf: updating watchr config
ajpowelsnl Jul 28, 2021
6514f1e
tpls/rajaperf: fix up watchr config file
ajpowelsnl Jul 29, 2021
e1da00c
reproducer: undefined reference to `std::__cxx11
ajpowelsnl Jul 29, 2021
c308d6c
tpls/rajaperf: fix up watchr config
ajpowelsnl Jul 30, 2021
f27118e
perf_test: resolve rps v. KK; dot tests
ajpowelsnl Aug 3, 2021
d987a56
Merge remote-tracking branch 'amy_repo/git_submodules_rps_PR' into me…
ajpowelsnl Aug 4, 2021
7c47cd9
Merge remote-tracking branch 'amy_repo/git_submodules_rps_PR' into me…
ajpowelsnl Aug 4, 2021
6d72a44
Merge branch 'merge_dots' of github.com:ajpowelsnl/kokkos-kernels int…
ajpowelsnl Aug 4, 2021
94a7caf
Merge branch 'develop' into git_submodules_rps_PR
ajpowelsnl Aug 5, 2021
3deaa4b
Merge branch 'feature/team_dot_rps' into git_submodules_rps_PR
ajpowelsnl Aug 9, 2021
9b61f83
KokkosSparse_spmv: fix builds
ajpowelsnl Aug 9, 2021
6ca1f1f
cm_generate_makefile.bash:add perfsuite tests flag
ajpowelsnl Aug 9, 2021
8497983
KokkosSparse_spmv_test.cpp: spmv_additional_data fix
ajpowelsnl Aug 9, 2021
105fb60
spmv: fix OpenMP fix ups
ajpowelsnl Aug 11, 2021
5ca7b0c
KokkosBlas2_gemv_perf_test_rps: first draft
ajpowelsnl Aug 11, 2021
1944d9d
bmk: PR comments addressed; linking issues remain
ajpowelsnl Aug 17, 2021
94d9231
fix link errors in spmv: add OpenMPSmartStatic_SPMV.cpp
ajpowelsnl Aug 17, 2021
c23543d
rps build: changes to fix build for PR
ajpowelsnl Aug 17, 2021
c30969d
Merge branch 'git_submodules_rps_PR' into feature/gemv_rps_test
ajpowelsnl Aug 18, 2021
ea683ed
addressing Siva's comments: PR #1085
ajpowelsnl Aug 23, 2021
26bee15
perf_test/CMakeLists.txt: fix formatting
ajpowelsnl Aug 23, 2021
40a7855
perf_test/CMakeLists.txt: fix formatting issues
ajpowelsnl Aug 23, 2021
c0fd6af
PR #1085: address initial BMK comments
ajpowelsnl Aug 25, 2021
bccdb41
PR 1085: bmk comments
ajpowelsnl Aug 26, 2021
f076426
BMK PR coments: addressed on Sept. 1, 2021
ajpowelsnl Sep 1, 2021
3d5c518
git_submodules: fix to get_directories()
ajpowelsnl Sep 13, 2021
3a6c1fc
compiler warn: fixes to stuff AJP, DZP touched
ajpowelsnl Sep 15, 2021
a6347d6
tpls/rajaperf: fix compiler warns
ajpowelsnl Sep 16, 2021
4b648e9
Merge branch 'git_submodules_rps_PR' into feature/gemv_rps_test
ajpowelsnl Sep 16, 2021
d4e1d53
bmk comments: all accepted and addressed
ajpowelsnl Sep 16, 2021
e7e2541
pr_1085: compiler warning fixes
ajpowelsnl Sep 23, 2021
9e2b168
KokkosBlas_team_dot_perf_test: fix functor templating
ajpowelsnl Sep 28, 2021
d62332e
KokkosBlas3_gemm_perf_test.hpp: include Kokkos_Math..
ajpowelsnl Sep 28, 2021
06f0ddb
KokkosBlas_team_dot_perf_test: refactor w/ functor
ajpowelsnl Sep 28, 2021
4bb27c5
Merge branch 'develop' into feature/gemv_rps_test
brian-kelley Oct 1, 2021
bf48607
Remove extra cmake endif
brian-kelley Oct 4, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tpls/rajaperf"]
path = tpls/rajaperf
url = https://github.com/ajpowelsnl/RAJAPerf.git
14 changes: 13 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,20 @@ IF (NOT KOKKOSKERNELS_HAS_TRILINOS)
BOOL
"Whether to build tests. Default: OFF"
)
KOKKOSKERNELS_ADD_OPTION(
"ENABLE_TESTS_AND_PERFSUITE"
OFF
BOOL
"Whether to build tests including Perfsuite. Default: OFF"
)
ENDIF()

IF(KokkosKernels_ENABLE_TESTS_AND_PERFSUITE)
set(BLT_CODE_CHECK_TARGET_NAME "fix-for-blt" CACHE STRING "Docstring")
set(INFRASTRUCTURE_ONLY ON CACHE BOOL "Only build the RAJAPerf infrastructure, no builtin kernels")
add_definitions("-DRAJAPERF_INFRASTRUCTURE_ONLY")
add_subdirectory(tpls/rajaperf)
include_directories(tpls/rajaperf/src)
endif()
SET(KokkosKernels_INSTALL_TESTING OFF CACHE INTERNAL
"Whether to build tests and examples against installation")
IF (KokkosKernels_INSTALL_TESTING)
Expand Down
18 changes: 16 additions & 2 deletions cm_generate_makefile.bash
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ get_kernels_extra_linker_flags() {
KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD="-DCMAKE_EXE_LINKER_FLAGS=${PARSE_EXTRA_LINKER_FLAGS_LIST} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD}"
}



display_help_text() {

echo "KokkosKernels and Kokkos configure options:"
Expand Down Expand Up @@ -331,6 +333,10 @@ display_help_text() {
echo "--gcc-toolchain=/Path/To/GccRoot: Set the gcc toolchain to use with clang (e.g. /usr)"
echo "--kokkos-make-j=[NUM]: Set -j parallel level for kokkos install"
echo " Default: j == 4"
echo "--enable-tests: build Kokkos Kernels unit and performance tests"
echo "--enable-perfsuite: build Kokkos Kernels performance tests with
RAJAPerf Suite"


}

Expand All @@ -339,6 +345,7 @@ KOKKOS_INSTALL_PATH=""
KOKKOS_DO_TESTS=OFF
KOKKOS_DO_EXAMPLES=OFF
KOKKOSKERNELS_DO_TESTS=ON
KOKKOSKERNELS_DO_PERFSUITE=OFF
KOKKOSKERNELS_DO_EXAMPLES=ON

KOKKOS_MAKEINSTALL_J=4
Expand Down Expand Up @@ -491,6 +498,13 @@ do
# This is the default
KOKKOSKERNELS_DO_TESTS=ON
;;
--enable-perfsuite)
KOKKOSKERNELS_DO_PERFSUITE=ON
;;
--disable-perfsuite)
# This is the default
KOKKOSKERNELS_DO_PERFSUITE=OFF
;;
--disable-tests)
KOKKOSKERNELS_DO_TESTS=OFF
;;
Expand Down Expand Up @@ -744,7 +758,7 @@ cd $STORE_KOKKOSKERNELS_BUILD_PATH

# Configure kokkos-kernels
echo ""
echo cmake $COMPILER_CMD -DKokkos_DIR="${KOKKOS_FIND_PATH}" -DCMAKE_CXX_FLAGS="${KOKKOS_CXXFLAGS}" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DKokkosKernels_ENABLE_TESTS=${KOKKOSKERNELS_DO_TESTS} -DKokkosKernels_ENABLE_EXAMPLES:BOOL=${KOKKOSKERNELS_DO_EXAMPLES} ${KOKKOSKERNELS_SCALARS_CMD} ${KOKKOSKERNELS_ORDINALS_CMD} ${KOKKOSKERNELS_OFFSETS_CMD} ${KOKKOSKERNELS_LAYOUTS_CMD} ${KOKKOSKERNELS_TPLS_CMD} ${KOKKOSKERNELS_USER_TPL_PATH_CMD} ${KOKKOSKERNELS_USER_TPL_LIBNAME_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} ${KOKKOSKERNELS_BUILDTYPE_CMD} ${KOKKOSKERNELS_SPACES_CMD} ${KERNELS_DEFAULT_ETI_OPTION} ${KOKKOSKERNELS_PATH}
echo cmake $COMPILER_CMD -DKokkos_DIR="${KOKKOS_FIND_PATH}" -DCMAKE_CXX_FLAGS="${KOKKOS_CXXFLAGS}" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DKokkosKernels_ENABLE_TESTS_AND_PERFSUITE=${KOKKOSKERNELS_DO_PERFSUITE} -DKokkosKernels_ENABLE_TESTS=${KOKKOSKERNELS_DO_TESTS} -DKokkosKernels_ENABLE_EXAMPLES:BOOL=${KOKKOSKERNELS_DO_EXAMPLES} ${KOKKOSKERNELS_SCALARS_CMD} ${KOKKOSKERNELS_ORDINALS_CMD} ${KOKKOSKERNELS_OFFSETS_CMD} ${KOKKOSKERNELS_LAYOUTS_CMD} ${KOKKOSKERNELS_TPLS_CMD} ${KOKKOSKERNELS_USER_TPL_PATH_CMD} ${KOKKOSKERNELS_USER_TPL_LIBNAME_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} ${KOKKOSKERNELS_BUILDTYPE_CMD} ${KOKKOSKERNELS_SPACES_CMD} ${KERNELS_DEFAULT_ETI_OPTION} ${KOKKOSKERNELS_PATH}
echo ""
cmake $COMPILER_CMD -DKokkos_DIR="${KOKKOS_FIND_PATH}" -DCMAKE_CXX_FLAGS="${KOKKOS_CXXFLAGS//\"}" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DKokkosKernels_ENABLE_TESTS=${KOKKOSKERNELS_DO_TESTS} -DKokkosKernels_ENABLE_EXAMPLES:BOOL=${KOKKOSKERNELS_DO_EXAMPLES} ${KOKKOSKERNELS_SCALARS_CMD} ${KOKKOSKERNELS_ORDINALS_CMD} ${KOKKOSKERNELS_OFFSETS_CMD} ${KOKKOSKERNELS_LAYOUTS_CMD} ${KOKKOSKERNELS_TPLS_CMD} ${KOKKOSKERNELS_USER_TPL_PATH_CMD} ${KOKKOSKERNELS_USER_TPL_LIBNAME_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} ${KOKKOSKERNELS_BUILDTYPE_CMD} ${KOKKOSKERNELS_SPACES_CMD} ${KERNELS_DEFAULT_ETI_OPTION} ${KOKKOSKERNELS_PATH}
cmake $COMPILER_CMD -DKokkos_DIR="${KOKKOS_FIND_PATH}" -DCMAKE_CXX_FLAGS="${KOKKOS_CXXFLAGS//\"}" -DCMAKE_INSTALL_PREFIX="${PREFIX}" -DKokkosKernels_ENABLE_TESTS_AND_PERFSUITE=${KOKKOSKERNELS_DO_PERFSUITE} -DKokkosKernels_ENABLE_TESTS=${KOKKOSKERNELS_DO_TESTS} -DKokkosKernels_ENABLE_EXAMPLES:BOOL=${KOKKOSKERNELS_DO_EXAMPLES} ${KOKKOSKERNELS_SCALARS_CMD} ${KOKKOSKERNELS_ORDINALS_CMD} ${KOKKOSKERNELS_OFFSETS_CMD} ${KOKKOSKERNELS_LAYOUTS_CMD} ${KOKKOSKERNELS_TPLS_CMD} ${KOKKOSKERNELS_USER_TPL_PATH_CMD} ${KOKKOSKERNELS_USER_TPL_LIBNAME_CMD} ${KOKKOSKERNELS_EXTRA_LINKER_FLAGS_CMD} ${KOKKOSKERNELS_BUILDTYPE_CMD} ${KOKKOSKERNELS_SPACES_CMD} ${KERNELS_DEFAULT_ETI_OPTION} ${KOKKOSKERNELS_PATH}

3 changes: 3 additions & 0 deletions cmake/KokkosKernels_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
than just BLAS and LAPACK functions. */
#cmakedefine HAVE_KOKKOSKERNELS_MKL


#cmakedefine KOKKOSKERNELS_ENABLE_TESTS_AND_PERFSUITE

/* Define this macro if experimental features of Kokkoskernels are enabled */
#cmakedefine HAVE_KOKKOSKERNELS_EXPERIMENTAL

Expand Down
5 changes: 5 additions & 0 deletions cmake/kokkoskernels_tribits.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ IF (IS_ENABLED)
TESTONLYLIBS ${PARSE_TESTONLYLIBS})
ELSE()
ADD_EXECUTABLE(${EXE_NAME} ${PARSE_SOURCES})
#AJP, BMK altered:
IF(KOKKOSKERNELS_ENABLE_TESTS_AND_PERFSUITE)
TARGET_LINK_LIBRARIES(${EXE_NAME} PRIVATE common ${PARSE_TESTONLYLIBS})
ENDIF()

IF (PARSE_TESTONLYLIBS)
TARGET_LINK_LIBRARIES(${EXE_NAME} PRIVATE Kokkos::kokkoskernels ${PARSE_TESTONLYLIBS})
ELSE ()
Expand Down
17 changes: 16 additions & 1 deletion perf_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ TARGET_INCLUDE_DIRECTORIES(kokkoskernelsperf_gtest PUBLIC $<BUILD_INTERFACE:${GT

#Gtest minimally requires C++11
TARGET_COMPILE_FEATURES(kokkoskernelsperf_gtest PUBLIC cxx_std_11)
include_directories(sparse)
if(KokkosKernels_ENABLE_TESTS_AND_PERFSUITE)
# Add RPS implementations of KK perf tests here

KOKKOSKERNELS_ADD_EXECUTABLE(
tracked_testing
SOURCES KokkosKernelsTrackedTesting.cpp
sparse/KokkosSparse_spmv_test.cpp
blas/blas2/KokkosBlas2_gemv_perf_test_rps.cpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a suggestion. This is already in perf_test directory. Does every file need rps in its name? I would name the file KokkosBlas2_gemv.cpp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srajama1 - I understand your point about this, but I would also argue that we need a way to easily distinguish the "KK standard" version of perf testing, and that for RPS. Would you be OK with my substituting "tracked_test" into the name of the source file, vs. "rps", such that a file would have this type of name:

KokkosBlas2_gemv_perf_test_tracked_test.cpp

This name change would also align with the built executable name.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I like that. It says exactly what it does.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

KokkosBlas2_gemv_tracked_perf_test.cpp , may be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@srajama1 -- that sounds good; I'll go with this naming convention: "KokkosBlas2_gemv_tracked_perf_test.cpp"

blas/blas1/KokkosBlas_dot_perf_test_rps.cpp
blas/blas1/KokkosBlas_team_dot_perf_test_rps.cpp
PerfTestUtilities.cpp
sparse/spmv/OpenMPSmartStatic_SPMV.cpp
#sparse/KokkosSparse_spgemm_test.cpp
)
endif()



Expand All @@ -32,4 +48,3 @@ ADD_COMPONENT_SUBDIRECTORY(sparse)
ADD_COMPONENT_SUBDIRECTORY(blas)
ADD_SUBDIRECTORY(performance)
#ADD_SUBDIRECTORY(common)

128 changes: 128 additions & 0 deletions perf_test/KokkosDot_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
//@HEADER
// ************************************************************************
//
// Kokkos v. 3.0
// Copyright (2020) National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. 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.
//
// 3. Neither the name of the Corporation nor the names of the
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY NTESS "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 NTESS OR THE
// CONTRIBUTORS 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.
//
// Questions? Contact Siva Rajamanickam ([email protected])
//
// ************************************************************************
//@HEADER
*/
#include <cstdio>

#include <ctime>
#include <cstring>
#include <cstdlib>
#include <limits>
#include <limits.h>
#include <cmath>
#include <unordered_map>
#include <Kokkos_Core.hpp>
#include <KokkosSparse_CrsMatrix.hpp>
#include <KokkosKernels_IOUtils.hpp>
#include "KokkosKernels_default_types.hpp"
#include <common/RunParams.hpp>
#include <common/QuickKernelBase.hpp>
#include <PerfTestUtilities.hpp>

#ifdef HAVE_CUSPARSE
#include <CuSparse_SPMV.hpp>
#endif

#ifdef HAVE_MKL
#include <MKL_SPMV.hpp>
#endif

#ifdef KOKKOS_ENABLE_OPENMP
#include <OpenMPStatic_SPMV.hpp>
#include <OpenMPDynamic_SPMV.hpp>
#include <OpenMPSmartStatic_SPMV.hpp>
#endif

///////////////////////////////////////////////////////////////
// RAJAPerf Suite interface for Kokkos, Kokkos-Kernels
#include <common/Executor.hpp>

// Headers from dot test prog

#include <iostream>
#include "KokkosBlas1_dot.hpp"
#include "KokkosKernels_Utils.hpp"
// in test_common
//#include "KokkosKernels_TestUtils.hpp"


//FUNCTION THAT IS PART OF KK for generating test matrices
//create_random_x_vector and create_random_y_vector can be used together to generate a random
//linear system Ax = y.
template<typename vec_t>
vec_t create_random_x_vector(vec_t& kok_x, double max_value = 10.0) {
typedef typename vec_t::value_type scalar_t;
auto h_x = Kokkos::create_mirror_view (kok_x);
for (size_t j = 0; j < h_x.extent(1); ++j){
for (size_t i = 0; i < h_x.extent(0); ++i){
scalar_t r =
static_cast <scalar_t> (rand()) /
static_cast <scalar_t> (RAND_MAX / max_value);
h_x.access(i, j) = r;
}
}
Kokkos::deep_copy (kok_x, h_x);
return kok_x;
}


DotTestData setup_test(DotTestData::matrix_type A_matrix, DotTestData::matrix_type B_matrix) {
DotTestData test_data;
using matrix_type = DotTestData::matrix_type;
test_data.A_matrix = create_random_x_vector(A_matrix);
// rm line 113 if build is good
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed?

//test.B_matrix = create_random_x_vector(B_matrix);
test_data.B_matrix = create_random_x_vector(B_matrix);

return test_data;
}



void run_benchmark(DotTestData& test_data) {

Kokkos::Timer timer;
Kokkos::fence();
timer.reset();
double result_1D = KokkosBlas::dot(test_data.A_matrix, test_data.B_matrix);
double elapsed = timer.seconds();
}
75 changes: 75 additions & 0 deletions perf_test/KokkosKernelsTrackedTesting.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
//
// Created by Poliakoff, David Zoeller on 4/26/21.
//
#include <common/RAJAPerfSuite.hpp>
#include <common/Executor.hpp>
#include "sparse/tracked_testing.hpp"
#include <iostream>
#include <Kokkos_Core.hpp>
// For RPS implementation of BLAS Level-1 Tests
#include "blas/blas1/tracked_testing.hpp"

#include "blas/blas2/tracked_testing.hpp"


int main(int argc, char* argv[]) {
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is some odd spacing or tabs here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Siva -- I ran the clang-formatting tool on this file, so hopefully, it's now more in line with the standard

// argument parsing for setting input data at runtime

std::string inputDataPath;
if (argc == 1) {
// print_help();
std::cout << "Please provide input data directory: --input-data /PATH/TO/KOKKOS-KERNELS/INPUT/DATA" << std::endl;
return 0;
}

for (int i = 0; i < argc; i++) {
// if((strcmp(argv[i],"-v")==0)) {numVecs=atoi(argv[++i]); continue;}
if ((strcmp(argv[i], "--input-data") == 0)) {
i++;

if (i == argc) {
std::cerr << "Must pass desired input data after '--input-data'";
exit(1);
}
inputDataPath = std::string(argv[i]);
continue;
}
}


test::set_input_data_path(inputDataPath);

// set up Executor
rajaperf::Executor exec(0, argv);
//rajaperf::Executor exec(argc, argv);
rajaperf::RunParams run_params(0, argv);
// Initialize Kokkos
Kokkos::initialize(argc, argv);

Kokkos::print_configuration(std::cout);

// sparse , spmv
test::sparse::build_executor(exec, argc, argv, run_params);

// All BLAS tests (Dot, Team Dot)
test::blas::build_blas_executor(exec, argc, argv, run_params);

test::blas2::build_blas2_executor(exec, argc, argv, run_params);

exec.setupSuite();

// STEP 3: Report suite run summary
// (enable users to catch errors before entire suite is run)
exec.reportRunSummary(std::cout);

// STEP 4: Execute suite
exec.runSuite();

// STEP 5: Generate suite execution reports
exec.outputRunData();
}
Kokkos::finalize();
return 0;
}
27 changes: 27 additions & 0 deletions perf_test/PerfTestUtilities.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//
// Created by Poliakoff, David Zoeller on 4/27/21.
//

#include "KokkosKernels_default_types.hpp"
#include "KokkosKernels_config.h"
#include "KokkosKernels_IOUtils.hpp"
#include <common/RunParams.hpp>
#include <common/QuickKernelBase.hpp>
#include <common/KernelBase.hpp>
#include <dirent.h>


namespace test {

std::string inputDataPath;

void set_input_data_path(const std::string& path_to_data){
inputDataPath = path_to_data;

};
std::string get_input_data_path(){

return inputDataPath;

};
}
Loading