Skip to content

Commit

Permalink
Add libenvpp as submodule. Include it in cmake.
Browse files Browse the repository at this point in the history
Test config properly parses correct env vars or reports when they can not be parsed.
Add test for deprecated env vars.
libenvpp checked out at v1.1 tag.
  • Loading branch information
facuMH authored and psalz committed Mar 24, 2023
1 parent e35cd5f commit b2ced9b
Show file tree
Hide file tree
Showing 10 changed files with 257 additions and 162 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@
[submodule "vendor/Catch2"]
path = vendor/Catch2
url = https://github.com/catchorg/Catch2.git
[submodule "vendor/libenvpp"]
path = vendor/libenvpp
url = https://github.com/ph3at/libenvpp.git
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ else()
set(CELERITY_SYCL_IMPL "${AVAILABLE_SYCL_IMPLS}")
message(STATUS "Automatically chooosing ${CELERITY_SYCL_IMPL} because it is the only SYCL implementation available")
endif()
endif ()
endif()

set(CELERITY_DPCPP_TARGETS "spir64" CACHE STRING "Intel DPC++ targets")
if(CELERITY_SYCL_IMPL STREQUAL "DPC++")
Expand Down Expand Up @@ -179,6 +179,9 @@ endif()
fetch_content_from_submodule(Catch2 vendor/Catch2)
list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras)

set(LIBENVPP_INSTALL ON CACHE BOOL "" FORCE)
fetch_content_from_submodule(libenvpp vendor/libenvpp)

configure_file(include/version.h.in include/version.h @ONLY)

# Add includes to library so they show up in IDEs
Expand Down Expand Up @@ -259,6 +262,7 @@ target_link_libraries(celerity_runtime PUBLIC
fmt::fmt
spdlog::spdlog
gch::small_vector
libenvpp::libenvpp
${SYCL_LIB}
)

Expand Down
1 change: 1 addition & 0 deletions cmake/celerity-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ find_dependency(Threads REQUIRED)
find_dependency(fmt REQUIRED)
find_dependency(spdlog REQUIRED)
find_dependency(small_vector REQUIRED)
find_dependency(libenvpp REQUIRED)

if(CELERITY_SYCL_IMPL STREQUAL "hipSYCL")
if(NOT DEFINED HIPSYCL_TARGETS AND NOT "@HIPSYCL_TARGETS@" STREQUAL "")
Expand Down
4 changes: 3 additions & 1 deletion include/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <cstddef>
#include <optional>
#include <string_view>
#include <vector>

namespace celerity {
namespace detail {
Expand Down Expand Up @@ -47,7 +49,7 @@ namespace detail {
std::optional<device_config> m_device_cfg;
std::optional<bool> m_enable_device_profiling;
size_t m_graph_print_max_verts = 200;
int m_dry_run_nodes = 0;
size_t m_dry_run_nodes = 0;
};

} // namespace detail
Expand Down
Loading

0 comments on commit b2ced9b

Please sign in to comment.