Skip to content

Commit

Permalink
Merge pull request #196 from LLNL/release/0.2.4
Browse files Browse the repository at this point in the history
Release version 0.2.4
  • Loading branch information
davidbeckingsale committed Feb 21, 2017
2 parents 5827882 + 3600b4f commit 3adec51
Show file tree
Hide file tree
Showing 58 changed files with 1,988 additions and 1,561 deletions.
26 changes: 0 additions & 26 deletions .pullapprove.yml

This file was deleted.

21 changes: 16 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,23 +44,24 @@ cmake_minimum_required (VERSION 3.3)

project(RAJA LANGUAGES CXX C)

set(CMAKE_CXX_STANDARD 14) # note, will decay automatically

# Set version number
set(RAJA_VERSION_MAJOR 0)
set(RAJA_VERSION_MINOR 2)
set(RAJA_VERSION_PATCHLEVEL 3)
set(RAJA_VERSION_PATCHLEVEL 4)

set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/modules" ${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/thirdparty" ${CMAKE_MODULE_PATH})

# Build options
option(RAJA_ENABLE_OPENMP "Build OpenMP support" On)
option(RAJA_ENABLE_CUDA "Build CUDA support" Off)
option(RAJA_ENABLE_CLANG_CUDA "Use Clang's native CUDA support" Off)
set(RAJA_CUDA_ARCH "sm_35" CACHE STRING "Compute architecture to pass to CUDA builds")
option(RAJA_ENABLE_CILK "Build Cilk support" Off)
option(RAJA_ENABLE_TESTS "Build tests" On)
option(RAJA_ENABLE_EXAMPLES "Build simple examples" On)
option(RAJA_ENABLE_NESTED "Enable nested loop support" Off)
option(RAJA_ENABLE_WARNINGS "Enable warnings as errors for CI" Off)
option(RAJA_ENABLE_DOCUMENTATION "Build RAJA documentation" Off)

set(TEST_DRIVER "" CACHE STRING "driver used to wrap test commands")

Expand All @@ -72,6 +73,8 @@ include(cmake/SetupCompilers.cmake)
include(cmake/SetupPackages.cmake)
# Setup internal RAJA configuration options
include(cmake/SetupRajaConfig.cmake)
# Macros for building executables and libraries
include (cmake/RAJAMacros.cmake)

include_directories(${PROJECT_BINARY_DIR}/include/RAJA)
include_directories(${PROJECT_BINARY_DIR}/include)
Expand All @@ -83,7 +86,6 @@ install(FILES ${PROJECT_BINARY_DIR}/include/RAJA/config.hxx DESTINATION "include

add_subdirectory(src)


if(RAJA_ENABLE_TESTS)
add_subdirectory(test)
endif()
Expand All @@ -92,6 +94,15 @@ if(RAJA_ENABLE_EXAMPLES)
add_subdirectory(examples)
endif()

if (RAJA_ENABLE_DOCUMENTATION)
if (SPHINX_FOUND)
add_subdirectory(docs)
else ()
message(WARNING "RAJA_ENABLE_DOCUMENTATION=On, but Sphinx not found. \
Documentation won't be built.")
endif ()
endif ()

if(RAJA_ENABLE_APPLICATIONS)
if (NOT EXISTS ${PROJECT_SOURCE_DIR}/extra/llnl-raja-proxies/CMakeLists.txt)
message(STATUS "Cloning RAJA proxy applications...")
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
*******************************************************************************

RAJA: ................................, version 0.2.3
RAJA: ................................, version 0.2.4

Copyright (c) 2016, Lawrence Livermore National Security, LLC.
Produced at the Lawrence Livermore National Laboratory.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
RAJA v0.2.3
RAJA v0.2.4
============

[![Build Status](https://travis-ci.org/LLNL/RAJA.svg?branch=develop)](https://travis-ci.org/LLNL/RAJA)
Expand Down
85 changes: 85 additions & 0 deletions cmake/RAJAMacros.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
macro(raja_add_executable)

set(options )
set(singleValueArgs NAME)
set(multiValueArgs SOURCES DEPENDS_ON)

cmake_parse_arguments(arg
"${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})

if (RAJA_ENABLE_CUDA)
if (RAJA_ENABLE_CLANG_CUDA)
add_executable(${arg_NAME} ${arg_SOURCES})
target_compile_options(${arg_NAME} PRIVATE
-x cuda --cuda-gpu-arch=${RAJA_CUDA_ARCH} --cuda-path=${CUDA_TOOLKIT_ROOT_DIR})
target_include_directories(${arg_NAME}
PUBLIC ${EXPT_CUDA_INCLUDE_LOCATION})
target_link_libraries(${arg_NAME} ${CUDA_LIBRARIES} RAJA ${arg_DEPENDS_ON})
else ()
set_source_files_properties(
${arg_SOURCES}
PROPERTIES
CUDA_SOURCE_PROPERTY_FORMAT OBJ)
cuda_add_executable(${arg_NAME} ${arg_SOURCES})
target_link_libraries(${arg_NAME} RAJA ${arg_DEPENDS_ON})
endif()
else ()
add_executable(${arg_NAME} ${arg_SOURCES})
target_link_libraries(${arg_NAME} RAJA ${arg_DEPENDS_ON})
endif()
endmacro(raja_add_executable)

macro(raja_add_library)
set(options )
set(singleValueArgs NAME)
set(multiValueArgs SOURCES DEPENDS_ON)

cmake_parse_arguments(arg
"${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})

if (RAJA_ENABLE_CUDA)
if (RAJA_ENABLE_CLANG_CUDA)

add_library(${arg_NAME} ${arg_SOURCES})
target_compile_options(${arg_NAME} PRIVATE
-x cuda --cuda-gpu-arch=${RAJA_CUDA_ARCH} --cuda-path=${CUDA_TOOLKIT_ROOT_DIR})
target_include_directories(${arg_NAME}
PUBLIC ${EXPT_CUDA_INCLUDE_LOCATION})
target_link_libraries(${arg_NAME} ${CUDA_LIBRARIES})

else ()
set_source_files_properties(
${arg_SOURCES}
PROPERTIES
CUDA_SOURCE_PROPERTY_FORMAT OBJ)

cuda_add_library(${arg_NAME} ${arg_SOURCES})
endif ()
else ()
add_library(${arg_NAME} ${arg_SOURCES})
endif ()

if (NOT (CMAKE_CXX_COMPILER_ID MATCHES Intel OR RAJA_ENABLE_CLANG_CUDA) )
set_target_properties(${arg_NAME}
PROPERTIES
CXX_STANDARD 11
CXX_STANDARD_REQUIRED YES)
endif()
endmacro(raja_add_library)

macro(raja_add_test)
set(options )
set(singleValueArgs NAME)
set(multiValueArgs SOURCES DEPENDS_ON)

cmake_parse_arguments(arg
"${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN})

raja_add_executable(
NAME ${arg_NAME}.exe
SOURCES ${arg_SOURCES}
DEPENDS_ON ${arg_DEPENDS_ON})

add_test(NAME ${arg_NAME}
COMMAND ${TEST_DRIVER} $<TARGET_FILE:${arg_NAME}>)
endmacro(raja_add_test)
28 changes: 24 additions & 4 deletions cmake/SetupCompilers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@
#
###############################################################################

set(CMAKE_CXX_STANDARD 14)
if (NOT RAJA_ENABLE_CLANG_CUDA)
set(CMAKE_CXX_STANDARD 14)
endif ()

set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3" CACHE STRING "")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -O3" CACHE STRING "")
Expand All @@ -67,17 +69,35 @@ else()
set(RAJA_COMPILER "RAJA_COMPILER_${CMAKE_CXX_COMPILER_ID}")
endif()

if ( MSVC )
if (NOT BUILD_SHARED_LIBS)
foreach(flag_var
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
if(${flag_var} MATCHES "/MD")
string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
endif(${flag_var} MATCHES "/MD")
endforeach(flag_var)
endif()
endif()

if (RAJA_ENABLE_CUDA)
if(CMAKE_BUILD_TYPE MATCHES Release)
set(RAJA_NVCC_FLAGS -O2; -restrict; -arch compute_35; -std c++11; --expt-extended-lambda; -ccbin; ${CMAKE_CXX_COMPILER})
set(RAJA_NVCC_FLAGS -O2; -restrict; -arch ${RAJA_CUDA_ARCH}; -std c++11; --expt-extended-lambda; -ccbin; ${CMAKE_CXX_COMPILER})
elseif(CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
set(RAJA_NVCC_FLAGS -g; -G; -O2; -restrict; -arch compute_35; -std c++11; --expt-extended-lambda; -ccbin ${CMAKE_CXX_COMPILER})
set(RAJA_NVCC_FLAGS -g; -G; -O2; -restrict; -arch ${RAJA_CUDA_ARCH}; -std c++11; --expt-extended-lambda; -ccbin ${CMAKE_CXX_COMPILER})
elseif(CMAKE_BUILD_TYPE MATCHES Debug)
set(RAJA_NVCC_FLAGS -g; -G; -O0; -restrict; -arch compute_35; -std c++11; --expt-extended-lambda; -ccbin ${CMAKE_CXX_COMPILER})
set(RAJA_NVCC_FLAGS -g; -G; -O0; -restrict; -arch ${RAJA_CUDA_ARCH}; -std c++11; --expt-extended-lambda; -ccbin ${CMAKE_CXX_COMPILER})
endif()
endif()

set(RAJA_RANGE_ALIGN 4 CACHE INT "")
set(RAJA_RANGE_MIN_LENGTH 32 CACHE INT "")
set(RAJA_DATA_ALIGN 64 CACHE INT "")
set(RAJA_COHERENCE_BLOCK_SIZE 64 CACHE INT "")

include(CheckFunctionExists)
check_function_exists(posix_memalign HAVE_POSIX_MEMALIGN)
if(${HAVE_POSIX_MEMALIGN})
add_definitions(-DHAVE_POSIX_MEMALIGN)
endif(${HAVE_POSIX_MEMALIGN})
31 changes: 25 additions & 6 deletions cmake/SetupPackages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ if (RAJA_ENABLE_OPENMP)
endif()
endif()

if (RAJA_ENABLE_CLANG_CUDA)
set(RAJA_ENABLE_CUDA On)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
endif ()

if (RAJA_ENABLE_CUDA)
find_package(CUDA)
if(CUDA_FOUND)
Expand Down Expand Up @@ -87,12 +92,22 @@ if (RAJA_ENABLE_TESTS)
ExternalProject_Get_Property(googletest binary_dir)
add_library(gtest UNKNOWN IMPORTED)
add_library(gtest_main UNKNOWN IMPORTED)
set_target_properties(gtest PROPERTIES
IMPORTED_LOCATION ${binary_dir}/libgtest.a
)
set_target_properties(gtest_main PROPERTIES
IMPORTED_LOCATION ${binary_dir}/libgtest_main.a
)

if ( UNIX )
set_target_properties(gtest PROPERTIES
IMPORTED_LOCATION ${binary_dir}/libgtest.a
)
set_target_properties(gtest_main PROPERTIES
IMPORTED_LOCATION ${binary_dir}/libgtest_main.a
)
elseif( WIN32 )
set_target_properties(gtest PROPERTIES
IMPORTED_LOCATION ${binary_dir}/${CMAKE_BUILD_TYPE}/gtest.lib
)
set_target_properties(gtest_main PROPERTIES
IMPORTED_LOCATION ${binary_dir}/${CMAKE_BUILD_TYPE}/gtest_main.lib
)
endif ()
add_dependencies(gtest googletest)
add_dependencies(gtest_main googletest)

Expand All @@ -101,3 +116,7 @@ if (RAJA_ENABLE_TESTS)

enable_testing()
endif ()

if (RAJA_ENABLE_DOCUMENTATION)
find_package(Sphinx)
endif ()
12 changes: 6 additions & 6 deletions cmake/SetupRajaConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,19 +73,19 @@ else ()
set(RAJA_USE_CHRONO OFF CACHE BOOL "Use the default std::chrono timer" )
endif ()
if (RAJA_TIMER STREQUAL "gettime")
set(RAJA_USE_GETTIME ON CACHE BOOL "Use clock_gettime for timer" )
set(RAJA_USE_GETTIME ON CACHE BOOL "Use clock_gettime from time.h for timer" )
else ()
set(RAJA_USE_GETTIME OFF CACHE BOOL "Use clock_gettime for timer" )
set(RAJA_USE_GETTIME OFF CACHE BOOL "Use clock_gettime from time.h for timer" )
endif ()
if (RAJA_TIMER STREQUAL "clock")
set(RAJA_USE_CLOCK ON CACHE BOOL "Use clock_gettime for timer" )
set(RAJA_USE_CLOCK ON CACHE BOOL "Use clock from time.h for timer" )
else ()
set(RAJA_USE_CLOCK OFF CACHE BOOL "Use clock_gettime for timer" )
set(RAJA_USE_CLOCK OFF CACHE BOOL "Use clock from time.h for timer" )
endif ()
if (RAJA_TIMER STREQUAL "cycle")
set(RAJA_USE_CYCLE ON CACHE BOOL "Use clock_gettime for timer" )
set(RAJA_USE_CYCLE ON CACHE BOOL "Use getticks from cycle.h for timer" )
else ()
set(RAJA_USE_CYCLE OFF CACHE BOOL "Use clock_gettime for timer" )
set(RAJA_USE_CYCLE OFF CACHE BOOL "Use getticks from cycle.h for timer" )
endif ()

# Configure a header file with all the variables we found.
Expand Down
10 changes: 10 additions & 0 deletions cmake/thirdparty/FindSphinx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
find_program(SPHINX_EXECUTABLE
NAMES sphinx-build sphinx-build2
DOC "Path to sphinx-build executable")

# Handle REQUIRED and QUIET arguments
# this will also set SPHINX_FOUND to true if SPHINX_EXECUTABLE exists
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Sphinx
"Failed to locate sphinx-build executable"
SPHINX_EXECUTABLE)
1 change: 1 addition & 0 deletions docs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(sphinx)
16 changes: 16 additions & 0 deletions docs/sphinx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set(SPHINX_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/_build")
set(SPHINX_HTML_DIR "${CMAKE_CURRENT_BINARY_DIR}/html")

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/conf.py"
"${SPHINX_BUILD_DIR}/conf.py"
@ONLY)

add_custom_target(docs
${SPHINX_EXECUTABLE}
-q -b html
"${CMAKE_CURRENT_SOURCE_DIR}"
"${SPHINX_HTML_DIR}"
COMMENT "Building HTML documentation with Sphinx")

install(DIRECTORY "${SPHINX_HTML_DIR}"
DESTINATION "docs/sphinx/" OPTIONAL)

0 comments on commit 3adec51

Please sign in to comment.