A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://kokkos.github.io/kokkos-core-wiki/API/core/c_style_memory_management/realloc.html below:

kokkos_realloc - Kokkos documentation

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.

Description
template<class MemorySpace = Kokkos::DefaultExecutionSpace::memory_space>
void *kokkos_realloc(void *ptr, size_t new_size);
Template Parameters:

MemorySpace – Controls the storage location. If omitted the memory space of the default execution space is used (i.e. Kokkos::DefaultExecutionSpace::memory_space).

Parameters:
  • ptr – The pointer to the memory area to be reallocated.

  • new_size – The new size in bytes.

Returns:

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().

Throws:

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