Skip to content
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

Add getClusters methods and enhance general interface #81

Merged
merged 3 commits into from
Jan 28, 2025

Conversation

AuroraPerego
Copy link
Contributor

in CLUEAlgoAlpaka:

  • add getClusters method
  • have the device points as a member
    also:
  • take PointsAlpakaView out of PointsAlpaka

include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
2 * nPoints);

// Wait for all the operations in the queue to finish
alpaka::wait(queue_);
}

template <uint8_t Ndim>
std::map<int, std::vector<int>> CLUEAlgoAlpaka<Ndim>::getClusters(

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
std::map<int, std::vector<int>> CLUEAlgoAlpaka<Ndim>::getClusters(
const PointsSoA<Ndim>& h_points) {
// cluster all points with same clusterId
std::map<int, std::vector<int>> clusters;

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
Copy link
Collaborator

@sbaldu sbaldu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All looks good. Please update the binding modules and run.h too.

PointsAlpaka<Ndim>& dev_points,
Queue queue_,
std::size_t block_size) {
// calculate the number of tiles and their size

Check warning

Code scanning / Flawfinder (reported by Codacy)

Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. Warning

Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data.
alpaka::memcpy(queue_,
clue::make_device_view(device, (*d_tiles)->minMax(), 2 * Ndim),
clue::make_host_view(min_max.data(), 2 * Ndim));
alpaka::memcpy(queue_,

Check warning

Code scanning / Flawfinder (reported by Codacy)

Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. Warning

Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data.
include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
const KernelType& kernel,
Queue queue_,
std::size_t block_size);

template <typename KernelType>
void make_clusters(PointsSoA<Ndim>& h_points,

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
const KernelType& kernel,
Queue queue_,
std::size_t block_size);

template <typename KernelType>
void make_clusters(PointsSoA<Ndim>& h_points,
PointsAlpaka<Ndim>& dev_points,

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
clue::make_device_view(device, (*d_tiles)->tileSize(), Ndim),
clue::make_host_view(tile_size, Ndim));
alpaka::wait(queue_);

Check notice

Code scanning / Cppcheck (reported by Codacy)

memset() called to fill 0 bytes. Note

memset() called to fill 0 bytes.
include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
include/CLUEstering/CLUEstering.hpp Fixed Show fixed Hide fixed
alpaka::memcpy(queue_,
clue::make_host_view(h_points.clusterIndexes(), 2 * nPoints),
clue::make_device_view(
device, dev_points.result_buffer.data() + nPoints, 2 * nPoints),

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 10.4 rule Note

MISRA 10.4 rule
one instantiates the device points, the other takes them from outside

alpaka::enqueue(queue_,
alpaka::createTaskKernel<Acc1D>(working_div,
KernelCalculateLocalDensity{},
m_tiles,
d_points.view(),
dev_points.view(),

Check notice

Code scanning / Cppcheck (reported by Codacy)

MISRA 12.3 rule Note

MISRA 12.3 rule
@sbaldu sbaldu changed the title additions to the algo Add getClusters methods and enhance interface Jan 28, 2025
@sbaldu sbaldu changed the title Add getClusters methods and enhance interface Add getClusters methods and enhance general interface Jan 28, 2025
@sbaldu sbaldu merged commit d48e818 into cms-patatrack:main Jan 28, 2025
20 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants