Skip to content

Commit

Permalink
refactor(kokkos): create kokkos view without initializing
Browse files Browse the repository at this point in the history
  • Loading branch information
pranav-sivaraman committed Jan 9, 2024
1 parent 22c8431 commit c3d7b8e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/kokkos/fasten.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ template <size_t PPWI> class IMPL_CLS final : public Bude<PPWI> {
}

template <typename T> static Kokkos::View<T *> mkView(const std::string &name, const std::vector<T> &xs) {
Kokkos::View<T *> view(name, xs.size());
Kokkos::View<T *> view(Kokkos::ViewAllocateWithoutInitializing(name), xs.size());
auto mirror = Kokkos::create_mirror_view(view);
for (size_t i = 0; i < xs.size(); i++)
mirror[i] = xs[i];
Expand All @@ -199,7 +199,6 @@ template <size_t PPWI> class IMPL_CLS final : public Bude<PPWI> {
Sample sample(PPWI, wgsize, p.nposes());

{

auto hostToDeviceStart = now();

auto protein = mkView("protein", p.protein);
Expand All @@ -211,7 +210,7 @@ template <size_t PPWI> class IMPL_CLS final : public Bude<PPWI> {
auto transforms_4 = mkView("transforms_4", p.poses[4]);
auto transforms_5 = mkView("transforms_5", p.poses[5]);
auto forcefield = mkView("forcefield", p.forcefield);
Kokkos::View<float *> results("results", sample.energies.size());
Kokkos::View<float *> results(Kokkos::ViewAllocateWithoutInitializing("results"), sample.energies.size());
Kokkos::fence();

auto hostToDeviceEnd = now();
Expand Down

0 comments on commit c3d7b8e

Please sign in to comment.