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

Kokkos Tools first attempt #1158

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 17 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,17 @@ set (raja_sources
src/MemUtils_CUDA.cpp
src/MemUtils_HIP.cpp
src/MemUtils_SYCL.cpp
src/PluginStrategy.cpp)
src/PluginStrategy.cpp
)

if (RAJA_ENABLE_RUNTIME_PLUGINS)
set (raja_sources
${raja_sources}
src/RuntimePluginLoader.cpp
src/KokkosPluginLoader.cpp)
src/KokkosPluginLoader.cpp
src/Kokkos_Command_Line_Parsing.cpp
src/Kokkos_Profiling.cpp
)
endif ()

set (raja_depends)
Expand Down Expand Up @@ -312,7 +316,7 @@ blt_add_library(
DEPENDS_ON ${raja_depends} camp ${CMAKE_DL_LIBS}
DEFINES ${raja_defines})


target_compile_definitions(RAJA PUBLIC KOKKOS_TOOLS_INDEPENDENT_BUILD)
install(TARGETS RAJA
EXPORT RAJA
ARCHIVE DESTINATION lib
Expand All @@ -322,11 +326,20 @@ install(TARGETS RAJA

install(EXPORT RAJA DESTINATION share/raja/cmake/)

#target_include_directories(RAJA
# PUBLIC
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/RAJA/tools/>
# $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
# $<INSTALL_INTERFACE:include>
# $<INSTALL_INTERFACE:${PROJECT_BINARY_DIR}/include/RAJA/tools/>
#)
target_include_directories(RAJA
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)
$<INSTALL_INTERFACE:include>
)
if (ENABLE_CUDA AND NOT ENABLE_EXTERNAL_CUB)
target_include_directories(RAJA SYSTEM
PUBLIC
Expand Down
63 changes: 63 additions & 0 deletions include/impl/Kokkos_Command_Line_Parsing.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
//@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 Christian R. Trott (crtrott@sandia.gov)
//
// ************************************************************************
//@HEADER
*/

#ifndef KOKKOS_COMMAND_LINE_PARSING_HPP
#define KOKKOS_COMMAND_LINE_PARSING_HPP

#include <string>
#include <iosfwd>

namespace Kokkos {
namespace Impl {
bool is_unsigned_int(const char* str);
bool check_arg(char const* arg, char const* expected);
// void throw_runtime_exception(const std::string& msg);
bool check_int_arg(char const* arg, char const* expected, int* value);
bool check_str_arg(char const* arg, char const* expected, std::string& value);
void warn_deprecated_command_line_argument(std::string deprecated,
std::string valid);
} // namespace Impl
} // namespace Kokkos

#endif