Skip to content

Commit

Permalink
Merge branch 'main' into run-debug-test
Browse files Browse the repository at this point in the history
  • Loading branch information
beomki-yeo authored Oct 26, 2023
2 parents 7917ec4 + 4ec5231 commit 96e08cf
Show file tree
Hide file tree
Showing 242 changed files with 8,625 additions and 4,057 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
SCALAR_TYPE: ["float", "double"]
PLATFORM:
- NAME: "HOST"
CONTAINER: "ghcr.io/acts-project/ubuntu2004:v30"
CONTAINER: "ghcr.io/acts-project/ubuntu2004:v43"
OPTIONS: -DDETRAY_EIGEN_PLUGIN=ON -DDETRAY_SMATRIX_PLUGIN=ON -DDETRAY_VC_PLUGIN=ON

# The system to run on.
Expand All @@ -70,10 +70,18 @@ jobs:
run:
shell: bash

# Set the path to the test data files
env:
DETRAY_DATA_DIRECTORY: ${{ github.workspace }}/data/
DETRAY_BFIELD_FILE: ${{ github.workspace }}/data/odd-bfield_v0_8_0.cvf

# The build/test steps to execute.
steps:
# Use a standard checkout of the code.
- uses: actions/checkout@v2
# Get the data files for the tests
- name: Download data files
run: data/detray_data_get_files.sh
# Run the CMake configuration.
- name: Configure
run: |
Expand Down Expand Up @@ -136,4 +144,3 @@ jobs:
run: |
source ${GITHUB_WORKSPACE}/.github/ci_setup.sh ${{ matrix.PLATFORM.NAME }}
cmake --build build
16 changes: 11 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ build_cuda:
stage: build
image: ghcr.io/acts-project/ubuntu2004_cuda:v30
artifacts:
paths:
paths:
- build
script:
- git clone $CLONE_URL src
Expand All @@ -26,12 +26,18 @@ build_cuda:


test_cuda:
variables:
DETRAY_DATA_DIRECTORY: src/data/
DETRAY_BFIELD_FILE: $CI_PROJECT_DIR/src/data/odd-bfield_v0_8_0.cvf
stage: test
tags: [docker-gpu-nvidia]
image: ghcr.io/acts-project/ubuntu2004_cuda:v30
needs:
needs:
- build_cuda
script:
- git clone $CLONE_URL src
- git -C src checkout $HEAD_SHA
- src/data/detray_data_get_files.sh
- cd build
- nvidia-smi
- ctest --output-on-failure -R ".*cuda.*"
Expand All @@ -43,7 +49,7 @@ build_sycl:
stage: build
image: "ghcr.io/acts-project/ubuntu2004_oneapi:v30"
artifacts:
paths:
paths:
- build
script:
- git clone $CLONE_URL src
Expand All @@ -66,7 +72,7 @@ test_sycl:
stage: test
tags: [docker-gpu-nvidia]
image: "ghcr.io/acts-project/ubuntu2004_oneapi:v30"
needs:
needs:
- build_sycl
script:
- git clone $CLONE_URL src
Expand All @@ -75,4 +81,4 @@ test_sycl:
- cd build
- nvidia-smi
- ctest --output-on-failure -R ".*sycl.*"
- find bin -type f -name "*sycl" -not -name "*text*" -exec {} \;
- find bin -type f -name "*sycl" -not -name "*text*" -exec {} \;
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Set up the project.
cmake_minimum_required( VERSION 3.11 )
project( detray VERSION 0.41.0 LANGUAGES CXX )
project( detray VERSION 0.44.0 LANGUAGES CXX )

# Set up the used C++ standard(s).
set( CMAKE_CXX_STANDARD 17 CACHE STRING "The (host) C++ standard to use" )
Expand Down
2 changes: 1 addition & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ file( GLOB _detray_core_private_headers
detray_add_library( detray_core core
${_detray_core_public_headers} ${_detray_core_private_headers} )
target_link_libraries( detray_core
INTERFACE covfie::core vecmem::core detray::Thrust )
INTERFACE vecmem::core detray::Thrust )

# Generate a version header for the project.
configure_file( "cmake/version.hpp.in"
Expand Down
9 changes: 0 additions & 9 deletions core/include/detray/coordinates/cartesian2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,6 @@ struct cartesian2 final : public coordinate_base<cartesian2, transform3_t> {
const vector3 & /*dir*/) const {
// Do nothing
}

template <size_type meas_dim, bool normal_order>
DETRAY_HOST_DEVICE inline void unsigned_local(
matrix_type<meas_dim, e_bound_size> & /*projection_matrix*/,
const bound_track_parameters<transform3_t> & /*bound_params*/) {
// Do nothing
return;
}

}; // struct cartesian2

} // namespace detray
45 changes: 0 additions & 45 deletions core/include/detray/coordinates/coordinate_base.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,51 +239,6 @@ struct coordinate_base {

return derivative * path_derivative;
}

/// @returns the projection matrix for measurement
template <size_type meas_dim, bool normal_order>
DETRAY_HOST_DEVICE inline matrix_type<meas_dim, e_bound_size>
projection_matrix(
const bound_track_parameters<transform3_t>& bound_params) {

matrix_type<meas_dim, e_bound_size> proj =
matrix_operator().template zero<meas_dim, e_bound_size>();
// For normal ordering
if constexpr (normal_order == true) {
// For meas_dim == 1, Return:
// [ 1 0 0 0 0 0 ]
if constexpr (meas_dim == 1u) {
matrix_operator().element(proj, 0u, 0u) = 1.f;
}
// For meas_dim == 2, Return:
// [ 1 0 0 0 0 0 ]
// [ 0 1 0 0 0 0 ]
else if (meas_dim == 2u) {
matrix_operator().element(proj, 0u, 0u) = 1.f;
matrix_operator().element(proj, 1u, 1u) = 1.f;
}
}
// For reverse ordering
else {
// For meas_dim == 1, Return:
// [ 0 1 0 0 0 0 ]
if constexpr (meas_dim == 1u) {
matrix_operator().element(proj, 0u, 1u) = 1.f;
}
// For meas_dim == 2, Return:
// [ 0 1 0 0 0 0 ]
// [ 1 0 0 0 0 0 ]
else if (meas_dim == 2u) {
matrix_operator().element(proj, 0u, 1u) = 1.f;
matrix_operator().element(proj, 1u, 0u) = 1.f;
}
}

Derived<transform3_t>().template unsigned_local<meas_dim, normal_order>(
proj, bound_params);

return proj;
}
};

} // namespace detray
9 changes: 0 additions & 9 deletions core/include/detray/coordinates/cylindrical2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,6 @@ struct cylindrical2 : public coordinate_base<cylindrical2, transform3_t> {
const vector3 & /*dir*/) const {
// Do nothing
}

template <size_type meas_dim, bool normal_order>
DETRAY_HOST_DEVICE inline void unsigned_local(
matrix_type<meas_dim, e_bound_size> & /*projection_matrix*/,
const bound_track_parameters<transform3_t> & /*bound_params*/) {
// Do nothing
return;
}

}; // struct cylindrical2

} // namespace detray
21 changes: 0 additions & 21 deletions core/include/detray/coordinates/line2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,27 +284,6 @@ struct line2 : public coordinate_base<line2, transform3_t> {
e_bound_theta) =
theta_to_free_pos_derivative[2];
}

template <size_type meas_dim, bool normal_order>
DETRAY_HOST_DEVICE inline void unsigned_local(
matrix_type<meas_dim, e_bound_size> &projection_matrix,
const bound_track_parameters<transform3_t> &bound_params) {

const auto bound_local = bound_params.bound_local();

// Change the sign of radial distance if it is negative
if (bound_local[0] < 0.f) {
if constexpr (normal_order == true) {
matrix_operator().element(projection_matrix, 0u, 0u) = -1.f;
} else {
if constexpr (meas_dim == 2u) {
matrix_operator().element(projection_matrix, 1u, 0u) = -1.f;
}
}
}

return;
}
};

} // namespace detray
8 changes: 0 additions & 8 deletions core/include/detray/coordinates/polar2.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,6 @@ struct polar2 : public coordinate_base<polar2, transform3_t> {
const vector3 & /*dir*/) const {
// Do nothing
}

template <size_type meas_dim, bool normal_order>
DETRAY_HOST_DEVICE inline void unsigned_local(
matrix_type<meas_dim, e_bound_size> & /*projection_matrix*/,
const bound_track_parameters<transform3_t> & /*bound_params*/) {
// Do nothing
return;
}
};

} // namespace detray
13 changes: 13 additions & 0 deletions core/include/detray/core/detail/container_buffers.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ struct has_buffer<const vecmem::vector<T>, void> : public std::true_type {
using type = vecmem::data::vector_buffer<const T>;
};

/// Specialization of the buffer getter for @c vecmem::device_vector
template <typename T>
struct has_buffer<vecmem::device_vector<T>, void> : public std::true_type {
using type = vecmem::data::vector_buffer<T>;
};

/// Specialization of the buffer getter for @c vecmem::device_vector - const
template <typename T>
struct has_buffer<const vecmem::device_vector<T>, void>
: public std::true_type {
using type = vecmem::data::vector_buffer<const T>;
};

template <class T>
inline constexpr bool has_buffer_v = has_buffer<T>::value;

Expand Down
32 changes: 30 additions & 2 deletions core/include/detray/core/detail/container_views.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,26 @@ struct detail::has_view<vecmem::vector<T>, void> : public std::true_type {
using type = dvector_view<T>;
};

/// Specialization of the view getter for @c vecmem::vector
/// Specialization of the view getter for @c vecmem::vector - const
template <typename T>
struct detail::has_view<const vecmem::vector<T>, void> : public std::true_type {
using type = dvector_view<const T>;
};

/// Specialization of the view getter for @c vecmem::device_vector
template <typename T>
struct detail::has_view<vecmem::device_vector<T>, void>
: public std::true_type {
using type = dvector_view<T>;
};

/// Specialization of the view getter for @c vecmem::device_vector - const
template <typename T>
struct detail::has_view<const vecmem::device_vector<T>, void>
: public std::true_type {
using type = dvector_view<const T>;
};

/// Specialized view for @c vecmem::jagged_vector containers
template <typename T>
using djagged_vector_view = vecmem::data::jagged_vector_view<T>;
Expand All @@ -198,13 +212,27 @@ struct detail::has_view<vecmem::jagged_vector<T>, void>
using type = djagged_vector_view<T>;
};

/// Specialization of the view getter for @c vecmem::jagged_vector
/// Specialization of the view getter for @c vecmem::jagged_vector - const
template <typename T>
struct detail::has_view<const vecmem::jagged_vector<T>, void>
: public std::true_type {
using type = djagged_vector_view<const T>;
};

/// Specialization of the view getter for @c vecmem::jagged_device_vector
template <typename T>
struct detail::has_view<vecmem::jagged_device_vector<T>, void>
: public std::true_type {
using type = djagged_vector_view<T>;
};

/// Specialization of the view getter for @c vecmem::jagged_device_vector
/// - const
template <typename T>
struct detail::has_view<const vecmem::jagged_device_vector<T>, void>
: public std::true_type {
using type = djagged_vector_view<const T>;
};
/// @}

} // namespace detray
7 changes: 7 additions & 0 deletions core/include/detray/core/detail/multi_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,13 @@ class multi_store {
detail::get<value_types::to_index(id)>(m_tuple_container).reserve(n);
}

/// Resize the underlying container to @param n for a collection given by
/// @tparam id
template <ID id>
DETRAY_HOST void resize(std::size_t n, const context_type & /*ctx*/) {
detail::get<value_types::to_index(id)>(m_tuple_container).resize(n);
}

/// Add a new element to a collection
///
/// @tparam ID is the id of the collection
Expand Down
7 changes: 6 additions & 1 deletion core/include/detray/core/detail/single_store.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,16 @@ class single_store {
m_container.clear();
}

/// Reserve memory of size @param n for a collection given by @tparam id
/// Reserve memory of size @param n for a given geometry context
DETRAY_HOST void reserve(std::size_t n, const context_type & /*ctx*/) {
m_container.reserve(n);
}

/// Resize the underlying container to @param n for a given geometry context
DETRAY_HOST void resize(std::size_t n, const context_type & /*ctx*/) {
m_container.resize(n);
}

/// Add a new element to the collection - copy
///
/// @tparam U type that can be converted to T
Expand Down
Loading

0 comments on commit 96e08cf

Please sign in to comment.