Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
amrex::Gpu::Device Class Reference

#include <AMReX_GpuDevice.H>

Static Public Member Functions

static void Initialize (bool minimal, int a_device_id)
static void Finalize ()
static gpuStream_t gpuStream () noexcept
static cudaStream_t cudaStream () noexcept
static int numGpuStreams () noexcept
static void setStreamIndex (int idx) noexcept
static void resetStreamIndex () noexcept
static int streamIndex (gpuStream_t s=gpuStream()) noexcept
static gpuStream_t setStream (gpuStream_t s) noexcept
static gpuStream_t resetStream () noexcept
static void setExternalStream (gpuStream_t s)
static void resetExternalStream (ExternalStreamSync sync_stream=ExternalStreamSync::Yes) noexcept
static bool usingExternalStream () noexcept
static int deviceId () noexcept
static int numDevicesUsed () noexcept
static int numDevicePartners () noexcept
static void synchronize ()
static void streamSynchronize () noexcept
static void streamSynchronize (gpuStream_t s) noexcept
static void streamSynchronizeActive () noexcept
static void streamSynchronizeAll () noexcept
static void freeAsync (Arena *arena, void *mem) noexcept
static void streamOrderedFreeAsync (Arena *arena, void *mem, gpuStream_t stream) noexcept
static bool clearFreeAsyncBuffer () noexcept
static void mem_advise_set_preferred (void *p, std::size_t sz, int device)
static void mem_advise_set_readonly (void *p, std::size_t sz)
static void setNumThreadsMin (int nx, int ny, int nz) noexcept
static void n_threads_and_blocks (const Long N, dim3 &numBlocks, dim3 &numThreads) noexcept
static void c_comps_threads_and_blocks (const int *lo, const int *hi, const int comps, dim3 &numBlocks, dim3 &numThreads) noexcept
static void c_threads_and_blocks (const int *lo, const int *hi, dim3 &numBlocks, dim3 &numThreads) noexcept
static void grid_stride_threads_and_blocks (dim3 &numBlocks, dim3 &numThreads) noexcept
static std::size_t totalGlobalMem () noexcept
static std::size_t sharedMemPerBlock () noexcept
static int numMultiProcessors () noexcept
static int maxThreadsPerMultiProcessor () noexcept
static int maxThreadsPerBlock () noexcept
static int maxThreadsPerBlock (int dir) noexcept
static int maxBlocksPerGrid (int dir) noexcept
static std::string deviceName () noexcept
static bool isIntegrated () noexcept
 Whether the GPU shares its memory with the host (e.g., an APU).
static int devicePropMajor () noexcept
static int devicePropMinor () noexcept
static std::string deviceVendor () noexcept
static std::size_t freeMemAvailable ()
static void profilerStart ()
static void profilerStop ()
static int managedMemorySupported () noexcept
static int memoryPoolsSupported () noexcept
static unsigned int maxBlocksPerLaunch () noexcept

Static Public Attributes

static constexpr int warp_size = 32

Friends

struct ExternalGpuStreamRegion

Member Function Documentation

◆ c_comps_threads_and_blocks()

void amrex::Gpu::Device::c_comps_threads_and_blocks ( const int * lo,
const int * hi,
const int comps,
dim3 & numBlocks,
dim3 & numThreads )
staticnoexcept

◆ c_threads_and_blocks()

void amrex::Gpu::Device::c_threads_and_blocks ( const int * lo,
const int * hi,
dim3 & numBlocks,
dim3 & numThreads )
staticnoexcept

◆ clearFreeAsyncBuffer()

bool amrex::Gpu::Device::clearFreeAsyncBuffer ( )
staticnoexcept

◆ cudaStream()

cudaStream_t amrex::Gpu::Device::cudaStream ( )
inlinestaticnoexcept

for backward compatibility

◆ deviceId()

int amrex::Gpu::Device::deviceId ( )
staticnoexcept

◆ deviceName()

std::string amrex::Gpu::Device::deviceName ( )
inlinestaticnoexcept

◆ devicePropMajor()

int amrex::Gpu::Device::devicePropMajor ( )
inlinestaticnoexcept

◆ devicePropMinor()

int amrex::Gpu::Device::devicePropMinor ( )
inlinestaticnoexcept

◆ deviceVendor()

std::string amrex::Gpu::Device::deviceVendor ( )
inlinestaticnoexcept

◆ Finalize()

void amrex::Gpu::Device::Finalize ( )
static

◆ freeAsync()

void amrex::Gpu::Device::freeAsync ( Arena * arena,
void * mem )
staticnoexcept

◆ freeMemAvailable()

std::size_t amrex::Gpu::Device::freeMemAvailable ( )
static

◆ gpuStream()

gpuStream_t amrex::Gpu::Device::gpuStream ( )
inlinestaticnoexcept

◆ grid_stride_threads_and_blocks()

void amrex::Gpu::Device::grid_stride_threads_and_blocks ( dim3 & numBlocks,
dim3 & numThreads )
staticnoexcept

◆ Initialize()

void amrex::Gpu::Device::Initialize ( bool minimal,
int a_device_id )
static

◆ isIntegrated()

bool amrex::Gpu::Device::isIntegrated ( )
inlinestaticnoexcept

Whether the GPU shares its memory with the host (e.g., an APU).

◆ managedMemorySupported()

int amrex::Gpu::Device::managedMemorySupported ( )
inlinestaticnoexcept

◆ maxBlocksPerGrid()

int amrex::Gpu::Device::maxBlocksPerGrid ( int dir)
inlinestaticnoexcept

◆ maxBlocksPerLaunch()

unsigned int amrex::Gpu::Device::maxBlocksPerLaunch ( )
inlinestaticnoexcept

◆ maxThreadsPerBlock() [1/2]

int amrex::Gpu::Device::maxThreadsPerBlock ( )
inlinestaticnoexcept

◆ maxThreadsPerBlock() [2/2]

int amrex::Gpu::Device::maxThreadsPerBlock ( int dir)
inlinestaticnoexcept

◆ maxThreadsPerMultiProcessor()

int amrex::Gpu::Device::maxThreadsPerMultiProcessor ( )
inlinestaticnoexcept

◆ mem_advise_set_preferred()

void amrex::Gpu::Device::mem_advise_set_preferred ( void * p,
std::size_t sz,
int device )
static

◆ mem_advise_set_readonly()

void amrex::Gpu::Device::mem_advise_set_readonly ( void * p,
std::size_t sz )
static

◆ memoryPoolsSupported()

int amrex::Gpu::Device::memoryPoolsSupported ( )
inlinestaticnoexcept

◆ n_threads_and_blocks()

void amrex::Gpu::Device::n_threads_and_blocks ( const Long N,
dim3 & numBlocks,
dim3 & numThreads )
staticnoexcept

◆ numDevicePartners()

int amrex::Gpu::Device::numDevicePartners ( )
staticnoexcept

◆ numDevicesUsed()

int amrex::Gpu::Device::numDevicesUsed ( )
staticnoexcept

◆ numGpuStreams()

int amrex::Gpu::Device::numGpuStreams ( )
inlinestaticnoexcept

◆ numMultiProcessors()

int amrex::Gpu::Device::numMultiProcessors ( )
inlinestaticnoexcept

◆ profilerStart()

void amrex::Gpu::Device::profilerStart ( )
static

◆ profilerStop()

void amrex::Gpu::Device::profilerStop ( )
static

◆ resetExternalStream()

void amrex::Gpu::Device::resetExternalStream ( ExternalStreamSync sync_stream = ExternalStreamSync::Yes)
staticnoexcept

Pop the current external stream and optionally synchronize it.

◆ resetStream()

gpuStream_t amrex::Gpu::Device::resetStream ( )
staticnoexcept

◆ resetStreamIndex()

void amrex::Gpu::Device::resetStreamIndex ( )
inlinestaticnoexcept

◆ setExternalStream()

void amrex::Gpu::Device::setExternalStream ( gpuStream_t s)
static

Override the current GPU stream with a user supplied stream.

◆ setNumThreadsMin()

void amrex::Gpu::Device::setNumThreadsMin ( int nx,
int ny,
int nz )
staticnoexcept

◆ setStream()

gpuStream_t amrex::Gpu::Device::setStream ( gpuStream_t s)
staticnoexcept

◆ setStreamIndex()

void amrex::Gpu::Device::setStreamIndex ( int idx)
staticnoexcept

◆ sharedMemPerBlock()

std::size_t amrex::Gpu::Device::sharedMemPerBlock ( )
inlinestaticnoexcept

◆ streamIndex()

int amrex::Gpu::Device::streamIndex ( gpuStream_t s = gpuStream())
staticnoexcept

◆ streamOrderedFreeAsync()

void amrex::Gpu::Device::streamOrderedFreeAsync ( Arena * arena,
void * mem,
gpuStream_t stream )
staticnoexcept

◆ streamSynchronize() [1/2]

void amrex::Gpu::Device::streamSynchronize ( )
staticnoexcept

Halt execution of code until the current AMReX GPU stream has finished processing all previously requested tasks.

◆ streamSynchronize() [2/2]

void amrex::Gpu::Device::streamSynchronize ( gpuStream_t s)
staticnoexcept

◆ streamSynchronizeActive()

void amrex::Gpu::Device::streamSynchronizeActive ( )
staticnoexcept

Halt execution of code until all active AMReX GPU streams have finished processing all previously requested tasks. If we are in single stream region, only stream 0 is considered active. Otherwise all streams are active.

◆ streamSynchronizeAll()

void amrex::Gpu::Device::streamSynchronizeAll ( )
staticnoexcept

Halt execution of code until all AMReX GPU streams have finished processing all previously requested tasks.

◆ synchronize()

void amrex::Gpu::Device::synchronize ( )
static

Halt execution of code until GPU has finished processing all previously requested tasks.

◆ totalGlobalMem()

std::size_t amrex::Gpu::Device::totalGlobalMem ( )
inlinestaticnoexcept

◆ usingExternalStream()

bool amrex::Gpu::Device::usingExternalStream ( )
staticnoexcept

◆ ExternalGpuStreamRegion

friend struct ExternalGpuStreamRegion
friend

Member Data Documentation

◆ warp_size

int amrex::Gpu::Device::warp_size = 32
staticconstexpr

The documentation for this class was generated from the following files: