Skip to content

Commit

Permalink
Fix for Cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Jul 3, 2023
1 parent 72b0a5e commit f98629b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions benchmarks/tokamak/tokamak.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ struct Mapping
ArborX::ExperimentalHyperGeometry::Point<2> beta;
ArborX::ExperimentalHyperGeometry::Point<2> p0;

KOKKOS_FUNCTION
ArborX::Point get_coeff(ArborX::ExperimentalHyperGeometry::Point<2> p) const
{
float alpha_coeff = alpha[0] * (p[0] - p0[0]) + alpha[1] * (p[1] - p0[1]);
Expand Down Expand Up @@ -268,11 +269,14 @@ parse_points(typename DeviceType::execution_space const &execution_space)
Kokkos::LayoutLeft, typename DeviceType::memory_space>
points(Kokkos::view_alloc(Kokkos::WithoutInitializing, "points"),
points_host.size() / size_per_id, size_per_id);
Kokkos::deep_copy(execution_space, points, points_host_view);
auto points_tmp_view = Kokkos::create_mirror_view_and_copy(typename DeviceType::memory_space{}, points_host_view);
Kokkos::deep_copy(execution_space, points, points_tmp_view);

return points;
}

struct Dummy{};

// Now that we have encapsulated the objects and queries to be used within the
// Triangles class, we can continue with performing the actual search.
int main()
Expand All @@ -297,9 +301,6 @@ int main()
std::cout << "Starting the queries.\n";
int const n = points.extent(0);

struct Dummy
{};

struct Attachment
{
int &triangle_index;
Expand Down

0 comments on commit f98629b

Please sign in to comment.