Skip to content

Commit

Permalink
Update docs/source/ProgrammingGuide/Kokkos-and-Virtual-Functions.md
Browse files Browse the repository at this point in the history
Co-authored-by: Cédric Chevalier <cedric.chevalier019@proton.me>
  • Loading branch information
pzehner and cedricchevalier19 authored Jul 16, 2024
1 parent 06fe604 commit b0d80f8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ to one where we construct on the device using a technique called *placement new*

```c++
Base* deviceInstance; // declare
cudaMalloc((void**)&deviceInstance, sizeof(Derived)); // alocate on device
cudaMalloc((void**)&deviceInstance, sizeof(Derived)); // allocate on device
Kokkos::parallel_for("Initialize", 1, KOKKOS_LAMBDA (const int i) {
new (static_cast<Derived*>(deviceInstance)) Derived(); // initialize on device
});
Expand Down

0 comments on commit b0d80f8

Please sign in to comment.