forked from kokkos/kokkos
-
Notifications
You must be signed in to change notification settings - Fork 0
Kokkos::kokkos_free
Damien L-G edited this page May 1, 2020
·
9 revisions
Defined in header <Kokkos_Core.hpp>
template <class MemorySpace = typename Kokkos::DefaultExecutionSpace::memory_space>
void kokkos_free(void* ptr);
Deallocates the space previously allocated by Kokkos::kokkos_malloc
or Kokkos::kokkos_realloc
.
If ptr
is a null pointer, the function does nothing.
-
ptr
: The pointer to the memory to deallocate on the specified memory space.
-
MemorySpace
: Controls the storage location. If omitted the default memory space of the default execution space is used (i.e. Kokkos::DefaultExecutionSpace::memory_space`).
On success, returns a pointer to the beginning of the newly allocated memory. To avoid a memory leak, the returned pointer must be deallocated with Kokkos::kokkos_free()
, the original pointer ptr
is invalidated and any access to it is undefined behavior (even if reallocation was in-place).
On failure, returns a null pointer. The original pointer ptr remains valid and may need to be deallocated with Kokkos::kokkos_free()
.
Home:
- Introduction
- Machine Model
- Programming Model
- Compiling
- Initialization
- View
- Parallel Dispatch
- Hierarchical Parallelism
- Custom Reductions
- Atomic Operations
- Subviews
- Interoperability
- Kokkos and Virtual Functions
- Initialization and Finalization
- View
- Data Parallelism
- Execution Policies
- Spaces
- Task Parallelism
- Utilities
- STL Compatibility
- Numerics
- Detection Idiom