lcls2
C++ API: public headers of xtcdata, psalg, psdaq and psana
Loading...
Searching...
No Matches
GpuAsync.h File Reference
#include "DmaDriver.h"

Classes

struct  GpuNvidiaData
 struct GpuNvidiaData - Represents NVIDIA GPU memory data. More...
 

Macros

#define GPU_Add_Nvidia_Memory   0x8002
 GPU command codes.
 
#define GPU_Rem_Nvidia_Memory   0x8003
 
#define GPU_Set_Write_Enable   0x8004
 
#define GPU_Is_Gpu_Async_Supp   0x8005
 
#define GPU_Get_Gpu_Async_Ver   0x8006
 
#define GPU_Get_Max_Buffers   0x8007
 

Functions

static ssize_t gpuAddNvidiaMemory (int32_t fd, uint32_t write, uint64_t address, uint32_t size)
 gpuAddNvidiaMemory - Adds a NVIDIA GPU memory region.
 
static ssize_t gpuRemNvidiaMemory (int32_t fd)
 gpuRemNvidiaMemory - Removes a NVIDIA GPU memory region.
 
static ssize_t gpuSetWriteEn (int32_t fd, uint32_t idx)
 gpuSetWriteEn - Set write enable for buffer @dev: pointer to the DMA device structure
 
static bool gpuIsGpuAsyncSupported (int32_t fd)
 gpuIsGpuAsyncSupported - Check if the firmware supports GPU Async @fd: File descriptor for the device
 
static uint32_t gpuGetGpuAsyncVersion (int32_t fd)
 gpuGetGpuAsyncVersion - Get the version of GpuAsyncCore in the firmware @fd: File descriptor for the device
 
static uint32_t gpuGetMaxBuffers (int32_t fd)
 gpuGetMaxBuffers - Get the max number of DMA buffers @fd: File descriptor for the device
 

Macro Definition Documentation

◆ GPU_Add_Nvidia_Memory

#define GPU_Add_Nvidia_Memory   0x8002

GPU command codes.


Company : SLAC National Accelerator Laboratory

Description: Provides definitions and inline functions for utilizing GPU asynchronous features within the aes_stream_drivers package.

This code is specifically designed for managing NVIDIA GPU memory in a Linux kernel module, offering functionality to add and remove memory

regions for GPU access.

This file is part of the aes_stream_drivers package. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the aes_stream_drivers package, including this file, may be copied, modified, propagated, or distributed except according to the terms

contained in the LICENSE.txt file.

◆ GPU_Get_Gpu_Async_Ver

#define GPU_Get_Gpu_Async_Ver   0x8006

◆ GPU_Get_Max_Buffers

#define GPU_Get_Max_Buffers   0x8007

◆ GPU_Is_Gpu_Async_Supp

#define GPU_Is_Gpu_Async_Supp   0x8005

◆ GPU_Rem_Nvidia_Memory

#define GPU_Rem_Nvidia_Memory   0x8003

◆ GPU_Set_Write_Enable

#define GPU_Set_Write_Enable   0x8004

Function Documentation

◆ gpuAddNvidiaMemory()

static ssize_t gpuAddNvidiaMemory ( int32_t  fd,
uint32_t  write,
uint64_t  address,
uint32_t  size 
)
inlinestatic

gpuAddNvidiaMemory - Adds a NVIDIA GPU memory region.

@fd: File descriptor for the device. @write: Write access flag (1 for write access, 0 for read-only). @address: Memory address of the GPU region to add. @size: Size of the memory region to add. This must be a multiple of 64kb

This function adds a specified memory region to the NVIDIA GPU, allowing for the region to be accessed as specified by the write flag.

Return: On success, returns the result of the ioctl call. On failure, returns a negative error code. Returns -ENOTSUPP if the firmware does not support GPUDirect.

◆ gpuGetGpuAsyncVersion()

static uint32_t gpuGetGpuAsyncVersion ( int32_t  fd)
inlinestatic

gpuGetGpuAsyncVersion - Get the version of GpuAsyncCore in the firmware @fd: File descriptor for the device

Return: Returns the version of GpuAsyncCore, or 0 if not supported. Returns -ENOTSUPP if the driver was compiled without GPUAsync support.

◆ gpuGetMaxBuffers()

static uint32_t gpuGetMaxBuffers ( int32_t  fd)
inlinestatic

gpuGetMaxBuffers - Get the max number of DMA buffers @fd: File descriptor for the device

Return: Returns the number of DMA buffers available for use. Returns -ENOTSUPP if the driver was compiled without GPUAsync support.

◆ gpuIsGpuAsyncSupported()

static bool gpuIsGpuAsyncSupported ( int32_t  fd)
inlinestatic

gpuIsGpuAsyncSupported - Check if the firmware supports GPU Async @fd: File descriptor for the device

Return: 1 if the firmware and driver supports GPU Async, 0 if it doesn't.

◆ gpuRemNvidiaMemory()

static ssize_t gpuRemNvidiaMemory ( int32_t  fd)
inlinestatic

gpuRemNvidiaMemory - Removes a NVIDIA GPU memory region.

@fd: File descriptor for the device.

This function removes a previously added memory region from the NVIDIA GPU, ceasing its accessibility.

Return: On success, returns the result of the ioctl call. On failure, returns a negative error code. Returns -ENOTSUPP if the firmware does not support GPUDirect.

◆ gpuSetWriteEn()

static ssize_t gpuSetWriteEn ( int32_t  fd,
uint32_t  idx 
)
inlinestatic

gpuSetWriteEn - Set write enable for buffer @dev: pointer to the DMA device structure

  • : user space argument pointing to buffer index

This function enables a DMA buffer for DMA operations.

Return: 0 on success, negative error code on failure. Returns -ENOTSUPP if the firmware does not support GPUDirect.