Toggle table of contents sidebar
kokkos_realloc
¶
Defined in header <Kokkos_Core.hpp>
Reallocates the given area of memory. It must be previously allocated by Kokkos::kokkos_malloc()
or Kokkos::kokkos_realloc()
on the same memory space MemorySpace
and not yet freed with Kokkos::kokkos_free()
, otherwise, the results are undefined.
Warning
Calling any function that manipulates the behavior of the memory (e.g. memAdvise
) on memory managed by Kokkos
results in undefined behavior.
MemorySpace – Controls the storage location. If omitted the memory space of the default execution space is used (i.e. Kokkos::DefaultExecutionSpace::memory_space
).
ptr – The pointer to the memory area to be reallocated.
new_size – The new size in bytes.
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()
.
On failure, throws Kokkos::Experimental::RawMemoryAllocationFailure
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4