Update Kokkos library in LAMMPS to v3.0

This commit is contained in:
Stan Moore
2020-03-25 14:08:39 -06:00
parent 0252d8c210
commit 60864e38d1
2169 changed files with 121406 additions and 126492 deletions

View File

@ -2,10 +2,11 @@
//@HEADER
// ************************************************************************
//
// Kokkos v. 2.0
// Copyright (2014) Sandia Corporation
// Kokkos v. 3.0
// Copyright (2020) National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
// 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
@ -23,10 +24,10 @@
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
// 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 SANDIA CORPORATION OR THE
// 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
@ -41,23 +42,26 @@
//@HEADER
*/
#include<Kokkos_Core.hpp>
#include<impl/Kokkos_Timer.hpp>
#include<gather.hpp>
#include<cstdlib>
#include <Kokkos_Core.hpp>
#include <impl/Kokkos_Timer.hpp>
#include <gather.hpp>
#include <cstdlib>
int main(int argc, char* argv[]) {
Kokkos::initialize(argc,argv);
Kokkos::initialize(argc, argv);
if(argc<8) {
if (argc < 8) {
printf("Arguments: S N K D\n");
printf(" S: Scalar Type Size (1==float, 2==double, 4=complex<double>)\n");
printf(
" S: Scalar Type Size (1==float, 2==double, 4=complex<double>)\n");
printf(" N: Number of entities\n");
printf(" K: Number of things to gather per entity\n");
printf(" D: Max distance of gathered things of an entity\n");
printf(" R: how often to loop through the K dimension with each team\n");
printf(" U: how many independent flops to do per load\n");
printf(" F: how many times to repeat the U unrolled operations before reading next element\n");
printf(
" F: how many times to repeat the U unrolled operations before "
"reading next element\n");
printf("Example Input GPU:\n");
printf(" Bandwidth Bound : 2 10000000 1 1 10 1 1\n");
printf(" Cache Bound : 2 10000000 64 1 10 1 1\n");
@ -68,7 +72,6 @@ int main(int argc, char* argv[]) {
return 0;
}
int S = atoi(argv[1]);
int N = atoi(argv[2]);
int K = atoi(argv[3]);
@ -77,17 +80,22 @@ int main(int argc, char* argv[]) {
int U = atoi(argv[6]);
int F = atoi(argv[7]);
if( (S!=1) && (S!=2) && (S!=4)) {printf("S must be one of 1,2,4\n"); return 0;}
if( N<D ) {printf("N must be larger or equal to D\n"); return 0; }
if(S==1) {
run_gather_test<float>(N,K,D,R,U,F);
if ((S != 1) && (S != 2) && (S != 4)) {
printf("S must be one of 1,2,4\n");
return 0;
}
if(S==2) {
run_gather_test<double>(N,K,D,R,U,F);
if (N < D) {
printf("N must be larger or equal to D\n");
return 0;
}
if(S==4) {
run_gather_test<Kokkos::complex<double> >(N,K,D,R,U,F);
if (S == 1) {
run_gather_test<float>(N, K, D, R, U, F);
}
if (S == 2) {
run_gather_test<double>(N, K, D, R, U, F);
}
if (S == 4) {
run_gather_test<Kokkos::complex<double> >(N, K, D, R, U, F);
}
Kokkos::finalize();
}