-
Notifications
You must be signed in to change notification settings - Fork 16
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
Value-View Interface #289
base: develop
Are you sure you want to change the base?
Value-View Interface #289
Changes from 32 commits
0907d56
8451ecf
d12c687
01598a9
ee4a68c
c800c08
5990faa
5c04efe
a8ddc5f
29ee8fa
df6c88f
708cc2a
2b5d3e7
1e33c49
55f5174
383fed8
c09dacb
f3f5d36
df81f95
43cd543
4a43482
dd82347
d850f67
9f48781
ad518f0
74201bb
3747afa
9f29207
78cbad2
6b5c8bd
db42935
bc65da2
b57181b
d4cada3
3566f3d
d1dc378
988adcc
0bbe7d6
06b0492
64afaa3
c9c6e61
c4eb45b
59d37d5
0139307
3ec887d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,11 @@ if (NOT SPHERAL_CMAKE_MODULE_PATH) | |
endif() | ||
list(APPEND CMAKE_MODULE_PATH "${SPHERAL_CMAKE_MODULE_PATH}") | ||
|
||
#------------------------------------------------------------------------------- | ||
# Add Spheral CMake Macros for tests and executables | ||
#------------------------------------------------------------------------------- | ||
include(SpheralMacros) | ||
|
||
#------------------------------------------------------------------------------- | ||
# Set Compiler Flags / Options | ||
#------------------------------------------------------------------------------- | ||
|
@@ -85,7 +90,10 @@ if(ENABLE_CUDA) | |
#set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -arch=${CUDA_ARCH} --expt-relaxed-constexpr --extended-lambda -Xcudafe --display_error_number") | ||
set(CMAKE_CUDA_STANDARD 17) | ||
list(APPEND SPHERAL_CXX_DEPENDS cuda) | ||
set(SPHERAL_ENABLE_CUDA On) | ||
set(SPHERAL_ENABLE_VVI On) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the Value-View interface be enabled for CPU builds as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can be used for CPU builds but it is required for any GPU builds where we will be executing on the device. This just ensures it's enabled if you are building spheral w/ cuda. |
||
endif() | ||
message("Enable Value-View Interface Pattern (VVI) : ${SPHERAL_ENABLE_VVI}") | ||
|
||
#-------------------------------------------------------------------------------# | ||
# Set a default build type if none was specified | ||
|
@@ -140,6 +148,10 @@ set_property(GLOBAL PROPERTY SPHERAL_CXX_DEPENDS "${SPHERAL_CXX_DEPENDS}") | |
#------------------------------------------------------------------------------- | ||
# Prepare to build the src | ||
#------------------------------------------------------------------------------- | ||
configure_file(${SPHERAL_ROOT_DIR}/src/config.hh.in | ||
mdavis36 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
${PROJECT_BINARY_DIR}/src/config.hh) | ||
include_directories(${PROJECT_BINARY_DIR}/src) | ||
|
||
add_subdirectory(${SPHERAL_ROOT_DIR}/src) | ||
|
||
#------------------------------------------------------------------------------- | ||
|
@@ -153,6 +165,7 @@ endif() | |
# Build C++ tests and install tests to install directory | ||
#------------------------------------------------------------------------------- | ||
if (ENABLE_TESTS) | ||
add_subdirectory(${SPHERAL_ROOT_DIR}/tests) | ||
add_subdirectory(${SPHERAL_ROOT_DIR}/tests/unit/CXXTests) | ||
|
||
# A macro to preserve directory structure when installing files | ||
mdavis36 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
macro(spheral_add_executable) | ||
set(options ) | ||
set(singleValueArgs NAME TEST REPRODUCER BENCHMARK) | ||
set(multiValueArgs SOURCES DEPENDS_ON) | ||
|
||
cmake_parse_arguments(arg | ||
"${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
if (ENABLE_OPENMP) | ||
list (APPEND arg_DEPENDS_ON openmp) | ||
endif () | ||
|
||
if (ENABLE_CUDA) | ||
list (APPEND arg_DEPENDS_ON cuda) | ||
endif () | ||
|
||
if (ENABLE_HIP) | ||
list (APPEND arg_DEPENDS_ON blt::hip) | ||
list (APPEND arg_DEPENDS_ON blt::hip_runtime) | ||
endif () | ||
|
||
if (${arg_TEST}) | ||
set (_output_dir ${CMAKE_BINARY_DIR}/test) | ||
elseif (${arg_REPRODUCER}) | ||
set (_output_dir ${CMAKE_BINARY_DIR}/reproducers) | ||
elseif (${arg_BENCHMARK}) | ||
set (_output_dir ${CMAKE_BINARY_DIR}/benchmark) | ||
else () | ||
set (_output_dir ${CMAKE_BINARY_DIR}/bin) | ||
endif() | ||
|
||
blt_add_executable( | ||
NAME ${arg_NAME} | ||
SOURCES ${arg_SOURCES} | ||
DEPENDS_ON ${arg_DEPENDS_ON} | ||
OUTPUT_DIR ${_output_dir} | ||
) | ||
|
||
target_include_directories(${arg_NAME} SYSTEM PRIVATE ${SPHERAL_EXTERN_INCLUDES}) | ||
target_include_directories(${arg_NAME} SYSTEM PRIVATE ${SPHERAL_ROOT_DIR}/src) | ||
target_include_directories(${arg_NAME} SYSTEM PRIVATE ${PROJECT_BINARY_DIR}/src) | ||
|
||
endmacro(spheral_add_executable) | ||
|
||
macro(spheral_add_test) | ||
set(options DEBUG_LINKER) | ||
set(singleValueArgs NAME) | ||
set(multiValueArgs SOURCES DEPENDS_ON) | ||
|
||
cmake_parse_arguments(arg | ||
"${options}" "${singleValueArgs}" "${multiValueArgs}" ${ARGN}) | ||
|
||
set(original_test_name ${arg_NAME}) | ||
set(original_src ${arg_SOURCES}) | ||
set(original_deps ${arg_DEPENDS_ON}) | ||
|
||
get_property(SPHERAL_BLT_DEPENDS GLOBAL PROPERTY SPHERAL_BLT_DEPENDS) | ||
|
||
blt_add_library( | ||
NAME ${original_test_name}_lib | ||
SOURCES ${TEST_LIB_SOURCE} | ||
SOURCES ${SPHERAL_ROOT_DIR}/src/spheralCXX.cc | ||
DEPENDS_ON ${SPHERAL_BLT_DEPENDS} ${original_deps} | ||
SHARED False | ||
) | ||
|
||
target_link_options(${original_test_name}_lib PRIVATE "-Wl,--unresolved-symbols=ignore-in-object-files") | ||
|
||
spheral_add_executable( | ||
NAME ${original_test_name}.exe | ||
SOURCES ${original_src} | ||
DEPENDS_ON gtest ${CMAKE_THREAD_LIBS_INIT} ${original_test_name}_lib | ||
TEST On) | ||
|
||
blt_add_test( | ||
NAME ${original_test_name} | ||
COMMAND ${TEST_DRIVER} ${original_test_name}.exe) | ||
|
||
target_include_directories(${original_test_name}.exe SYSTEM PRIVATE ${SPHERAL_ROOT_DIR}/tests/cpp/include) | ||
|
||
if (${arg_DEBUG_LINKER}) | ||
target_link_options(${original_test_name}.exe PUBLIC "-Wl,--warn-unresolved-symbols") | ||
else() | ||
target_link_options(${original_test_name}.exe PUBLIC "-Wl,--unresolved-symbols=ignore-all") | ||
endif() | ||
|
||
endmacro(spheral_add_test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this blt_convert_to_system_includes() stuff also be in the block under "Found chai External Package" (and any other packages which could be found externally)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I`ll add it to CHAI. We already do this for all other external packages on line 127.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't do it for the packages we use
find_package
on. We only do it on packages we manually bring in. Was this necessary for your stuff?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was, pedantic warnings from RAJA and umpire were causing our WARNINGS_AS_ERRORS builds to fail.