Skip to content

Commit

Permalink
UpdatE
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenswat committed Jun 25, 2024
1 parent 82de631 commit f3c0e13
Show file tree
Hide file tree
Showing 12 changed files with 182 additions and 442 deletions.
2 changes: 2 additions & 0 deletions core/include/traccc/edm/spacepoint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ struct spacepoint {
scalar radius() const {
return std::sqrt(global[0] * global[0] + global[1] * global[1]);
}
TRACCC_HOST_DEVICE
scalar phi() const { return std::atan2(y(), x()); }
};

/// Comparison / ordering operator for spacepoints
Expand Down
1 change: 0 additions & 1 deletion device/cuda/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ traccc_add_library( traccc_cuda cuda TYPE SHARED
"src/seeding2/seed_finding2.cu"
"src/seeding2/kernels/seed_finding_kernel.cu"
"src/seeding2/kernels/kd_tree_kernel.cu"
"src/seeding2/kernels/write_output_kernel.cu"
# Clusterization
"include/traccc/cuda/clusterization/clusterization_algorithm.hpp"
"src/clusterization/clusterization_algorithm.cu"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#pragma once

#include <traccc/cuda/seeding2/types/internal_sp.hpp>
#include <traccc/cuda/seeding2/types/kd_tree.hpp>
#include <traccc/edm/internal_spacepoint.hpp>
#include <traccc/edm/spacepoint.hpp>
#include <vecmem/utils/copy.hpp>
#include <vector>

namespace traccc::cuda {
Expand All @@ -19,6 +19,7 @@ namespace traccc::cuda {
*
* @return A pair containing the k-d tree nodes as well as the number of nodes.
*/
std::tuple<kd_tree_owning_t, uint32_t, internal_sp_owning_t> create_kd_tree(
vecmem::memory_resource&, internal_sp_owning_t&&, uint32_t);
std::tuple<kd_tree_owning_t, uint32_t, vecmem::data::vector_buffer<std::size_t>>
create_kd_tree(vecmem::memory_resource&, vecmem::copy& copy,
const spacepoint_collection_types::const_view&);
} // namespace traccc::cuda
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

#pragma once

#include <traccc/cuda/seeding2/types/internal_sp.hpp>
#include <traccc/cuda/seeding2/types/kd_tree.hpp>
#include <traccc/edm/alt_seed.hpp>
#include <traccc/edm/internal_spacepoint.hpp>
#include <traccc/edm/seed.hpp>
#include <traccc/edm/spacepoint.hpp>
#include <traccc/seeding/detail/seeding_config.hpp>
#include <vecmem/utils/copy.hpp>

namespace traccc::cuda {
/**
Expand All @@ -21,7 +21,7 @@ namespace traccc::cuda {
* @return A pair containing the list of internal seeds as well as the number
* of seeds.
*/
std::pair<vecmem::unique_alloc_ptr<alt_seed[]>, uint32_t> run_seeding(
seedfinder_config, seedfilter_config, vecmem::memory_resource&,
internal_sp_t, kd_tree_t);
seed_collection_types::buffer run_seeding(
seedfinder_config, seedfilter_config, vecmem::memory_resource &,
vecmem::copy &, const spacepoint_collection_types::const_view &, kd_tree_t);
} // namespace traccc::cuda

This file was deleted.

23 changes: 17 additions & 6 deletions device/cuda/include/traccc/cuda/seeding2/seed_finding.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,40 @@

#pragma once

#include <traccc/edm/alt_seed.hpp>
#include <traccc/edm/seed.hpp>
#include <traccc/edm/spacepoint.hpp>
#include <traccc/seeding/detail/seeding_config.hpp>
#include <traccc/utils/algorithm.hpp>
#include <traccc/utils/memory_resource.hpp>
#include <vecmem/memory/cuda/device_memory_resource.hpp>
#include <vecmem/utils/copy.hpp>

#include "traccc/cuda/utils/stream.hpp"

namespace traccc::cuda {
/**
* @brief Alternative seed finding algorithm, using orthogonal range search
* implemented through a k-d tree.
*/
class seed_finding2 : public algorithm<alt_seed_collection_types::buffer(
class seed_finding2 : public algorithm<seed_collection_types::buffer(
const spacepoint_collection_types::const_view&)> {
public:
seed_finding2(const traccc::memory_resource& mr);
seed_finding2(const seedfinder_config& config,
const seedfilter_config& filter_config,
const traccc::memory_resource& mr, vecmem::copy& copy,
stream& str);

output_type operator()(
const spacepoint_collection_types::const_view& sps) const override;

private:
traccc::memory_resource m_output_mr;
seedfinder_config m_finder_conf;
seedfilter_config m_filter_conf;
traccc::memory_resource m_mr;
vecmem::copy& m_copy;
stream& m_stream;

seedfinder_config m_seedfinder_config;
seedfilter_config m_seedfilter_config;

int m_warp_size;
};
} // namespace traccc::cuda
35 changes: 0 additions & 35 deletions device/cuda/include/traccc/cuda/seeding2/types/internal_sp.hpp

This file was deleted.

56 changes: 0 additions & 56 deletions device/cuda/include/traccc/cuda/utils/device_traits.hpp

This file was deleted.

Loading

0 comments on commit f3c0e13

Please sign in to comment.